Change envelope sender for forwarded messages?

Norbert Schmidt at
Wed Mar 25 12:20:27 GMT 2009

> ----- Message from John Wilcock <john at> on Tue, 24 Mar 2009 18:
> 10:45 +0100 -----
> To:
> MailScanner discussion <mailscanner at>
> Subject:
> Change envelope sender for forwarded messages?
> I'm trying to set up selective forwarding to an external account to 
> enable my boss to receive mail on her mobile phone. Her key requirement 
> is that the original sender mustn't be aware that the forwarding is 
> happening, and in particular must not receive a nondelivery notice even 
> if her external mailbox is full.
> In other words, I need to change the envelope sender on forwarded 
> messages. I've tried various solutions, including a forward action in a 
> ruleset on Non Spam Actions, but the original envelope sender is 
> I'm open to all suggestions, in MailScanner or elsewhere on the server 
> (running postfix and dovecot). I've also tried postfix's 
> recipient_bcc_maps or a redirect action in a dovecot deliver LDA sieve 
> filter, but in all cases the envelope sender is used unchanged and I 
> can't see any way to rewrite it.
> Any suggestions?
> John.
I've done it on postfix with a sender_canonical_map:
put this into
sender_canonical_maps = regexp:/etc/postfix-10025/sender_canonical
and this into the sender_canonical file:

/^/     new_envelope_sender at

This will change the envelope sender on all incoming mail. I've routed the 
special mail that needed to be processed through this to a second instance 
of postfix running on port 10025.
This does the job fine and in our case you even see the unchanged from: in 
the mail. 



Norbert Schmidt | IT / Systems
Interactive Data Managed Solutions AG
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MailScanner mailing list