Gmail filters for Launchpad bug email

I get three kinds of email from Launchpad generally:

  1. Regarding bugs I’ve reported or specifically subscribed to
  2. Those assigned to a team I’m a member of
  3. A very occasional question or notification about a code branch I’m subscribed to.

Of these above the second is the most voluminous and the first group is the most important. However sometimes items from group two can be important, depending on the project. Launchpad includes headers for filtering email which I’ve used in Thunderbird. I’ve not been able to create sophisticated filters in Gmail though. Until now.

In the past I just grouped all Launchpad email into a folder. This folder fills up very quickly though and it becomes a burden to identify which items need my action and decreases the effectiveness of Launchpad’s bug tracking. By creating a Gmail label for different kinds of bug email I can better attend to the messages in the proper order.

Here’s my set-up: I use Evolution to access Gmail via IMAP during the work day. Otherwise I use the Gmail web interface. I want the filtering to happen all the time so I use Gmail’s filtering, not Evolution’s. This limits our capabilities significantly. Well, maybe not … read on. 🙂

The trick is to look at the emails for something that Gmail can search on and are constant among emails you want to group by. This prevents us from using the subject or the sender or the recipient. :-/

My end result is to have a label for bugs assigned to or reported by me (including bugs I’ve subscribed to) and one label for each group or project I’ll get bug notifications from. I’m naming the labels Bugs/me, Bugs/artteam (for the Ubuntu Art Team), Bugs/website (for the Ubuntu website) and etc.

I found that all bug email is shown if I search for bugs.launchpad.net. So I’ll use it for all of my searches. I also noticed that the bottom of each email tells me why I got the message. For example, “You have received this email because you are a member of the group Ubuntu Website Editors.” That is the key. Therefore I can do a search like this:

bugs.launchpad.net "Ubuntu Website Editors"

This will show me all of the bugs for that team. I can then create a filter and put that search string in the “Has the words:” field and do a test search.

We’re set. I click next and set the rules:

"Skip the inbox" is checked
"Apply the label" -> Choose "new label" -> Name my new label Bugs/website
"Also apply filter to x conversations below" is checked

Then I click “create filter.” The interesting thing above that I’ve not mentioned yet is the label I chose. By creating a label with a / in it then when accessed via IMAP it will appear as a folder. So if I go on to create labels called Bugs/artteam and Bugs/me my IMAP client will show a “bugs” folder with three sub folders.

Speaking of Bugs/me, this filter is different than the others. The search string I used here is:

bugs.launchpad.net ("direct subscriber" | "bug assignee")

Any bug that gets assigned to me or to which I subscribe is put in the “me” folder. Because Gmail’s labels are different than true IMAP folders it means that some email threads will show up in multiple places.

I’ve only implemented this solution today so no long-term testing has been done yet, but already I’ve been able to burn through a huge backlog of bug emails simply by marking as read the bugs in entire folders and focusing my concentration on the “me” folder.

There are a few emails (about 20 in the last year or so) that didn’t get caught by the filter. A couple pre-date changes in the way Launchpad sends its emails. Others were related to “answers” and subscribed branches. The volume is so small that I foresee being able to deal with these special cases as they appear in my inbox. Maybe you have more of these special cases than I do. I hope that my explanations above are clear and you can adapt the solution to your own mailbox. Feel free to leave comments about your adaptations so that others can benefit from them.

**Bonus tip:

Do you use Gmail all the time? If so you can have your labels appear as folders that can be expanded and collapsed, just like in an IMAP email client. There are two ways to accomplish this, the simplest to install is the “Better Gmail 2” extension for Firefox, the other is the “Folders4Gmail” Greasemonkey user script. “Better Gmail” is a compilation of stand-alone Greasemonkey user scripts including the Folders4Gmail package. I decided I didn’t need most of those features and already had Greasemonkey so use only the Folders4Gmail.

10 Responses to “Gmail filters for Launchpad bug email”

  1. gmb Says:

    This is great. I believe Google Labs now offers a way to export filters; fancy providing a generic download for us all somewhere ;)?

  2. Jim Campbell Says:

    This is the best blog post ever. 🙂 Thanks for sharing this.

  3. Michael Rooney Says:

    Thanks for this great tip, I’ve been having some troubles with this as well. Using bugs.launchpad.net as a key seems to work well.

  4. Zac Says:

    Thanks for the tip also.

  5. nic Says:

    What I did is signed up to Launchpad using the email address username+bugs@gmail.com rather than username@gmail.com. Appending +bugs to the username doesn’t affect your ability to receive emails, but allows you to filter Launchpad mail by creating a filter based on the email recipient. So, all emails sent to username+bugs@gmail.com get a certain label.

  6. Matthew Nuzum Says:

    Hi, I’ve created a new filter, I haven’t tested it a lot yet, but here it is:

    Create a new filter and put in the “Has the words” box this string:

    “bug has been marked a duplicate” | “Status: Fix Released”

    Then do a test search. It should show you all the threads that have a message in them where the email has been marked a duplicate or the status set to “fix released.” You can then set your filter to mark these as read so you don’t get that age-old, “two new emails for every bug you close” problem.

  7. Elias K Gardner Says:

    I’m a very occasional bug subscriber for this reason I would like all of the bug related emails sent to me from various bug trackers to receive my bug label. I found this post a few weeks ago and have been happily using its advice. Now however my new bugs are not getting labeled appropriately. In the “has the words” box I have the following.

    https://sourceforge.net/tracker/ OR bugs.launchpad.net OR http://bugzilla.gnome.org OR bugs-noreply@adobe.com OR Atlassian JIRA OR @bugs.debian.org

    A new filter with just bugs.launchpad.net or https://bugs.launchpad.net/bugs/ works fine. Is my syntax wrong somehow? Some of the other bugtracker’s emails still get labeled correctly I’m not sure which ones yet. Does anybody know whats going wrong?

  8. Launchpad Blog Says:

    […] Nuzum wrote an excellent guide to filtering Launchpad bug mail. It’s aimed at Gmail users but you can tailor it to your own mail […]

  9. Kangarooo Says:

    # For ubuntu lists filter Matches: to:(lists.ubuntu.com) Do this: Skip Inbox, Apply label “0UBUNTU LISTS”
    #

    For LaunchPad Bugs filter Matches: to:(email+bugs@gmail.com) Do this: Skip Inbox, Apply label “0Launchpad” and also in LP profile put email as email+bugs@gmail.com couse it will still be delivered to email@gmail.com but is easyr to track with email+bugs@gmail.com
    #

    For LaunchPad Lists Filter Matches: to:(lists.launchpad.net | lists.canonical.com) Do this: Skip Inbox, Apply label “0LP lists”

  10. Javier Says:

    This problem could be easily solved if Gmail allowed to filter by any arbitrary header. After waiting for years for this feature, I’ve decided to implement a Gmail application that addresses this issue:
    http://ww.filtermygmail.com

    Any feedback would be more than welcome. Thanks.

Leave a Reply