[Scottish] procmail - rewrite RHS of email addy

Matt Lowe scottish at mailman.lug.org.uk
Thu May 8 20:43:00 2003

Hi, does anyone know if the following is possible with procmail?

mail comes in and gets passed to procmail
procmail backs up all mail (this bit i got ok!)
procmail then rewrites the RHS of the email addy, and sends the message
onto another domain.

mail sent to matt@testdomain.com
this gets backed upto a local mbox on the mail server
mail then gets forwarded to matt@mail-server.net
(without altering any other headers/message body!)
Sendmail can change the email to matt@mail-server.net
but does not allow for any kind of local mail backup :(

The reason for this is I want to use a local machine as a mail server,
but cant afford to lose any emails (am going to play with spam
filters/mail scanning etc.).  So i want the emails to be backed up, but
also have it sent to mail local mail server (with no apparent changes to
the headers/body except the change to the RHS)

i also need this to work if my email addy is i the CC field or part of a
long list of addresses, or (as in a mailing list) the 'To:' field dosn't
contain my actual email addy.

I know its a tall order, but its the only way i can see of getting this
to work :(


Matt Lowe