7

I have had an Ubuntu Server (12.04.2) running for quite some time. I was playing around with WooCommerce on WordPress the other day, and wanted to figure out how to get the email notifications to work. In my endeavors, I installed (and uninstalled; well, apt-get purge'ed) both sendmail and postfix.

After I was done playing, and uninstalling everything I had installed (since I could not get either to work), I noticed that a prompt telling me that I had mail would pop-up every time I logged onto the system.

enter image description here

How can I get rid of this Prompt? I went many, many months without it, and I don't need it or the mail that it wants to tell me I have. Even better, can I turn off the local mail system entirely?

2 Answers 2

10

Edit the pam_mail line in the appropriate PAM configuration file. For local logins, this is /etc/pam.d/login. For ssh, it is /etc/pam.d/sshd. Note that this affects all users. By default it uses standard, which does print a message if you have no mail. You can change it to quiet to only print if you do have mail. See the pam_mail manpage for full details.

4
  • Unfortunatly, this is not working for me. I used sudoedit /etc/pam.d/login and changed 'standard' to 'quiet' on the pam_mail line, saved and then logged out, no dice. Even tried a reboot, still no dice. Any reason this should be? After reading through the man page for pam_mail, it seems that the option I really want is 'nopen', but This does not seem to work either. :0( Jul 11, 2013 at 15:18
  • 2
    Okay, I figured it out. /etc/pam.d/login is only respected when logging in via /bin/login, or in other words when logging in locally. since my system is headless, and I ssh into it using sshd, I had to edit the same pam_mail line only in /etc/pam.d/sshd This answer on Server Fault pointed me in the right direction. It seems that PAM is very flexible. Thanks for your help. :0) Jul 11, 2013 at 16:06
  • 1
    Ah - you didn't say that you were using ssh, so I wrongly assumed you meant a local login. I've edited my answer to include both alternatives. Jul 11, 2013 at 17:17
  • Yeah at the time, I didn't think it would have made a difference. :0) Jul 11, 2013 at 19:34
0

Just another (simpler) option that worked for me: Remove the file corresponding to your user name under `/var/mail/'. If there is one with size 0, it seems to lead to the message.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .