MAIL.LOCAL(8)
πΈ NAME πΈ
okay so bestie, we're looking at MAIL.LOCAL(8), aka the mail.local page from the System Manager's Manual β and it's literally here to store mail in a mailbox. periodt π
β¨ SYNOPSIS β¨
mail.local [-Ll] [-f from] user ...
π DESCRIPTION π
mail.local reads the standard input up to an end-of-file and appends it to each user's mail file. The user must be a valid user name.
The options are as follows, bestie:
-ffrom β Specify the sender's name. π-Lβ Don't create ausername.lockfile while locking the spool. π«π-lβ For compatibility, request that files namedusername.lockbe used for locking. (This is the default behavior.) β
Individual mail messages in the mailbox are delimited by an empty line followed by a line beginning with the string From . A line containing the string From , the sender's name and a timestamp is prepended to each delivered mail message. A blank line is appended to each message. A greater-than character (>) is prepended to any line in the message which could be mistaken for a From delimiter line. π
bestie, significant efforts have been made to ensure that mail.local acts as securely as possible if the spool directory is mode 1777 or 755. The default of mode 755 is more secure, but it prevents mail clients from using username.lock style locking. The use of 1777 is more flexible in an NFS shared-spool environment, so many sites use it. However, it does carry some risks, such as attackers filling the spool disk. Some of these problems may be alleviated by making the spool a separate filesystem, and placing quotas on it. The use of any mode other than 1777 and 755 for the spool directory is recommended against but may work properly. β οΈ
The mailbox is always locked using flock(2) while mail is appended. Unless the -L flag is specified, a username.lock file is also used. π
If the biff(1) service is returned by getservbyname(3), the biff server is notified of delivered mail. π¬
π ENVIRONMENT π
TZβ Used to set the appropriate time zone on the timestamp. π°οΈ
π FILES π
/tmp/local.XXXXXXXXXXβ temporary files ποΈ/var/mail/userβ user's mailbox directory π₯
π₯ EXIT STATUS π₯
The mail.local utility exits 0 on success, and >0 if an error occurs. β
π
π¦ SEE ALSO π¦
biff(1), mail(1), flock(2), getservbyname(3), comsat(8), smtpd(8) π
π HISTORY π
A superset of mail.local (handling mailbox reading as well as mail delivery) appeared in Version 7 AT&T UNIX as the program mail(1). πβ¨
π BUGS π
okay bestie, here's the messy part π using quotas in /var/mail can be problematic if using sendmail(8) as an MTA, since it asks mail.local to deliver a message to multiple recipients if possible. This causes problems in a quota environment since a message may be delivered to some users but not others due to disk quotas. Even though the message was delivered to some of the recipients, mail.local will exit with an exit code > 0, causing sendmail(8) to attempt redelivery later. That means that some users will keep getting the same message every time sendmail(8) runs its queue. This problem does not exist for smtpd(8) users. periodt, but also yikes π
If you are running sendmail(8) and have disk quotas on /var/mail it is imperative that you unset the βmβ mailer flag for the βlocalβ mailer. To do this, locate the line beginning with βMlocalβ in /etc/mail/sendmail.cf and remove the βmβ from the flags section, denoted by βF=β. Alternately, you can override the default mailer flags by adding the line:
define(`LOCAL_MAILER_FLAGS', `rn9S')dnl
to your β.mcβ file (this is the source file that is used to generate /etc/mail/sendmail.cf). π οΈπ
and that's the whole page, bestie β Debian, September 16, 2014, signing off π«Άβ¨
π¦ where this page comes from
- alpine 3.24: opensmtpd-doc 7.8.0_p0-r0 Β· ISC
- arch rolling: opensmtpd 7.9.0p0-1 Β· custom
- debian trixie: opensmtpd 7.6.0p1-1 Β· ISC
- epel 10: opensmtpd 7.9.0p0-1.el10_3 Β· ISC
- epel 9: opensmtpd 7.6.0p1-1.el9 Β· ISC
- fedora 43: opensmtpd 7.7.0p0-3.fc43 Β· ISC
- fedora 43: opensmtpd 7.8.0p0-1.fc43 Β· ISC
- fedora 44: opensmtpd 7.8.0p0-2.fc44 Β· ISC
- fedora 44: opensmtpd 7.9.0p0-1.fc44 Β· ISC
- nixos 26.05: opensmtpd 7.8.0p0
- nixpkgs unstable: opensmtpd 7.8.0p0
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- ubuntu noble: opensmtpd 7.4.0p1-1build4 Β· ISC
- ubuntu questing: opensmtpd 7.7.0p0-1
- ubuntu resolute: opensmtpd 7.8.0p0-2 Β· ISC
- ubuntu stonking: opensmtpd 7.8.0p0-2build1 Β· ISC
- Copyright (c) 1990 The Regents of the University of California
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms