(Sorry if this isn’t the right category, as this is about client-side dev rather than Discourse dev proper, but it looked like the closest fitting category.)
I’m writing a Discourse mail “treatment” for Emacs’ Gnus and among other things, this treatment adds links on user names of the form
@<user> leading to the user’s profile at
To construct this user profile URL, I extract
<forum-url> from the mail header’s
Message-ID: field which seems of the form
<...@forum-url> (based on the couple of forums I’ve tested this on).
Can I count on
Message-ID being of this form for all Discourse forums?
If not, would you consider adding a custom mail header, say
Discourse-Forum: <forum-url>? It would be useful for the purpose described above and also (and more importantly) to determine in a robust way whether an e-mail comes from a Discourse forum or not (and thus whether to apply the treatment).
 I had a previous implementation that extracted the forum URL from the unsubscription link at the end of the e-mail, but I felt it was too brittle.
 The current implementation has a user-customizable list of regexps that match against the value of the
From: field, which is not very user-friendly and not very robust.