See unread mail on SSH login

In the previous post, I explained how to set up your mail server. Now an extra tip on how to read your mail. If you have your own server, you will probably log in via SSH to administer it. Would it not be nice to be greeted with a message if you have new mail? That’s quite easy. Edit the files /etc/pam.d/login and /etc/pam.d/sshd and find the line with pam_mail.so on it. Make it look like
[code]session    optional   pam_mail.so standard dir=~/.mail[/code]
If you have another directory where Dovecot stores your mail, change it. To read your mail, type [code]mail[/code] to read it. It might be necessairy to install the package heirloom-mailx by first typing [code]aptitude install heirloom-mailx[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *