M -- Define Mailer

Programs and interfaces to mailers are defined in this line. The format is:

M name, { field= value}*
where name is the name of the mailer (used internally only) and the field=name pairs define attributes of the mailer. Fields are:

Path The pathname of the mailer
Flags Special flags for this mailer
Sender Rewriting set(s) for sender addresses
Recipient Rewriting set(s) for recipient addresses
Argv An argument vector to pass to this mailer
Eol The end-of-line string for this mailer
Maxsize The maximum message length to this mailer
Linelimit The maximum line length in the message body
Directory The working directory for the mailer
Userid The default user and group id to run as
Nice The nice(2) increment for the mailer
Charset The default character set for 8-bit characters
Type The MTS type information (used for error messages)
Only the first character of the field name is checked.

The following flags may be set in the mailer description. Any other flags may be used freely to conditionally assign headers to messages destined for particular mailers. Flags marked with * are not interpreted by the sendmail binary; these are the conventionally used to correlate to the flags portion of the H line. Flags marked with apply to the mailers for the sender address rather than the usual recipient mailers.

Run Extended SMTP (ESMTP) protocol (defined in RFCs 1651, 1652, and 1653). This flag defaults on if the SMTP greeting message includes the word ESMTP.
Look up the user part of the address in the alias database. Normally this is only set for local mailers.
Force a blank line on the end of a message. This is intended to work around some stupid versions of /bin/mail that require a blank line, but do not provide it themselves. It would not normally be used on network mail.
Do not include comments in addresses. This should only be used if you have to work around a remote mailer that gets confused by comments. This strips addresses of the form Phrase <address> or address (Comment) down to just address.
If mail is received from a mailer with this flag set, any addresses in the header that do not have an at sign ( @) after being rewritten by ruleset three will have the @domain clause from the sender envelope address tacked on. This allows mail with headers of the form:
From: usera@hosta
To: userb@hostb, userc
to be rewritten as:
From: usera@hosta
To: userb@hostb, userc@hosta
automatically. However, it doesn't really work reliably.
This mailer wants a Date: header line.
This mailer is expensive to connect to, so try to avoid connecting normally; any necessary connection will occur during a queue run.
Escape lines beginning with From in the message with a `>' sign.
The mailer wants a -f from flag, but only if this is a network forward operation (i.e., the mailer will give an error if the executing user does not have special permissions).
This mailer wants a From: header line.
Normally, sendmail sends internally generated email (e.g., error messages) using the null return address as required by RFC 1123. However, some mailers don't accept a null return address. If necessary, you can set the g flag to prevent sendmail from obeying the standards; error messages will be sent as from the MAILER-DAEMON (actually, the value of the $n macro).
Upper case should be preserved in host names for this mailer.
This mailer will be speaking SMTP to another sendmail -- as such it can use special protocol features. This option is not required (i.e., if this option is omitted the transmission will still operate successfully, although perhaps not as efficiently as possible).
Normally when sendmail connects to a host via SMTP, it checks to make sure that this isn't accidently the same host name as might happen if sendmail is misconfigured or if a long-haul network interface is set in loopback mode. This flag disables the loopback check. It should only be used under very unusual circumstances.
Currently unimplemented. Reserved for chunking.
This mailer is local (i.e., final delivery will be performed).
Limit the line lengths as specified in RFC821. This deprecated option should be replaced by the L= mail declaration. For historic reasons, the L flag also sets the 7 flag.
This mailer can send to multiple users on the same host in one transaction. When a $u macro occurs in the argv part of the mailer definition, that field will be repeated as necessary for all qualifying users.
This mailer wants a Message-Id: header line.
Do not insert a UNIX-style From line on the front of the message.
Always run as the owner of the recipient mailbox. Normally sendmail runs as the sender for locally generated mail or as daemon (actually, the user specified in the u option) when delivering network mail. The normal behaviour is required by most local mailers, which will not allow the envelope sender address to be set unless the mailer is running as daemon. This flag is ignored if the S flag is set.
Use the route-addr style reverse-path in the SMTP MAIL FROM: command rather than just the return address; although this is required in RFC821 section 3.1, many hosts do not process reverse-paths properly. Reverse-paths are officially discouraged by RFC 1123.
This mailer wants a Return-Path: line.
Same as f, but sends a -r flag.
Strip quote characters (" and \e) off of the address before calling the mailer.
Don't reset the userid before calling the mailer. This would be used in a secure environment where sendmail ran as root. This could be used to avoid forged addresses. If the U= field is also specified, this flag causes the user id to always be set to that user and group (instead of leaving it as root).
Upper case should be preserved in user names for this mailer.
This mailer wants UUCP-style From lines with the ugly remote from <host> on the end.
The user must have a valid account on this machine, i.e., getpwnam must succeed. If not, the mail is bounced. This is required to get .forward capability.
This mailer wants a Full-Name: header line.
This mailer want to use the hidden dot algorithm as specified in RFC821; basically, any line beginning with a dot will have an extra dot prepended (to be stripped at the other end). This insures that lines in the message containing a dot will not terminate the message prematurely.
If no aliases are found for this address, pass the address through ruleset 5 for possible alternate resolution. This is intended to forward the mail to an alternate delivery spot.
Strip all output to seven bits. This is the default if the L flag is set. Note that clearing this option is not sufficient to get full eight bit data passed through sendmail. If the 7 option is set, this is essentially always set, since the eighth bit was stripped on input. Note that this option will only impact messages that didn't have 8->7 bit MIME conversions performed.
If set, it is acceptable to send eight bit data to this mailer; the usual attempt to do 8->7 bit MIME conversions will be bypassed.
Check addresses to see if they begin :include:; if they do, convert them to the *include* mailer.
Check addresses to see if they begin with a `|'; if they do, convert them to the prog mailer.
Check addresses to see if they begin with a `/'; if they do, convert them to the *file* mailer.
Look up addresses in the user database.

Configuration files prior to level 6 assume the `A', `w', `5', `:', `|', `/', and `@' options on the mailer named local.

