How to ENABLE "you have new mail"
I've got my server set up to do a whole range of (semi) usefull things automatically and should any of them break it sents me (root) a nice email.
I've been trying without success to enable the "you have new mail" message that always used to be there but I can't get it working. Any ideas? I've set MAILCHECK as someone said unsetting it disabled the notification but that didn't work. |
Take a look at http://pic.dhe.ibm.com/infocenter/ai...s%2Fmailrc.htm.
You will need to edit the main mail.rc or create one in roots home dir(if it does not already exist). There you can specify your options. |
Thanks, but that doesn't seem to say anything about enabling the "you have new mail" message. The mail system is working fine, but I have to type 'mail' each time I log in to check. I was just trying to get the new mail message to appear on login...
|
I believe you need to set the PAGER env variable in that mail.rc file.
|
login as: root
root@192.168.1.12's password: Last login: Wed May 9 18:01:40 2012 from 192.168.1.7 [root@GDServer ~]# cat .mailrc set PAGER export PAGER [root@GDServer ~]# Still no "you have no mail" - there is mail as I sent it before logging out. |
http://linux.die.net/man/1/bash
Quote:
|
We seem to be missing the point.
I'm trying to get the system to check and tell me as soon as I log in. MAILPATH tells it where to check MAILCHECK tells it how often to check These are already set correct: [root@GDServer ~]# env | grep MAIL MAILCHECK=60 MAIL=/var/spool/mail/root What the system doesn't do is tell me when I log in. E.g. As things are now: login as: root root@192.168.1.12's password: Last login: Wed May 9 19:57:18 2012 from 192.168.1.7 [root@GDServer ~]# mailx Heirloom Mail version 12.5 7/5/10. Type ? for help. "/var/spool/mail/root": 4 messages 2 new 3 unread U 1 root Wed May 9 18:01 20/771 2 Cron Daemon Wed May 9 19:48 27/1188 "Cron <root@GDServer> " >N 3 wdtv box Wed May 9 22:55 29/1012 "virus-scan.05-09-12" N 4 root Thu May 10 06:01 29/1021 "virus-scan.05-10-12" & q [root@GDServer ~]# What I would like: login as: root root@192.168.1.12's password: Last login: Wed May 9 19:57:18 2012 from 192.168.1.7 You have new mail! [root@GDServer ~]# |
Ok, well here's a method based on pam/ssh http://www.freelists.org/post/loulug...eck-on-login,1 ; this uses a specific pkg http://dev.man-online.org/man1/mailcheck/ that you enable in eg /etc/profile
HTH |
All times are GMT -5. The time now is 07:04 AM. |