The development server should not really send mail to addresses. The emails from the dev server should be gathered in a nice, central location so the developers can look at it.
If you're using sendmail, add to sendmail.mc:
The space between
Don't forget to regenerate the sendmail.cf file (i.e. run
The above will redirect all mail to the local account william. The headers (From and To) all stay intact. For SMTP mailers, this will only change the recipient address in the envelope, not the address in the headers.
To redirect to an SMTP mailer, use:
That will send all emails to email@example.com.
To test, you can use sendmail -bt:
canonify input: someuser @ example . com
Canonify2 input: someuser < @ example . com >
Canonify2 returns: someuser < @ example . com . >
canonify returns: someuser < @ example . com . >
parse input: someuser < @ example . com . >
Parse0 input: someuser < @ example . com . >
Parse0 returns: someuser < @ example . com . >
ParseLocal input: someuser < @ example . com . >
Note that this will also redirect emails for local users, which may not be what you want:
canonify input: root
Canonify2 input: root
Canonify2 returns: root
canonify returns: root
Please consult the Sendmail Installation and Operation Guide for more information on the exact syntax of rewrite rules, and what the different rulesets do.
Random Notes >