"no mail" message after logging into VPS even though I uninstalled "mailutils" and "postfix"

0

I uninstalled mailutils and postfix on Ubuntu 16.04.1 but I still get the no mail message after logging into my VPS.

rany

Posted 2016-09-01T11:39:14.203

Reputation: 859

Answers

0

Solution 1

To get rid of this message, edit /etc/pam.d/sshd and change this line:

From:

# Print the status of the user's mailbox upon successful login.
session optional pam_mail.so standard noenv # [1]

To:

# Print the status of the user's mailbox upon successful login.
session optional pam_mail.so nopen noenv # [1]

Solution 2 (use only if you are no longer using postfix, etc.)

Delete /var/mail/ by running cd /var/ && rm -rf mail.

rany

Posted 2016-09-01T11:39:14.203

Reputation: 859

1

I wouldn't have expected removing mailutils to have resolved this issue. Mail to root is often used as a last ditch attempt to notify the administrator of a failure.

Many system use the pam_mail module to report mail. This is likely enabled by default. The quiet option should make it report only if there is mail.

The no mail for root message is telling you that there are no such messages. Different systems use different methods to determine if there is mail during login. Check the scripts run by your shell during login.

On Linux it is common to configure an alias to the system administrator's real email address. This requires a working mail delivery system, usually forwarding to a mail relay that can get the message delivered.

BillThor

Posted 2016-09-01T11:39:14.203

Reputation: 9 384

@rany same argument applies, This is normally handled by checking for the existence of a file containing unread mail. Its location may be specified by the MAIL environment variable. – BillThor – 2016-09-01T12:25:57.717