procmail
[Top] [All Lists]

Re: formail and changing headers problem

2001-10-02 13:37:18
Adhamh Findlay <adhamh(_at_)apple(_dot_)com> writes:
We are remapping sent to one domain to a different domain.  For example, 
mail sent to user(_at_)olddomain(_dot_)com should be changed to 
user(_at_)domain(_dot_)com(_dot_)   
We currently have this working via the following procmail recipe that 
uses formail (this has been changed slightly) :
...
Is there a way to get only the email addresses that contain 
olddomain.com to be remapped to domain.com and leave the other email 
addresses in the To: header alone?  It seems like this is possible....

Anything is _possible_, whether it's practical or *maintainable* is a
more interesting question.  Note that there are several solutions that
are simple, obvious, and wrong.  The only correct solution is the one
that performs a full parse on the addresses and changes the host portions
as needed.

Fortunately, there's already program on your system which has to do that
parsing and almost certainly can makes the change, namely your MTA.
I know that sendmail and qmail can do what you want and I'm 98% sure
that postfix and exim can do as well.

This is not a filtering problem but a routing problem and should be
handled at that level.


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>