Aqua Phoenix
     >>  References >>  Operating Systems  
 

Navigator
   
 
       
   

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: /usr/lib/mail/m4/config.mc:

divert(-1)
#
# Custom sendmail configuration for icarus.seas.columbia.edu
#
#
divert(0)
VERSIONID($Id: 31-Jan-04 Modified sendmail 8.12.10 Sun Solaris 9 $)
OSTYPE(solaris8)dnl
DOMAIN(generic)dnl
MASQUERADE_AS(`someother.domain.com')
FEATURE(local_lmtp)dnl
FEATURE(redirect)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(accept_unqualified_senders)dnl
FEATURE(accept_unresolvable_domains)dnl
FEATURE(relay_entire_domain)dnl
FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access.db')
MAILER(local)
MAILER(smtp)
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

1.6.1 MASQUERADE

The line 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:

Djmail.somedomain.com
DSmail.somedomain.com
where 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:

www.somedomain.com
ftp.somedomain.com

1.6.2 SPAM - Rejection by domain

The line 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.