1.6 Sendmail Configuration
Sendmail can be configured with many options. Presented here are the specific options of masquerading and spam rejection.
Edit, or create the file, if it does not exist:
# Custom sendmail configuration for icarus.seas.columbia.edu
VERSIONID($Id: 31-Jan-04 Modified sendmail 8.12.10 Sun Solaris 9 $)
FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access.db')
Change directory to
/usr/lib/mail/m4, and type the following command to create the sendmail configuration file:
m4 /usr/lib/mail/m4/cf.m4 config.mc > config.cf
Copy the resulting configuration to /etc/sendmail.cf:
cp config.cf /etc/mail/sendmail.cf
MASQUERADE is responsible for masquerading a different host name. In order to use this feature, the following changes must be made to the file /etc/mail/sendmail.cf after this procedure for creating a sendmail configuration file is complete. Edit /etc/mail/sendmail.cf and make sure the following lines are included:
mail.somedomain.com is the hostname that will be receiving mail forwarded by the masquerading domain.
To allow a host to receive mail from other hosts, e.g. a dedicated mail server receiving mail from other web servers on the network, edit
/etc/mail/local-host-names, and add each hostname for which mail should be received. For example, the file /etc/mail/local-host-names for mail.somedomain.com would look like:
1.6.2 SPAM - Rejection by domain
FEATURE(access_db...) is used to establish the database of rejected sender domains. A database (file) of rejected domains must be established in order to use this feature. The following procedure is used to create such a database:
Change directory to
/etc/mail and create an access file, named access, and add one line for every domain from which you would like to reject incoming mail:
adelphia.net 550 5.7.1 Spammers rejected
To establish a sendmail-readable database, convert the access file to access.db:
makemap hash access.db < access
This command must be entered whenever the source database file access changes, e.g. adding, modifying, removing domains from access.