Sunday, June 3, 2012

Gmail: Automatically Bumping Mailing List Topics You Participated in to Your Inbox

If you are subscribed to a mailing list, you may have set up a filter in Gmail to keep these messages out of your inbox and instead under a special label for that mailing list.
   Matches: list:“<>
    Do this: Skip Inbox, Apply label “GNU-discuss”

However, you may want messages from threads that you participated in to come directly to your inbox. For example, it may be possible that a thread you posted in last month, got a response today, requiring your attention.
Muting every single thread that you do not participate in is also too much work. So, how can we get Gmail to bump any threads we posted in to our inbox?

A naive approach would be to have two filters. The first matching any messages from you, to you, or cc'ing you and the second for any messages not from you, to you, or cc'ing you. However, the problem with this is that many posters will NOT cc you in their responses. On top of this, many posters won't even quote the text from a previous message from you.
    Matches: (list:“<>” AND -(from:me OR to:me OR cc:me))
    Do this: Skip Inbox, Apply label “GNU-discuss”
    Matches: (list:“<>” AND (from:me OR to:me OR cc:me))
    Do this: Apply label “GNU-discuss”
So, how can we handle this?

Here's one solution. First, we will need to create 2 labels.
1. GNU-discuss (for the entire mailing list)
2. GNU-discuss/GNU-discuss-me (for messages in the mailing list that you participated in)

Next, we will need 2 filters. The first will apply the label GNU-discuss-me to any thread you post in. The second will archive any messages that do not have the label GNU-discuss-me and apply the label GNU-discuss. Optionally, you can also add a third filter to label all messages in GNU-discuss-me as GNU-discuss.

Note, that Gmail may warn you that filters containing "label:" will never match incoming mail, but we are okay in this case. The reason is because filters are processed in the order they appear in Gmail, so the GNU-discuss-me label will be applied before it reaches this filter and thus the "label:" clause will function correctly.

Also, there is a unanticipated fringe case associated with the "from:me" clause in Gmail: it will match messages from anybody with a e-mail address. This can get annoying because if there is a user actively posting on the mailing list, his messages will always get bumped to your inbox. Thankfully, there is a workaround: "from(me"

Here is how the final result looks:
    Matches: (list:“<>” AND (from:(me OR to:(me OR cc:(me
    Do this: Apply label “GNU-discuss/GNU-dicuss-me
    Matches: list:“<>” -label:0Amil-dicuss-0Amil-discuss-me
    Do this: Skip Inbox, Apply label “GNU-discuss”
    Matches: label:GNU-dicuss-GNU-discuss-me
    Do this: Apply label “GNU-discuss”

It took me a while to figure this out, with a pen, paper, and Gmail's advanced search documentation, but hopefully this helps you out.
If you have any questions or suggestions (possibly for a simpler solution), feel free to post a comment.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.