Venkat:
> What I am trying to do is:
> 
> Setup a SMTP relay for outgoing mail where:
> (a) All From: headers of the form u...@cooldomain1.com (example) are
> rewritten to be no-re...@cooldomain2.com
> (b) A Reply-To: header with the original u...@cooldomain1.com is added
> 
> I have achieved this by using this combination:
> -- using sender_canonical_maps set to:
> @cooldomain1.com  no-re...@cooldomain2.com
> -- using header_checks set to:
> /^From: (.*@cooldomain1\.com)/ PREPEND Reply-To:$1
> 
> This seems to work. However, I am not sure if this is a good
> approach or would using a milter (FILTER action in header_checks)
> be a better way? If so, is there a pre-existing milter available
> for this that is recommended? Thanks all.

Your configuration should be safe, if I read Postfix documentation
carefully. Remember, undocumented Postfix behavior is not covered
by any promise of future compatibility.

The header_checks manpage promises that PREPENDed text is not subject
to header_checks or address rewriting, and that it does not affect
the way that Postfix adds missing message headers.  So this part
of your design is safe.

Does Postfix documentation promise that header_checks happen before
address rewriting? It makes that promise in a non-obvious manner.

The text for the "REPLACE" action says that the replacement text
will be subject to address rewriting (among other things). This
suggests that header_checks happen before address rewriting.

So there is an implicit promise that header_checks happen before
address rewriting. This order should probably be documented, along
with the relative timing of Milter activity.

        Wietse

Reply via email to