Accepting email for unknown users in Sendmail

No Comments

By default, Sendmail will reject or bounce any incoming email addressed to users who doesn’t exist as real users or as aliases in the system. If you wish to setup Sendmail to accept all incoming email and redirect it to a recycle bin, you may follow the steps below: -

1. Backup your /etc/mail/sendmail.mc and /etc/mail/sendmail.cf

2. Add the following line at the end of this /etc/mail/sendmail.mc file: -
define(`LUSER_RELAY', `local:nosuchuser')dnl

3. Then, you must run the m4 as below: -
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

4. Add the following line in /etc/aliases file: -
nosuchuser: /dev/null

5. Finally, run the newaliases as below: -
newaliases

If you found these helpful, please contribute to help:

Leave a Reply