Page MenuHomePhabricator

Improve out-of-the-box compatability with Mail.app's threading
Needs ReviewPublic

Authored by talshiri on Jun 25 2014, 12:10 AM.
Tags
None
Referenced Files
F13243203: D9716.diff
Thu, May 23, 3:27 AM
F13234064: D9716.id23330.diff
Tue, May 21, 2:46 AM
F13220906: D9716.diff
Sun, May 19, 2:04 AM
F13215790: D9716.id.diff
Fri, May 17, 7:49 PM
F13210062: D9716.id23330.diff
Fri, May 17, 3:41 AM
F13206390: D9716.diff
Wed, May 15, 8:44 AM
F13202907: D9716.diff
Tue, May 14, 11:17 PM
F13193909: D9716.id.diff
Sun, May 12, 7:11 PM
Subscribers

Details

Summary

Mail.app is a little touchy about how it does threading.
If your mail adapter supports the Message-ID email header AND follow-up messages are prefixed with "Re: ",
it will correctly thread messages together.

This change changes the behavior of subject consturction:

  • when metamta.re-prefix is false, Phabricator will prefix "Re: " to follow up messages ONLY, which seems like the sensible thing to do in most cases. This has no negative side-effects as far as I can tell, and it makes Mail.app "just work" if your adapter supports Message-IDs.
  • when metamta.re-prefix is true, it retains the previous behavior of prefixing "Re: " to all messages, including the first one. This is a hack that's only required when your adapter doesn't support Message-IDs (like Amazon SNS & SendGrid. Is this still the case?)

metamta.re-prefix probably needs to be renamed to something else (metamta.force-re-prefix ?) and have a migration script added.

Test Plan

Tested on Gmail and Mail.app, with various combinations (metamta.can-send-as-user turned on and off). Threading now just works, and the topics aren't uglified by it (since the first message is not prefixed with "Re: ")

Diff Detail

Repository
rP Phabricator
Branch
improved_mail.app_support
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1372
Build 1372: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

talshiri retitled this revision from to Improve out-of-the-box compatability with Mail.app's threading.
talshiri updated this object.
talshiri edited the test plan for this revision. (Show Details)
talshiri added a reviewer: epriestley.
talshiri edited edge metadata.

One clarification: the only requirement for this to work is knowing what the Message-ID of the message is.

  • Amazon seems to return some identifier, but it's not clear if this is related to the Message-ID header (I don't have a SNS account to test this).
  • SendGrid: Couldn't find any documentation about this. Don't have an account there either.

I think this is reasonable, but let me find some time to poke at it locally since this stuff is historically super touchy.

FWIW, we've been running this since I've submitted the diff, and it abolished Mail.app threading issues, and we haven't seen any issues elsewhere.