Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have had an Ubuntu Server (12.04.2) running for quite some time. It runs a variety of Server apps, including hosting my personal website. 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. First I thought, oh, I just need to mark 2000 mails as read. I did that (thankfully there are ways to do this without going through 8+ months of mail that I didn't even know I had). But now the prompt loves to tell me that I have 'No mail.'

enter image description here

How can I get rid of this Prompt? It drives me crazy. 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?

Thanks for your help. :0)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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( –  Luis Flores III Jul 11 '13 at 15:18
    
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) –  Luis Flores III Jul 11 '13 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. –  Robie Basak Jul 11 '13 at 17:17
    
Yeah at the time, I didn't think it would have made a difference. :0) –  Luis Flores III Jul 11 '13 at 19:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.