Common Sendmail Configuration Changes
When altering the Sendmail configuration file, it is best not to edit an existing file, but to generate an entirely new /etc/mail/sendmail.cf
file.
Before changing the sendmail.cf
file, it is a good idea to create a backup copy.
To add the desired functionality to Sendmail, edit the /etc/mail/sendmail.mc
file as the root user. When finished, use the m4
macro processor to generate a new sendmail.cf
by executing the following command:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
By default, the m4
macro processor is installed with Sendmail but is part of the m4
package.
After creating a new /etc/mail/sendmail.cf
file, restart Sendmail for the changes to take effect. The easiest way to do this is to type the following command:
service sendmail restart
The default sendmail.cf
file does not allow Sendmail to accept network connections from any host other than the local computer. To configure Sendmail as a server for other clients, edit the /etc/mail/sendmail.mc
file, and either change the address specified in the Addr=
option of the DAEMON_OPTIONS
directive from 127.0.0.1
to the IP address of an active network device or comment out the DAEMON_OPTIONS
directive all together by placing dnl
at the beginning of the line. When finished, regenerate /etc/mail/sendmail.cf
by executing the following command:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
The default configuration which ships with Community Enterprise Linux works for most SMTP-only sites. However, it does not work for UUCP (UNIX to UNIX Copy) sites. If using UUCP mail transfers, the /etc/mail/sendmail.mc
file must be reconfigured and a new /etc/mail/sendmail.cf
must be generated.
Consult the /usr/share/sendmail-cf/README
file before editing any files in the directories under the /usr/share/sendmail-cf
directory, as they can affect the future configuration of /etc/mail/sendmail.cf
files.