1 <?xml version="1.0" encoding='UTF-8'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
5 <refentry id="pam_mail">
8 <refentrytitle>pam_mail</refentrytitle>
9 <manvolnum>8</manvolnum>
10 <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
13 <refnamediv id="pam_mail-name">
14 <refname>pam_mail</refname>
15 <refpurpose>Inform about available mail</refpurpose>
19 <cmdsynopsis id="pam_mail-cmdsynopsis">
20 <command>pam_mail.so</command>
28 dir=<replaceable>maildir</replaceable>
34 hash=<replaceable>count</replaceable>
51 <refsect1 id="pam_mail-description">
53 <title>DESCRIPTION</title>
56 The pam_mail PAM module provides the "you have new mail"
57 service to the user. It can be plugged into any application
58 that has credential or session hooks. It gives a single message
59 indicating the <emphasis>newness</emphasis> of any mail it finds
60 in the user's mail folder. This module also sets the PAM
61 environment variable, <emphasis remap='B'>MAIL</emphasis>, to the
62 user's mail directory.
65 If the mail spool file (be it <filename>/var/mail/$USER</filename>
66 or a pathname given with the <option>dir=</option> parameter) is
67 a directory then pam_mail assumes it is in the
68 <emphasis remap='I'>Maildir</emphasis> format.
72 <refsect1 id="pam_mail-options">
74 <title>OPTIONS</title>
80 <option>close</option>
84 Indicate if the user has any mail also on logout.
91 <option>debug</option>
95 Print debug information.
102 <option>dir=<replaceable>maildir</replaceable></option>
106 Look for the users' mail in an alternative location defined by
107 <filename>maildir/<login></filename>. The default
108 location for mail is <filename>/var/mail/<login></filename>.
109 Note, if the supplied
110 <filename>maildir</filename> is prefixed by a '~', the
111 directory is interpreted as indicating a file in the user's
119 <option>empty</option>
123 Also print message if user has no mail.
130 <option>hash=<replaceable>count</replaceable></option>
134 Mail directory hash depth. For example, a
135 <emphasis>hashcount</emphasis> of 2 would
136 make the mail file be
137 <filename>/var/spool/mail/u/s/user</filename>.
144 <option>noenv</option>
148 Do not set the <emphasis remap='B'>MAIL</emphasis>
149 environment variable.
156 <option>nopen</option>
160 Don't print any mail information on login. This flag is
161 useful to get the <emphasis remap='B'>MAIL</emphasis>
162 environment variable set, but to not display any information
170 <option>quiet</option>
174 Only report when there is new mail.
181 <option>standard</option>
185 Old style "You have..." format which doesn't show the
186 mail spool being used. This also implies "empty".
196 <refsect1 id="pam_mail-types">
197 <title>MODULE TYPES PROVIDED</title>
199 The <option>session</option> and
200 <option>auth</option> (on establishment and
201 deletion of credentials) module types are provided.
205 <refsect1 id='pam_mail-return_values'>
206 <title>RETURN VALUES</title>
209 <term>PAM_BUF_ERR</term>
218 <term>PAM_SERVICE_ERR</term>
221 Badly formed arguments.
227 <term>PAM_SUCCESS</term>
236 <term>PAM_USER_UNKNOWN</term>
247 <refsect1 id='pam_mail-examples'>
248 <title>EXAMPLES</title>
250 Add the following line to <filename>/etc/pam.d/login</filename> to
251 indicate that the user has new mail when they login to the system.
253 session optional pam_mail.so standard
258 <refsect1 id='pam_mail-see_also'>
259 <title>SEE ALSO</title>
262 <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
265 <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
268 <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
273 <refsect1 id='pam_mail-author'>
274 <title>AUTHOR</title>
276 pam_mail was written by Andrew G. Morgan <morgan@kernel.org>.