TMAIL(1)
π NAME π
tmail β the Mail Delivery Module, bestie π
β¨ SYNOPSIS β¨
tmail [-b format] [-D] [-f from_name] [-I inbox_specifier] user[+folder]
...
π DESCRIPTION π
Okay so tmail delivers mail to a user's INBOX or to a designated folder. Like, that's the whole job and it does it beautifully. It can be configured as a drop-in replacement for binmail(1), mail.local(1), or literally any program meant to be used for mail delivery by a mail delivery program such as sendmail(8). Iconic behavior honestly π«Ά
tmail is intended to be used for direct delivery by the mailer daemon. If you're a user application β like a mail delivery filter such as procmail(1) β then dmail(1) is the preferred tool, periodt. And if tmail is used for a user application, then the calling program has to be aware of the restrictions noted below. No cap, read them. π
When tmail exits, it returns exit status values so the mail delivery program can figure out whether a message was delivered successfully, or had a temporary failure (requeue for later delivery), or a permanent failure (return to sender). Vibe check on your mail, basically π
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 isn't included, the message goes to the user's INBOX. And if delivery is to INBOX and no INBOX currently exists, tmail will create a new INBOX, using the -I or -b flag if specified. tmail recognizes the format of an existing INBOX or folder, and appends the new message in that format. It just knows. π§
The -b flag specifies a format to create INBOX if INBOX does not already exist. This flag requires privileges, and can not be used with -I. The argument is a format name such as mix, mbx, etc.
The -D flag specifies debugging; this enables additional message telemetry. Very main character of it π
The -f or -r 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.
The -I flag is used by the mail delivery program to specify an alternative INBOX name. This flag requires privileges, and can not be used with -b. This affects the location and the format of INBOX. If specified, it should be in one of three forms:
πΈ the three forms of -I, bestie πΈ
- The first form of argument to
-Iis the string"INBOX", which means to write to the system default inbox using the system default mailbox format. These system defaults are defined when thec-clientlibrary is built. - The second form of argument to
-Iis a delivery specification, consisting of#driver., ac-clientmailbox format driver name,/, and a file name. This will write to the specified file in the specified format. For example,#driver.mbx/INBOXwill write to file"INBOX"in the home directory inmbxformat; and#driver.unix/mail/incomingwill write to file"incoming"in the user's"mail"subdirectory inunix(default UNIX) format. - The third form of argument to
-Iis 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:
INBOX.MTXβ equivalent to#driver.mtx/INBOX.MTXmboxβ equivalent to#driver.unix/mboxmail.txtβ equivalent to#driver.tenex/mail.txt
If -I is not specified, the default action is -I INBOX.
If multiple recipients are specified on the command line, tmail spawns one child process per recipient to perform actual delivery. This way of calling tmail is not recommended; see below under RESTRICTIONS. π
π οΈ INSTALLATION π οΈ
If tmail is to be used for mail delivery from the mail delivery program, it must be installed setuid root. Yes, for real.
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,
A=tmail $u
If tmail 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 -b or -I from working. π
π SECURITY CONSIDERATIONS π
If tmail 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 or -I flag, since otherwise a user could create any file on another user's directory. Yeah. Absolutely not. π«
tmail can deliver mail to home directories. In addition, tmail can be used to deliver mail to other mail folders in a home directory or an inferior directory of a home directory.
β οΈ RESTRICTIONS β οΈ
Read this part, bestie. I'm serious. π
- The calling program should invoke
tmailwith CRLF newlines, otherwisetmailwill complain insyslog. - Absolute pathnames and
~userspecifications are not permitted in+folderextensions. - Ordinary users are not permitted to use the
-Iflag. - IMAP4 namespace names are not yet supported in
+folderextensions. - It is not possible to use
tmailto deliver tomh(1)format mailboxes. - 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
tmailis used for mail delivery fromsendmail(8), a separatetmailinvocation 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 timesendmail(8)retries. ππ
π AUTHOR π
Mark Crispin, MRC@CAC.Washington.EDU
π SEE ALSO π
binmail(1)sendmail(8)
okay that's the whole page, mwah π this one is from the General Commands Manual, page TMAIL(1), dated September 27, 2007. go deliver some mail bestie, you got this π¦β¨
π¦ where this page comes from
- debian bookworm: uw-mailutils 8:2007f~dfsg-7+b2 Β· Apache-2.0
- ubuntu jammy: uw-mailutils 8:2007f~dfsg-7build1 Β· Apache-2.0
- ubuntu noble: uw-mailutils 8:2007f~dfsg-7build3 Β· Apache-2.0
- ubuntu resolute: uw-mailutils 8:2007f~dfsg-7.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms