Installing and Administering Internet Services
204 Chapter4
Installing and Administering sendmail
Configuring sendmail to Reject Unsolicited Mail
If any of the“check” rulesets (check_mail, check_rcpt,check_relay,or
check_compat) or the header checking ruleset resolves a mail address to
the $#discard mailer, then all the SMTP commands will be accepted,
but the message will be discarded. If only one of message recipients
address resolves to the $#discard mailer, none of the recipients will
receive the mail message.
Regular Expressions
You can use regular expressions with the new map class “regex." The
regex map can be used to see if an address matches a certain regular
expression. By using such a map in a “check” rulesets (check_mail,
check_rcpt, check_relay, or check_compat), you can block a certain
range of addresses that would otherwise be considered valid.
For example, if you want to block all senders with all numeric user
names, such as 2312343@bigisp.com, you would use
SLocal_check_mail and the new regex map:
#LOCAL_CONFIG
Kallnumbers regex -a@MATCH ^[0-9]+$
LOCAL_RULESETS
SLocal_check_mail # check address against\
various regex checks
R$* $: $>Parse0 $>3 $1
R$+ < @ bigisp.com. >48 $: $(allnumbers $1 $)
R@MATCH $#error $:553 Header Error
Defining Hosts Allowed to Relay: Class R
You can use the $=R macro to define the hosts that are allowed to relay.
The default file sendmail uses to read values for the $=R macro is
/etc/mail/relay-domains.
Queue Changes
This section describes miscellaneous enhancements to the queue option:
• Allow multiple -qI, -qR, or -qS queue run limiters
For example, using sendmail -qRfoo -qRbar will deliver mail to
recipients with foo or bar in their address.
• There is a new map flag "-Tx" appends "x" to lookups that return
temporary failure. This is similar to "-ax" flag which appends "x" to
lookups that return success.