Sorry I didn't read your e-mail before hitting the send button. You are correct about it going into a loop, and the only way to stop it is to remove the rules in main.cf and then postfix reload.
I'm wondering why you call it "unsafe"? Is this because it will fill up your log files if you don't realize it? I suppose I'm going to have to find another solution. Apparently Thunderbird has a way to wrap the header with the appropriate information, but I'm not a fan of doing things this way. thanks, mike On Tue, Jun 7, 2011 at 8:48 AM, Wietse Venema <wie...@porcupine.org> wrote: > 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 >