Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Add subject prefix to subject based on reply-to/sender email address

755 views
Skip to first unread message

datatwo...@gmail.com

unread,
Sep 22, 2015, 5:30:07 AM9/22/15
to
Hi all
Basically Ive been searching for straight answer on this via google search, run dry...

For my staff, we want to add a prefix to subject, as example "[M] Sender Subject" where was originally "Sender Subject" and only when a specific reply-to or sender address is specified.

This would be used to centrally add to genuine marketing emails a "[M]" to the subject so the end users can add a mail rule looking for [M] if they so choose to filter marketing items (this isnt junk filtering, subscribed and popular items only that are consistent - mail clients outlook, thunderbird, webmail, whatever is used)

Could then also do the same routine for Social media items with a [S] prefixed to subject line.

Anyone got this working via PCRE in postfix header_checks?

Regards, Luke

d.agosti...@gmail.com

unread,
Jan 16, 2016, 9:27:11 AM1/16/16
to
Hi

The Subject field which is part of the mail header is manage by the sender machine (the MUA) and can not be certified. Postfix (the MTA) should not modify this header.

In practice you can modify the subject using a postfix filter which will call an external application (a bash script or a binary one).
http://www.postfix.org/FILTER_README.html

Be award of subject encoding, you can't just add "[M]" you may have to encode the subject in base 64 or Quote Printable if the original subject contains non ascii characters. See https://www.ietf.org/rfc/rfc2047.txt for more information.


Regards

Victor d'Agostino
0 new messages