How to disable mail receiving by local users without deleting their accounts
On my server, sendmail is configured to receive mail for all local users.
And that includes "system" users, like
First, enable relevant sendmail feature: open the file
and add this line somewhere in it:
After that, rebuild the actual sendmail config and restart sendmail:
cd /etc/mail; make; service sendmail restart
/etc/mail/access file and add
REJECT rules for them, like this:
After that, rebuild the actual database:
makemap hash /etc/mail/access < /etc/mail/access
And last, test it: write an email to forbidden e-mail address and enjoy automated response from MAILER-DEMON :-)
More information regarding anti-spam protection you can find in the official sendmail documentation (archived version).