Gmail filtering improvements

Bug #1474071 reported by Colin Watson
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Colin Watson

Bug Description

Surprisingly, there's no open bug which really covers this, despite the fact that it's been an ongoing complaint for years. Since I'm working on it, let's have a tracking bug.

Filtering Launchpad mail using Gmail is hard, because Gmail doesn't support filtering on arbitrary headers. This is a very annoying misbehaviour in a mail user agent, IMO, but there's little obvious likelihood of it being fixed, so we need to work around it. At the same time, we don't want to annoy people using other mail user agents or clutter our ongoing mail too much, and we should also minimise the extent to which evidence of the affordances we add ends up being quoted in replies to outgoing Launchpad mail. https://bugs.launchpad.net/launchpad/+bug/133720 (Won't Fix) suggests modifying the subject line, but that does tend to end up in replies in a few places, and it's not very extensible: we could only put a very small amount of extra information in the subject line at most, and certainly not everything that's currently in Launchpad's custom headers.

The most graceful approach I can think of, and I've tested that this kind of mail can be filtered reasonably using Gmail, is to add a new PersonSettings column that includes additional information in outgoing mail footers, after the "-- " line. Gmail hides this away by default so that you don't have to read it, but you can filter on it. We can modify BaseMailer to take all X-Launchpad-* headers and turn them into "Launchpad-Message-Rationale: Owner\nLaunchpad-Notification-Type: code-review\n" etc. You can then add a Gmail filter with, say, "Launchpad-Notification-Type: code-review" (with quotes) in the "Has the words" field.

The amount of central infrastructure work required for this is very small, and it requires no duplicated code in individual bits of the application that send notifications: I think both of these are required properties of any solution to this problem. However, BaseMailer is only used by a few things right now (branches, merge proposals, recipe builds, live file system builds); so as part of this we'll need to refactor at least the most important notifiers to use it.

Related branches

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

2015-07-17 10:41:39,713 INFO 2209-68-0 applied just now in 0.1 seconds

tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-ok
Changed in launchpad:
status: In Progress → Fix Committed
Colin Watson (cjwatson)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Colin Watson (cjwatson) wrote :

Mostly done, but I'll leave this open for known odds and ends such as bug mail, upload notifications, and team membership mail.

Changed in launchpad:
status: Fix Committed → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-ok
Colin Watson (cjwatson)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Colin Watson (cjwatson) wrote :

Bug mail is handled (unfortunately by means of duplicated code for now), and upload notifications and team membership notifications now go via BaseMailer, so I'm going to call the core of this done. Other things can be handled separately as required or as time permits.

Changed in launchpad:
status: In Progress → Fix Released
Revision history for this message
Jeff Lane  (bladernr) wrote :

Is there something documented somewhere on how to take advantage of this and do better bug mail filtering in GMail?

Revision history for this message
Colin Watson (cjwatson) wrote :
Colin Watson (cjwatson)
no longer affects: ubuntu
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.