The mailer with the special name error can be used to generate a user error. The (optional) host field is an exit status to be returned, and the user field is a message to be printed. The exit status may be numeric or one of the values USAGE, NOUSER, NOHOST, UNAVAILABLE, SOFTWARE, TEMPFAIL, PROTOCOL, or CONFIG to return the corresponding EX_ exit code. For example, the entry:

$#error $@ NOHOST $: Host unknown in this domain
on the RHS of a rule will cause the specified error to be generated and the Host unknown exit status to be returned if the LHS matches. This mailer is only functional in rulesets zero or five.

The mailer named local must be defined in every configuration file. This is used to deliver local mail, and is treated specially in several ways. Additionally, three other mailers named prog, *file*, and *include* may be defined to tune the delivery of messages to programs, files, and :include: lists respectively. They default to:

Mprog, P=/bin/sh, F=lsD, A=sh -c $u
M*file*, P=/dev/null, F=lsDFMPEu, A=FILE
M*include*, P=/dev/null, F=su, A=INCLUDE

The Sender and Recipient rewriting sets may either be a simple ruleset id or may be two ids separated by a slash; if so, the first rewriting set is applied to envelope addresses and the second is applied to headers.

The Directory is actually a colon-separated path of directories to try. For example, the definition D=$z:/ first tries to execute in the recipient's home directory; if that is not available, it tries to execute in the root of the filesystem. This is intended to be used only on the prog mailer, since some shells (such as csh) refuse to execute if they cannot read the home directory. Since the queue directory is not normally readable by unprivileged users csh scripts as recipients can fail.

The Userid specifies the default user and group id to run as, overriding the DefaultUser option (q.v.). If the S mailer flag is also specified, this is the user and group to run as in all circumstances. This may be given as user:group to set both the user and group id; either may be an integer or a symbolic name to be looked up in the passwd and group files respectively. If only a symbolic user name is specified, the group id in the passwd file for that user is used as the group id.

The Charset field is used when converting a message to MIME; this is the character set used in the Content-Type: header. If this is not set, the DefaultCharset option is used, and if that is not set, the value unknown-8bit is used. WARNING: this field applies to the sender's mailer, not the recipient's mailer. For example, if the envelope sender address lists an address on the local network and the recipient is on an external network, the character set will be set from the Charset= field for the local network mailer, not that of the external network mailer.

The Type= field sets the type information used in MIME error messages as defined by RFC XXX (not yet published). It is actually three values separated by slashes: the MTA-type (that is, the description of how hosts are named), the address type (the description of e-mail addresses), and the diagnostic type (the description of error diagnostic codes). Each of these must be a registered value or begin with X-. The default is dns/rfc822/smtp.

[Contents] [Previous] [Next]

Questions or problems regarding this web site should be directed to Steve Gielda.
Copyright 1999 www.cotse.com.  All rights reserved.
Last modified: Friday April 02, 1999.