tmail - Mail Delivery Module
tmail [-b format] [-D] [-f from_name] [-I inbox_specifier]
delivers mail to a user's INBOX or a designated folder.
may be configured as a drop-in replacement for binmail
(1) or any program intended for use for mail delivery by a
mail delivery program such as sendmail
is intended to be used for direct delivery by the mailer daemon;
(1) is the preferred tool for user applications, e.g. a mail
delivery filter such as procmail
is used for
a user application, then the calling program must be aware of the restrictions
exits, it returns exit status values to enable the mail
delivery program to determine whether a message was delivered successfully or
had a temporary (requeue for later delivery) or permanent (return to sender)
If the +folder
extension is included in the user argument, tmail
will attempt to deliver to the designated folder. If the folder does not exist
or the extension is not included, the message is delivered to the user's
INBOX. If delivery is to INBOX and no INBOX currently exists, tmail
will create a new INBOX, using the -I
flag if specified.
recognizes the format of an existing INBOX or folder, and appends
the new message in that format.
flag specifies a format to create INBOX if INBOX does not already
exist. This flag requires privileges, and can not be used with -I
argument is a format name such as mix, mbx, etc.
flag specifies debugging; this enables additional message
flag is used by the mail delivery program to specify
a Return-Path. The header
Return-Path: < from_name
is prepended to the message before delivery.
flag is used by the mail delivery program to specify an
alternative INBOX name. This flag requires privileges, and can not be used
. This affects the location and format of INBOX. If specified,
it should be in one of three forms:
The first form of argument to -I
is the string "INBOX", which
means to write to the system default inbox using the system default mailbox
format. These system defaults are defined when the c-client library is built.
The second form of argument to -I
is a delivery specification, consisting
of "#driver.", a c-client mailbox format driver name, "/",
and a file name. This will write to the specified file in the specified
format. For example, #driver.mbx/INBOX will write to file "INBOX" in
the home directory in mbx format; and #driver.unix/mail/incoming will write to
file "incoming" in the user's "mail" subdirectory in unix
(default UNIX) format.
The third form of argument to -I
is any other name. Normally, this will
write to the specified file on the user's home directory in the specified
format. However, certain names are special. These are:
value equivalant to
is not specified, the default action is -I INBOX
If multiple recipients are specified on the command line, tmail
one child process per recipient to perform actual delivery. This way of
is not recommended; see below under RESTRICTIONS
is to be used for mail delivery from the mail delivery program,
be installed setuid root.
If sendmail is the mail delivery program, tmail
is invoked from
sendmail.cf. Look for the "Mlocal" line, and substitute the path
name for the tmail
binary in place of /bin/mail, /usr/lib/mail.local,
etc. You should also add the flag to invoke tmail
with CRLF style
newlines; this is usually done with E=\r\n in the Mlocal line.
Here is an example of an Mlocal line in sendmail version 8:
Mlocal, P=/usr/local/etc/tmail, F=lsDFMAw5:/|@qPrn+,
S=10/30, R=20/40, E=\r\n, T=DNS/RFC822/X-Unix,
is to be called with the -I
flag, it must be invoked with
both real and effective UID root. Many sendmail configurations invoke the
local mailer as the sending user when that user is local, which will prevent
is invoked by an ordinary user, the Received: header line will
indicate the name or UID of the user that invoked it.
Ordinary users are not permitted to use the -b
otherwise a user could create any file on another user's directory.
can deliver mail to home directories. In addition, tmail
be used to deliver mail to other mail folders in a home directory or an
inferior directory of a home directory.
The calling program should invoke tmail
with CRLF newlines, otherwise
will complain in syslog.
Absolute pathnames and ~user
specifications are not permitted in
Ordinary users are not permitted to use the -I
IMAP4 namespace names are not yet supported in +folder
It is not possible to use tmail
to deliver to mh
If delivery to multiple users is specified and delivery to any single user
fails, the entire delivery will be reported as having failed, even though
delivery to other users may have succeeded. If tmail
is used for mail
delivery from sendmail
(8), a separate tmail invocation should be done
for each user. Otherwise a delivery failure for a single user in a message
going to multiple users will cause multiple deliveries to all the other users
every time sendmail
Mark Crispin, MRC@CAC.Washington.EDU