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
session    optional   pam_mail.so standard dir=~/.mail
If you have another directory where Dovecot stores your mail, change it. To read your mail, type mail to read it. It might be necessairy to install the package heirloom-mailx by first typing aptitude install heirloom-mailx

Leave a Reply

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