Unofficial news and tips about Google

November 18, 2007

Filter Messages from a Mailing List in Gmail

The new version of Gmail makes it easier to create filters for mailing list. If you select "filter messages like this" when you read a message from a mailing list, Gmail will filter the right messages using the listid: operator, that corresponds to the List-ID header. For example, listid:googlepress.googlegroups.com is the best way to find messages sent from the Google Press group. You should create filters that automatically label these messages, archive them or mark them as read.

Gmail also has a clever way to handle mail sent to a list you are subscribed to: it bypasses the inbox, but it's still available in Sent Mail or in other views. When you set a vacation responder, it won't be sent to mailing lists. If you don't want to read the next replies from a thread, you can ignore them by clicking on "Mute" in the "More actions" menu: all the replies will be archived.

And if you want to "mute" a conversation, the 'm' key is a great shortcut. Mute will remove an email conversation thread from your view unless someone sends an email with you as a specific recipient. I use it all the time when I'm on a mailing list that is hotly debating something that I don't care about at all. :)

Re Patrick: that bothers me too. Previously I've set up a procmail filter to modify the subject of messages before I forward them from another account, and search for that token in the subject. That, however, has the great disadvantage that the marker stays in the subject if you reply to the message.

Now I've changed the filter to add a list-id header instead, but I'd still like to have a way to search for any header.

In the spam mails, I searched for a mail where my address doesn't appear in the details, asked for the original and collected a delivered-to field from there. I formated it as you suggested and performed a search in mail&spam&trash and it returned nothing.

dwalters: I'd like to shake your hand, that trick is exactly what I needed to make forwarding multiple email accounts to gmail not suck!

Patrick: here's what I did: Let's say I have an email address james.bond@blogger.com that forwards to james.bond+blogger@gmail.com. Then try sending a message BCC'ed to james.bond@blogger.com. When you get the e-mail in gmail, view its source (you can do this by clicking the little down arrow next to the time and selecting "show original"), and ensure that one of the first lines says Delivered-To: james.bond+blogger@gmail.com

Now simply create a filter to match that. In the "Has the words" box, enter deliveredto:james.bond+blogger@gmail.com, and test the filter. Alternatively, I have had success just writing deliveredto:blogger

The way you suggest to do supposes you have predefined a forwarding using pluses. Also, it will not work if you try to search for a Delivered-To which is not the last (=top) one. Because in your setup, you have a precise forwarder set up, it's as if what you're actually searching for is a plain "To:" field.

As I wrote above, yes it works BUT only for the last e-mail address the message was delivered (generally your gmail address). You can't use this technique to filter based on a previous e-mail address the message went through (forwarded).

You are right; it only checks the topmost header. I wish there was a way to check for the second to last mailbox the mail was delivered to.So as it stands now, if you just set up an email alias to forward to your gmail, there is no sure way of identifying it within gmail and labeling it unless the email address is explicitly present in the "To:" header.

Gmail fails terribly when there's no List-ID or Mailing-List header on mailing lists (for instance, Majordomo lists such as all the OpenBSD ones). Would like to filter by List-Post in these cases, but don't see any way to, and Gmail doesn't identify them as mailing list messages.

Any suggestions on using Gmail "alias" feature with the '+' operator with google group subscriptions? I am also unable to receive updates from the subscribed Google Groups and since Google Groups doesn't recognized the aliased emails and therefore unable to manage my settings.

Also, if you want to automatically bump any topics you participated in to inbox, there is a (not straightforward) way to do this as well.Here is a short guide for it: http://www.amilkhanzada.com/2012/06/gmail-keeping-mailing-list-topics-you.html