M: define mailer
Programs and interfaces to mailers are defined in the M
line, whose format is:
Mname, {field=value}*
name is the name of the mailer (used internally only)
and the field=name pairs define attributes
of the mailer. Fields are:
``Path''-
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''-
maximum message length to this mailer
``maxmessages''-
maximum message deliveries per connection
``Linelimit''-
maximum line length in the message body
``Directory''-
working directory for the mailer
``Userid''-
default user and group ID to run as
``Nice''-
nice(2)
increment for the mailer
``Charset''-
default character set for 8-bit characters
``Type''-
type information used for DSN diagnostics
``Wait''-
maximum time to wait for the mailer
``/''-
root directory for the mailer
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.
a-
Run Extended SMTP (ESMTP) protocol (defined
in RFCs
1869, 1652, and 1870).
This flag defaults on
if the SMTP greeting message includes the word
``ESMTP''.
A-
Look up the user part of the address in the alias database.
Normally this is only set for local mailers.
b-
Force a blank line on the end of a message. This is intended to
work around some versions of /bin/mail that require a
blank line, but do not provide it themselves. It would not
normally be used on network mail.
c-
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.
C[1]-
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 work reliably.
d-
Do not include angle brackets around route-address syntax
addresses. This is useful on mailers that are going to pass
addresses to a shell that might interpret angle brackets as
I/O redirection.
However, it does not protect against other shell metacharacters.
Therefore, passing addresses to a shell should not be considered secure.
D[2]-
This mailer wants a
Date:
header line.
e-
This mailer is expensive to connect to, so try to avoid
connecting normally; any necessary connection will occur
during a queue run.
See also option
HoldExpensive.
E-
Escape lines beginning with
From
in the message
with a ``>'' sign.
f-
The mailer wants a -ffrom flag, but only
if this is a network forward operation (for example, the
mailer will give an error if the executing user does not have
special permissions).
F[2]-
This mailer wants a
From:
header line.
g-
Normally, sendmail sends internally generated email
(for example, error messages) using the null return address
as required by RFC1123. However, some mailers do not
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).
h-
Upper case should be preserved in host names
(the $@ portion of the mailer triplet resolved from ruleset 0)
for this mailer.
I-
This mailer will be speaking SMTP to another
sendmail; as such it can use special protocol features.
This option is not required (for example, if this option is
omitted the transmission will still operate successfully,
although perhaps not as efficiently as possible).
j-
Do User Database rewriting on recipients as well as senders.
k-
Normally when sendmail connects to a host via
SMTP, it checks to make sure that this is not
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.
K-
Currently unimplemented. Reserved for chunking.
l-
This mailer is local (for example, final delivery will be
performed).
L-
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.
m-
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.
Removing this flag can defeat duplicate supression on a remote site
as each recipient is sent in a separate transaction.
M[2]-
This mailer wants a
Message-Id:
header line.
n-
Do not insert a UNIX-style
From:
line on the front
of the message.
o-
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
behavior 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.
p-
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 RFC1123.
P[2]-
This mailer wants a
Return-Path:
line.
q-
When an address that resolves to this mailer is verified
(SMTP VRFY command), generate 250 responses
instead of 252 responses. This will imply that the address is local.
r-
Same as f, but sends a -r flag.
R-
Open SMTP connections from a secure port.
s-
Strip quote characters (" and \) off of the address before
calling the mailer.
S-
Do not reset the user ID 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 flag is also specified, this causes the
effective user ID to be set to that user.
u-
Upper case should be preserved in user names for this mailer.
Standards require preservation of case in the local part of addresses,
except for those address for which your system accepts responsibility.
U-
This mailer wants UUCP-style
From:
lines with
remote from
host on the end.
w-
The user must have a valid account on this machine, for example,
getpwnam(3C)
must succeed. If not, the mail is bounced. This is required to get
.forward capability.
x[2]-
This mailer wants a
Full-Name:
header line.
X-
This mailer want to use the hidden dot algorithm as specified
in RFC821; 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.
0-
Do not look up MX records for hosts sent via
SMTP.
3-
Extend the list of characters converted to =XX notation
when converting to Quoted-Printable to include those that do not
map cleanly between ASCII and EBCDIC.
5-
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.
6-
Strip headers to seven bits.
7-
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-to-7 bit MIME
conversions performed.
8-
If set, it is acceptable to send eight bit data to this mailer; the
usual attempt to do 8-to-7 bit MIME conversions will be
bypassed.
9-
If set, do limited 7- to 8-bit MIME conversions. These
conversions are limited to text/plain data.
:-
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 vertical bar/pipe (|);
if they do, convert them to the prog mailer.
/-
Check addresses to see if they begin with a slash character (/);
if they do, convert them to the *file* mailer.
@-
Look up addresses in the user database.
%-
Do not attempt delivery on initial recipient of a message
or on queue runs unless the queued message is selected
using one of the -qI, -qR,
or -qS queue run modifiers or an ETRN request.
Footnotes:
[1]-
These flags apply to the mailers for the sender address rather
than the usual recipient mailers.
[2]-
These flags are not interpreted by the sendmail binary;
they are the conventionally used to correlate to the flags portion
of the H line.
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, or an enhanced error
code as described in RFC1893. 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 0, 5, or one of the check_
rulesets (see
``Ruleset hooks'').
The mailer with the special name ``discard''
causes any mail sent to it to be discarded
but otherwise treated as though it were successfully delivered.
This mailer can not be used in ruleset 0,
only in the various address checking rulesets.
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=lsoDq9, T=DNS/RFC822/X-Unix, A=sh -c $u
M*file*, P=[FILE], F=lsDFMPEouq9, T=DNS/RFC822/X-Unix, A=FILE $u
M*include*, P=/dev/null, F=su, A=INCLUDE $u
The Sender and Recipient rewriting sets may either be a simple
ruleset IDs 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.
Setting any value zero disables corresponding mailer-specific rewriting.
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. If the S
mailer flag is also specified, this user and group will be set
as the effective uid and gid for the process.
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.
NOTE:
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 RFC1894. 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 email 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.
The ``m=''
field specifies the maximum number of messages to attempt to deliver
on a single SMTP or LMTP connection.
The ``/='' field specifies a new root directory for the mailer.
The path is macro expanded and then passed to the
chroot(2)
system call. The root directory is changed before the
``Directory'' field is
consulted or the uid is changed.
The ``Wait='' field specifies the maximum time to wait for the
mailer to return after sending all data to it.
This applies to mailers that have been forked by
sendmail.
© 2000 The Santa Cruz Operation, Inc. All rights reserved.