Wietse Venema: > Wietse Venema: > > Michael Way: > > > it would be?: > > > if !/[[:<:]]user1\.home@work\.com$/ > > > /./ user1\.home@work\.com Don't use \ in the replacement text! > > > endif > > > > Looks like you want to replace all senders in outbound email by your own > > email address. In that case it is sufficient to do this: > > > > /etc/postfix/main.cf: > > > > sender_canonical_maps = pcre:/etc/postfix/sender_canonical > > sender_canonical_classes = envelope_sender > > > > /etc/postfix/sender_canonical: > > > > /./ your-email-address-here-without-backslashes-garbage > > The problem with this is that it also replaces the sender on inbound > email, that is, if affects mail that you receive, and mail that > you send out.
In case anyone is still following this thread, what the original poster wants to do (forward a copy of his mail to an outside address, while replacing the envelope sender with his inside address) is fundamentally unsafe. It is fundamentally unsafe because mail goes into a loop when forwarded mail is undeliverable. The undeliverable message is returned to the inside email address, there it is forwarded again, then it bounces again, and so on. This is precisely what happens when you use default procmail rules to forward mail. This is also why doing these things was not made easy in Postfix many years ago. So long ago, that I had to re-discover the problem. Wietse