Linux Server How ToHow To Setup, Configure, Manage and Secure a Linux Server |
|
Home Which Linux Distribution? Linux Server Hardware Linux Server Security Linux Web Server - Apache Linux DNS Server - Bind Linux DHCP Server - DHCPD Linux Mail Server - Sendmail Introduction to Sendmail Install Sendmail With Apt Compile Sendmail MX Records Configure Sendmail Users, Relays and Domains Filtering Spam LDP How To's About This Site |
Linux Server How To - Configure SendmailConfigure SendmailThere are two aspects to sendmail which we can configure. We can configure Sendmails behaviour such as queues, timeout intervals and additional features such as milters through sendmail.cf and submit.cf. We can also configure users, domains and relaying through the local configuration files such as aliases, local-host-names and relay-domains. This article shall endevour to familiarize the reader with changing the behaviour of Sendmail to suit their requirements. Local configuration is dealt with in our related article on Sendmail Users, Relays and Domains.The Generic Linux sendmail.mcThe majority of Sendmail and its queue runners behaviour is determined by the sendmail.cf and submit.cf files in the /etc/mail directory. Although these files can be directly edited this is not considered best practice and the preferred method is to generate new sendmail.cf or submit.cf file using the m4 macro processor. In our tutorial on how to install Sendmail from Source we used the Build script to construct a sendmail.cf with sendmail.mc as its input file. Sendmail.mc contained a generic and very simple configuration that could be added to easily to create a more specific configuration or provide additional features. This sendmail.mc is as below.
Build Your Sendmail.cfIf you compiled Sendmail from source the best place in your file system to build your sendmail.cf is in the /path/to/sendmail/source/cf/cf directory, which will contain sample sendmail.mc files for a wide cross section of Unix-like operating systems and the Build scripts, makefile etc for creating your sendmail.cf. Once you have edited or created your sendmail.mc you must build your sendmail.cf by typing-
If you installed Sendmail using apt-get such as we did with our Ubuntu Linux server creating a new sendmail.cf is best performed in the /etc/mail directory, though this may not be necessary depending on your specific distribution. Some distributions may require you to locate a cf/cf/ directory somewhere in /usr/src. With most apt-get Sendmail installations using m4 by itself will suffice -
Our Ubuntu Linux server has an excellent utility called sendmailconfig which rebuilds sendmail.conf, sendmail.cf and submit.cf for us. Our revised sendmail.mc must be in the /etc/mail directory for this utility to work properly.
Regardless of the method you need to use to rebuild your sendmail.cf or submit.cf Sendmail must be restarted for the new configuration to take effect. Additional FeaturesMany special additional features can be added or tweaked through your sendmail.cf configuration file that can add extended functionality or alter the behaviour of the Sendmail daemon on your Linux server. These features are documented on the Sendmail website on the cf/README Features page. The example sendmail.mc we have documented on this page will be more than adequate for 99% of Sendmail users however if you want to explore Sendmails capabilities more or need to fine tune a particular aspect of your mail server then the cf/README provides an up to date list of special features, written by Sendmails creator himself, Eric Allman. |
| © 2009 www.linuxserverhowto.com |