A mail transport agent that combines advanced capabilities with easy configuration.
The mailers.linux LOCAL_MAILER

Most operating systems provide a program to handle local delivery of mail. Typical programs for the major variants of Unix have defaults in the sendmail+IDA binary. In Linux, it is necessary to explicitly define the appropriate local mailer since a local delivery program is not necessarily present in the distribution you've installed. This is done by specifying the LOCAL_MAILER_DEF in the sendmail.m4 file.

The following example is how you would set the local mail delivery program to be the commonly available (and ported to Linux) program 'deliver' to provide this function.


There is a also built-in default for 'deliver' in the sendmail+IDA file that gets included into the file. To specify it, you would not need a mailers.linux file and would instead define the following in your sendmail.m4 file:

dnl -- (in sendmail.m4) --
# mailer for local delivery

Unfortunately, assumes deliver is installed in /bin, which is not the case with Slackware1.1.1 (which installs it in /usr/bin). In that case you'd need to either fake it with a link or rebuild deliver from sources so that it resides in /bin.

Sendmail+IDA dbm Tables

Sendmail+IDA provides a number of tables to provide the ability to override the default behavior of sendmail (specified in the sendmail.m4 file) and define special behavior for unique situations, remote systems, and networks. These tables are post-processed with dbm using the provided Makefile.

Most sites will need few, if any, of these tables. If your site does not require these tables, the easiest thing is probably to make them zero length files (with 'touch') and use the default Makefile in $LIBDIR rather than editing the provided Makefile.

A generic site that is on Internet and speaks Domain Name Service (or one that is UUCP-only and forwards all mail via UUCP through a smart RELAY_HOST) probably does not need any specific table entries at all.



The mailertable defines special treatment for specific hosts or domains based on the remote host or network name.

It is frequently used on Internet sites to use a particular protocol (uucp/smtp) to forward to an intermediate mail relay host or gateway in order to reach a remote network.

UUCP sites will generally not need to use this file.

Order is important. Entries match based on a top-down interpretation of the rulesets so it is generally wise to place the most explicit rules at the top of the file and the more generic rules below.


Suppose you want to forward all mail for a mythical JoeUniversity via UUCP to a relay host 'sysA'. To do so, you would have a mailertable entry that looked like the following:

# (in mailertable)
# forward all mail for the domain via uucp to sysA


Suppose you want all mail to the larger .edu domain to go to a different relayhost 'sysB' for address resolution and delivery. The expanded mailertable entries would look quite similar.

# (in mailertable)
# forward all mail for the domain via uucp to sysA

# forward all mail for the domain .edu via uucp to sysB
UUCP-A,sysB .edu

As mentioned above, order is important. Reversing the order of the two rules shown above will result in all mail to going through the more generic 'sysB' path through the explicit 'sysA' path that is really desired.

# (in mailertable)
# forward all mail for the domain .edu via uucp to sysB

UUCP-A,sysB .edu

# no mail for joe-u will go through sysA because the above
# rule was matched and used by sendmail


Mailertable Format

In the mailertable examples above, the UUCP-A mailer means use UUCP delivery with domainized headers. The comma between the mailer and remote system tells sendmail to merely forward the message to 'sysA' for address resolution and delivery. Mailertable entries are of the format:


There are a number or possible mailers. The differences are generally in how they treat addresses.

Typical mailers are TCP-A (tcp/ip with Internet-style addresses), TCP-U (tcp/ip with UUCP-style addresses), UUCP-A (uucp with Internet-style addresses).

The choice of the character separating the mailer from the host portion on the left-hand-side of a mailertable line defines how the address is modified by the mailertable.

! - (exclamation point) means strip off the recipient hostname before forwarding to the mailer

, - (comma) means do not change the address in any way. Merely forward via the specified mailer to the specified relay host

: - (colon) means remove the recipient hostname only if there are intermediate hosts between you and the destination


Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl

Sign up and watch now

Sponsored by Skybot