The Default Sendmail Installation
The Sendmail executable is /usr/sbin/sendmail
.
Sendmail's lengthy and detailed configuration file is /etc/mail/sendmail.cf
. Avoid editing the sendmail.cf
file directly. To make configuration changes to Sendmail, edit the /etc/mail/sendmail.mc
file, back up the original /etc/mail/sendmail.cf
, and use the following alternatives to generate a new configuration file:
- Use the included makefile in
/etc/mail
(make all -C /etc/mail
) to create a new/etc/mail/sendmail.cf
configuration file. All other generated files in/etc/mail
(db files) will be regenerated if needed. The old makemap commands are still usable. The make command will automatically be used byservice sendmail start | restart | reload
if themake
package is installed.
- Alternatively you may use the included
m4
macro processor to create a new/etc/mail/sendmail.cf
.
Various Sendmail configuration files are installed in the /etc/mail/
directory including:
access
- Specifies which systems can use Sendmail for outbound email.
domaintable
- Specifies domain name mapping.local-host-names
- Specifies aliases for the host.mailertable
- Specifies instructions that override routing for particular domains.virtusertable
- Specifies a domain-specific form of aliasing, allowing multiple virtual domains to be hosted on one machine.
Several of the configuration files in /etc/mail/
, such as access
, domaintable
, mailertable
and virtusertable
, must actually store their information in database files before Sendmail can use any configuration changes. To include any changes made to these configurations in their database files, run the following command:
makemap hash /etc/mail/
<name>
< /etc/mail/<name>
where <name>
is replaced with the name of the configuration file to convert.
For example, to have all emails addressed to the example.com
domain delivered to bob@other-example.com
, add the following line to the virtusertable
file:
@example.com bob@other-example.com
To finalize the change, the virtusertable.db
file must be updated using the following command as root:
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
This creates an updated virtusertable.db
file containing the new configuration.