Andy Smith:
> On 27-01-2021 20:48, Viktor Dukhovni wrote:
> 
> > If absolutely every single message is guaranteed to have a "Reply-To:"
> > that can safely replace "From:", then you could in theory forcibly
> > remove "From:" from every message, and upon encountering "Reply-To:"
> > generate a new matching "From:" (via header_checks defined for the
> > cleanup(8) instance configured for pickup(8)).
> > 
> > However, I very much doubt that your MTA is sufficiently dedicated to
> > just mail from this one user.  If you had a multi-instance 
> > configuration
> > with a dedication null-client instance for just "www" (perhaps PHP or
> > whatever can be configured to run "sendmail -C /etc/postfix-www ..."
> > instead of "sendmail ..."), then perhaps this would be an option.

It's simple enough to replace all instances of [email protected] with
something else:

/etc/postfix/main.cf:
    canonical_maps = 
        inline:{
                { [email protected] = other@address }
        }

That will also take care of headers, and MAIL FROM commands in SMTP.

        Wietse

> > If the Postfix instance also handles mail from any other source,
> > then Postfix built-in header rewriting cannot do what you ask,
> > and you need a milter or content_filter.  Amavis, for example,
> > has sufficient hooks for this.
> 
> Ok, thanks for the info Viktor. Yes it really is just sending from www, 
> well apart from system level messages from root@ etc (mail is relayed to 
> the actual mail server). As this rewrite is not natively possible with 
> Postfix, and it's something I have previously found a solution for with 
> Exim I think that provides me a way to do this. I can have Exim listen 
> on a non standard port, have postfix relay everything there and do the 
> rewrite in Exim. Not exactly a beautiful solution but if it works, and 
> just done a test it does seem to work as expected.
> 
> The reason I'm not just using Exim is due to some issue/bug I'm 
> experiencing with that.
> 
> thanks again, Andy.
> 

Reply via email to