DevHeads.net

is possible modify the source address based on the subject?

hello.
Is possible rewrite the sender address on a send mail when the subject
have some special expression?

By example: if i send an email from <a href="mailto: ... at domain dot com"> ... at domain dot com</a> with the word in
the subject UPDATES, so send the email like sended FROM
<a href="mailto: ... at domain dot com"> ... at domain dot com</a> ??????

can i do that with regrex?

<a href="http://www.postfix.org/ADDRESS_REWRITING_README.html" title="http://www.postfix.org/ADDRESS_REWRITING_README.html">http://www.postfix.org/ADDRESS_REWRITING_README.html</a>

Really and a little bit confused with that Readme.

Thanks in advance.

Comments

Re: is possible modify the source address based on the subject?

By Wietse Venema at 08/07/2018 - 06:53

Your best options involve using software outside of Postfix, because
"change message property X based on the content of some other message
property Y" is not built into Postfix.

- Have your updates sent a local mailing list (you may have to
change your subscription, or use a Procmail rule). The mailing
list manager will replace the sender address with the list sender
address.

- Maybe some Procmail rule can do all this. I don't use Procmail.

- Use a MILTER (milter implementations exist for Perl, Python, C,
and other languages). This can replace any property of an email
message: sender, recipient, header, body, based on arbitrary
criteria (i.e. code that you write).

Wietse

Re: is possible modify the source address based on the subject?

By LuKreme at 08/07/2018 - 16:01

On 07 Aug 2018, at 04:53, Wietse Venema < ... at porcupine dot org> wrote:
You can, with enough staples and duct tape, do *anything* in procmail.

However, it is old, krufty, not under development<1>, has several bugs, doesn’t understand mime, and I don’t recommend it to anyone.

All said, I’m still using it.

<1> Last update was in 2001, site is dead.