icon Top 9 categories map      RocketAware > man pages >


Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.

The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Search all pages


By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Integer, Floating point, Matrix, Statistics, Boolean, ...

Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...


RocketLink!--> Man page versions: OpenBSD FreeBSD NetBSD Others

MAIL.LOCAL(8)           OpenBSD System Manager's Manual          MAIL.LOCAL(8)

     mail.local - store mail in a mailbox

     mail.local [-L] [-l] [-f from] [-H] user ...

     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:

     -f from  Specify the sender's name.

     -l       For compatibility, request that files named username.lock be
              used for locking.  (This is the default behavior.)

     -L       Request that flock() be used for locking the mail spool rather
              than username.lock.

     -H       This mode is useful for a client mail program to attain proper
              locking.  In this mode mail.local (ignoring all other arguments)
              attains a username.lock for the calling user and retains it un-
              til stdin is closed or a signal like SIGINT, SIGTERM, or SIGHUP
              is received.  If mail.local is able to create the lock file,
              ``1'' is written to stdout, otherwise ``0'' is written and an
              error message is written to stderr.

     Individual mail messages in the mailbox are delimited by an empty line
     followed by a line beginning with the string ``From ''.  A line contain-
     ing the string ``From '', the sender's name and a time stamp is prepended
     to each delivered mail message.  A blank line is appended to each mes-
     sage.  A greater-than character (``>'') is prepended to any line in the
     message which could be mistaken for a ``From '' delimiter line.

     Significant efforts have been made to ensure that mail.local acts as se-
     curely as possible if the spool directory is mode 1777 or 755.  The de-
     fault of mode 755 is more secure, but it prevents mail clients from using
     all styles of locking.  The use of 1777 is more flexible in an NFS
     shared-spool environment, thus 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.

     By default, mailbox locking is done with username.lock files. However, if
     the -L flag is specified, the mailbox is exclusively locked with flock(2)
     while mail is appended.

     If the ``biff'' service is returned by getservbyname(3),  the biff server
     is notified of delivered mail.

     The mail.local utility exits 0 on success, and >0 if an error occurs.

     TZ      Used to set the appropriate time zone on the timestamp.

     /tmp/local.XXXXXXXXXX  temporary files
     /var/mail/user         user's mailbox directory

     A superset of mail.local (handling mailbox reading as well as mail deliv-
     ery) appeared in Version 7 AT&T UNIX as the program mail.

     Since sendmail(8) bases its idea of whether a message has been delivered
     or not on the return value from mail.local, using quotas in /var/mail can
     be problematic.  By default, sendmail(8) will ask 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.
     If you are running with disk quotas on /var/mail it is imperative that
     you unset the ``m'' mailer flag for the `local' mailer.  To do this, lo-
     cate the line beginning with ``Mlocal'' in /etc/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', `rn9')dnl
     to your ``.mc'' file (this is the source file that is used to generate

     biff(1),  mail(1),  xsend(1),  flock(2),  getservbyname(3),  comsat(8),

OpenBSD 2.3                     April 27, 1991                               2

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.

(Corrections, notes, and links courtesy of RocketAware.com)

[Detailed Topics]
FreeBSD Sources for mail.local(8)
OpenBSD sources for mail.local(8)

[Overview Topics]

Up to: Email Server and Transport Agents - Electronic mail servers including delivery, routing, and transfer agents (MTAs), protocols (SMTP, POP, IMAP, -

RocketLink!--> Man page versions: OpenBSD FreeBSD NetBSD Others

Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > mail.local.8/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments