Routing all mail to unknown users to a single mail account

Posted: September 14, 2008 in LINUX
Tags: ,

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.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s