pam_mail
Andrew G. Morgan <morgan@parc.power.net>
Author
auth
Default mail directory /var/spool/mail/
This module looks at the user's mail directory and indicates whether the user has any mail in it.
debug
; dir=
direcory-name; nopen
; close
;
noenv
; empty
This module provides the ``you have new mail'' service to the user. It
can be plugged into any application that has credential hooks. It gives a
single message indicating the newness of any mail it finds in the
user's mail folder. This module also sets the Linux-PAM
environment variable, MAIL
, to the user's mail directory.
Although the module supplies functions for the authentication
management group of functions, it cannot be used to authenticate a
user; its authentication function instructs libpam
to simply
ignore it when authenticating the user.
The behavior of this module can be modified with one of the following flags:
debug
- write more information to syslog(3)
.
dir=
pathname
- look for the users' mail in an alternative directory given by
pathname. The default location for mail is
/var/spool/mail
. Note, if the supplied pathname is
prefixed by a `~
', the directory is interpreted as
indicating a file in the user's home directory.
nopen
- instruct the module to not print any mail information when the
user's credentials are acquired. This flag is useful to get the MAIL
environment variable set, but to not display any information about it.
close
- instruct the module to indicate if the user has any mail at the as
the user's credentials are revoked.
noenv
- do not set the MAIL
environment variable.
empty
- indicate that the user's mail directory is empty if this is found to
be the case.
This module can be used to indicate that the user has new mail when
they login to the system. Here is a sample entry for your
/etc/pam.conf
file:
#
# do we have any mail?
#
login auth optional pam_mail.so
Note, some applications may perform this function themselves. In such cases, this module is not necessary.