Installing and Administering Internet Services

194 Chapter4
Installing and Administering sendmail
Configuring sendmail to Reject Unsolicited Mail
Configuring sendmail to Reject Unsolicited
Mail
You can set up sendmail so that unsolicited or spam mail (unsolicited
mail sent to large numbers of users) is not transmitted through or
received by users on the network.
The first step in configuration is to enable the anti-spamming rulesets.
You then edit other configuration files to control mail transmission. This
section describes how you can:
Accept or reject mail from particular senders
Prevent your machine from being used as a relay machine
Accept or reject connections from specific users hostnames based on
domains, or IP addresses
Enable or disable mail transfers from specific senders and recipient
pairs
Enabling “Anti-Spamming” Capability
1. Open the sendmail configuration file, sendmail.cf.
2. Uncommenting the following rulesets located between #Begin
Anti-Spamming and #End Anti-Spamming in the sendmail.cf file.
check_mail
check_rcpt
check_relay
check_compat
Accepting and Rejecting Mail From Particular
Senders
By default sendmail accepts mail from all users and all domains. You can
set up sendmail to filter mail using the sender’s address in the SMTP
MAIL FROM command. You can use the check_mail ruleset to refuse or
reject mail messages from specific users or domains. To specify users and
domains from whom you do not want to receive mail messages, edit the