Routing all mail to unknown users to a single mail account
Recently one of our clients mail server was getting lots email message from unknown users which was causing some trouble so I decided to route all mail to unknown users (for verification ) to a single mail account. This server use sendmail MTA. Sendmail has option called LUSER_RELAY.
Open Sendmail configuration file sendmail.mc using text editor:
# vi /etc/mail/sendmail.mc
Add following macro to file:
define(`LUSER_RELAY',`local:username@myhost.com')dnl
Rebuild sendmail.cf:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Reload configuration:
# /etc/init.d/sendmail restart
Please note that you can also configure virtual domains but it will take some time to configure sendmail virtual domains.
See also:
- Configure sendmail as a smart host
- Force sendmail to route mail to specific hosts or mailserver
- See the list of sendmail domain-dependent macros
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- How to redirect one users mail to another user with postfix
- An introduction to UNIX mail service
- FreeBSD > Sending a Message by E-Mail
- How to setup Linux antivirus and antispam mail server
- Test mail server for an open relay
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


Recent Comments
Today ~ 10 Comments
Today ~ 3 Comments
Today ~ 7 Comments
Today ~ 4 Comments
Today ~ 8 Comments