Monitoring mailbox in Maildir format with bash and pam_mail

After switch to Maildir format mailbox my bash stopped monitoring new mail. To bring this functionality back I need to set location of my new mailbox:

export MAIL=~/Maildir

And after $MAILCHECK seconds I got You have new mail in /home/kb/Maildir.

To set $MAIL for all login shells and for all user I use pam_mail. To enable checking ~/Maildir for new mail use:

session    optional   pam_mail.so standard dir=~/Maildir

Probably modification in /etc/pam.d/login and /etc/pam.d/sshd are sufficient.

1 comment to Monitoring mailbox in Maildir format with bash and pam_mail

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>