Chapter 11. Customized programs
92
The mail spool is
/var/mail
and the interface to send a mail message is
/usr/sbin
/sendmail
(as per the FHS). On older systems, the mail spool may be physically located
in
/var/spool/mail
, but all access to the mail spool should be via the
/var/mail
symlink.
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
fcntl()
locking must be
combined with dot locking. To avoid deadlocks, a program should use
fcntl()
first and dot
locking after this, or alternatively implement the two locking methods in a non blocking way
3
.
Using the functions
maillock
and
mailunlock
provided by the
liblockfile*
4
packages
is the recommended way to realize this.
Mailboxes are generally mode 660
user
.mail
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
mail.
The mail spool is 2775
root.mail
, and MUAs should be setgid mail to do the locking men 
tioned above (and must obviously avoid accessing other users' mailboxes using this privilege).
/etc/aliases
is the source file for the system mail aliases (e.g., postmaster, usenet, etc.), it is
the one which the sysadmin and
postinst
scripts may edit. After
/etc/aliases
is edited
the program or human editing it must call
newaliases
. All MTA packages must come with
a
newaliases
program, even if it does nothing, but older MTA packages did not do this so
programs should not fail if
newaliases
cannot be found. Note that because of this, all MTA
packages must have
Provides
,
Conflicts
and
Replaces:
mail transport agent
control file fields.
The convention of writing
forward to
address
in the mailbox itself is not supported. Use
a
.forward
file instead.
The
rmail
program used by UUCP for incoming mail should be
/usr/sbin/rmail
. Like 
wise,
rsmtp
, for receiving batch SMTP over UUCP, should be
/usr/sbin/rsmtp
if it is sup 
ported.
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
/etc/mailname
. 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
debconf
) and store it in
/etc/mailname
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
inn
package could say
something like:
3
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.
4
You will need to depend on
liblockfile1 (>>1.01)
to use these functions.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

gay web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved