Installation Instructions for sial.org Sendmail Configurations $Id: INSTALL,v 1.2 2006/06/01 04:26:14 jmates Exp $ Peruse these notes, and ensure all steps are followed. There are a number of things that need to be changed and commands to run to create a working sendmail configuration, and many things that can go wrong. 1. Prerequisites. Working and configured DNS. DNS setup and configuration problems are out of the scope of this document, but can easily slow sendmail or prevent it from working properly. The m4 and make commands must be installed on the system in question. Not all systems install these tools by default; they may be available as extra packages or in a developer tools bundle. $ which make $ which m4 Ensure the sendmail cf files are available. These may be found under the sendmail source tarball in the cf directory, or in a random directory on your system. Look for a m4/cf.m4 file. $ find /usr -name cf.m4 -print Some systems include the cf directory by default (FreeBSD, Mac OS X); others make it available as a non-default package that will need to be installed (sendmail-cf RPM on RedHat Linux). This directory should also contain an informative README file, hereafter referred to as the cf/README file. 2. Edit the Makefile. The CFDIR variable should be changed to be the directory containing the m4/cf.m4 file. The location of the CFDIR varies by system, and may need to be installed from a non-default package. Some common locations are listed below. Darwin /usr/share/sendmail/conf also Mac OS X Debian /usr/share/sendmail.cf Unconfirmed FreeBSD /usr/share/sendmail/cf OpenBSD /usr/share/sendmail RedHat /usr/share/sendmail-cf /usr/lib/sendmail-cf RedHat 6 and prior Solaris /usr/lib/mail SuSE /usr/share/sendmail Unconfirmed Other variables may need to be changed in the Makefile, such as the paths to various programs or the default HASHTYPE setting. 3. Change the default domain name. This configuration uses an example domain for all domain-related settings. Change this to your domain name, either manually in the various configuration files or with the following command. $ find . -type f | xargs perl -i -pe 's/example.org/yourdomain.com/g' Also, the DNS for the system must be setup properly, as various files use the $m macro to lookup the subdomain name. If static hostname configuration is desired, replace the $m with a domain in all the files it is used in (sendmail.mc and submit.mc). $ find . -type f -print | xargs perl -i -ple 's/\$m/yourdomain.com/g' 4. Edit the sendmail.mc and submit.mc files. These files alter how sendmail runs as a SMTP daemon (sendmail.mc) or accepts command line mail (submit.mc). Consult the cf/README file for documentation on these files and the configuration statements that alter how sendmail behaves, and the syntax used by m4. Note that "dnl" comments out statements. The proper OSTYPE value will need to be set in the sendmail.mc file. Some common defaults are listed below; see also the cf/ostype directory for more supported system types. darwin freebsd4 linux openbsd solaris2 Other things to change in sendmail.mc may be the MASQUERADE settings, LOCAL_RELAY and other mail routing options, TLS and SMTP AUTH configuration, and more. The sendmail daemon is highly customizable; some time must be spent to ensure the proper defaults are set for the system in question. The submit.mc file is less flexible: MASQUERADE settings may need to be adjusted, TLS or SMTP AUTH configured, and the target Mail Transport Agent (MTA) changed for the msp FEATURE. The msp host will either be [127.0.0.1] to send mail to the local SMTP daemon, or a remote server to send mail to if no local daemon is available. 5. Alter other supporting files as required. Depending on the configuration and system in question, other supporting files will need to be changed or populated, such as the virtusertable, mailertable, and aliases files. For TLS support, certificates will need to be generated; look under the certs directory for documentation, scripts, and Makefiles. 6. Install into /etc/mail. Backup any existing configuration under /etc/mail, and move the *.mc files, Makefile, and the certs directory into /etc/mail, along with any other customized files needed, such as mailertable and similar. Ensure that proper permissions and ownerships are set on the configuration files. The superuser (root) typically owns sendmail configuration files, and modes will depend on the file in question (e.g. more restricted for TLS private keys). 7. Build configuration files and mapped databases. To convert the *.mc files into sendmail.cf and submit.cf, and to build any hashed versions of files such as virtusertable or mailertable, run the following command in the /etc/mail directory. # make all If aliases are being used, also run the 'newaliases' command. Later, 'make config' will need to be run after changing the submit.mc or sendmail.mc files, and 'make reload' to make a new sendmail.cf or flat file changes to take effect (such as those done to local-host-names). After changing hashed files such as access, mailertable, or virtusertable, simply run the 'make maps' command to bring the database files up-to-date. 8. Test sendmail. If the system will run the SMTP daemon (sendmail.cf) or mail submission queue daemon (submit.cf), launch those via the methods provided by the system in question. Note that client mail systems may not need to run any daemons at all: a client may not need to accept SMTP mail from the local system, and the mail submission daemon can either be run as a daemon (Mac OS X and RedHat Linux do this), run periodically from cron (OpenBSD does this by default), or run manually from the command line as needed. To send a test message from the system in question, try something like the following as both the superuser and a regular user account. Ideally multiple tests to unqualified user accounts, local domain accounts, and off-site accounts should be done to ensure everything is working properly. $ echo test | mail -v user@example.org To check a mail server from a different system, use a SMTP client, or simply attempt to telnet to the server and test the SMTP protocol manually. $ telnet mail.example.org 25 Problems will either be written to the console or sent to syslog. Logfile locations vary by system. Assuming a standard Unix syslogd daemon is installed and running properly, the following should show where the mail logs are located, if any. $ grep mail /etc/syslog.conf Search the web or comp.mail.sendmail archives on Google Groups for any error messages, if any. See also the #sendmail channel on the freenode.net IRC network. Additional documentation may be available at the following location. http://sial.org/sendmail/