Chapter 11. Customized programs
The mail spool is
and the interface to send a mail message is
(as per the FHS). On older systems, the mail spool may be physically located
, but all access to the mail spool should be via the
The mail spool is part of the base system and not part of the MTA package.
All Debian MUAs, MTAs, MDAs and other mailbox accessing programs (such as IMAP dae
mons) must lock the mailbox in an NFS safe way. This means that
locking must be
combined with dot locking. To avoid deadlocks, a program should use
first and dot
locking after this, or alternatively implement the two locking methods in a non blocking way
Using the functions
provided by the
is the recommended way to realize this.
Mailboxes are generally mode 660
unless the system administrator has chosen
otherwise. A MUA may remove a mailbox (unless it has nonstandard permissions) in which
case the MTA or another MUA must recreate it if needed. Mailboxes must be writable by group
The mail spool is 2775
, and MUAs should be setgid mail to do the locking men
tioned above (and must obviously avoid accessing other users' mailboxes using this privilege).
is the source file for the system mail aliases (e.g., postmaster, usenet, etc.), it is
the one which the sysadmin and
scripts may edit. After
the program or human editing it must call
. All MTA packages must come with
program, even if it does nothing, but older MTA packages did not do this so
programs should not fail if
cannot be found. Note that because of this, all MTA
packages must have
mail transport agent
control file fields.
The convention of writing
in the mailbox itself is not supported. Use
program used by UUCP for incoming mail should be
, for receiving batch SMTP over UUCP, should be
if it is sup
If your package needs to know what hostname to use on (for example) outgoing news and mail
messages which are generated locally, you should use the file
. It will contain
the portion after the username and
(at) sign for email addresses of users on the machine
(followed by a newline).
Such package should check for the existence of this file when it is being configured. If it exists, it
should be used without comment, although an MTA's configuration script may wish to prompt
the user even if it finds that this file exists. If the file does not exist, the package should prompt
the user for the value (preferably using
) and store it in
as well as
using it in the package's configuration. The prompt should make it clear that the name will
not just be used by that package. For example, in this situation the
package could say
If it is not possible to establish both locks, the system shouldn't wait for the second lock to be established, but
remove the first lock, wait a (random) time, and start over locking again.
You will need to depend on
to use these functions.