[arch-general] "You have mail" message at login
Whenever I log in to a TTY, I get this message. I read my system mails through mutt, so i don't need this. I have unset MAILCHECK in .bashrc, but no effect. I set MAIL_CHECK_ENAB to no in login.defs, but still no effect. Lastly i tried creating a .hushlogin file in the user's home, but even that didn't have any effect. The message only appears when logging in through a TTY though, not in any other terminal. Any idea what's causing it to show up? ps: Gaetan, here's the content of my .bash_profile [[ -f ~/.bashrc ]] && . ~/.bashrc so, i believe .bashrc is sourced on login.
2012/10/16 gt <static.vortex@gmx.com>:
Any idea what's causing it to show up?
Well, you could always try brute force method. Login and run this as root: strace -vft -p $TARGET_GETTY_PID -o /tmp/strace-getty Now login in straced terminal, logout and grep for "New mail" in /tmp/strace-getty. You will get (among other things) pid of process which wrote "new mail" on screen. You can easily find (with grep) parent process. I believe you know what to do from here ;). -- Krzysztof Warzecha
On Tue, Oct 16, 2012 at 04:24:37PM +0200, Krzysztof Warzecha wrote:
2012/10/16 gt <static.vortex@gmx.com>:
Any idea what's causing it to show up?
Well, you could always try brute force method. Login and run this as root:
strace -vft -p $TARGET_GETTY_PID -o /tmp/strace-getty
Now login in straced terminal, logout and grep for "New mail" in /tmp/strace-getty. You will get (among other things) pid of process which wrote "new mail" on screen. You can easily find (with grep) parent process. I believe you know what to do from here ;).
Ingenious method. Though I read sebastien's reply earlier and hence had found the culprit, i nevertheless tried yours too. First line of strace-getty showed pam_mail.so. Thanks.
On 16 October 2012 01:42, gt <static.vortex@gmx.com> wrote:
Whenever I log in to a TTY, I get this message. I read my system mails through mutt, so i don't need this.
Pam is taking care of showing whether you have mail or not. In /etc/pam.d/system-login, comment this line: session optional pam_mail.so dir=/var/spool/mail standard You should not get new mail prompts anymore. -- Sébastien Leblanc
On Tue, Oct 16, 2012 at 10:33:53AM -0400, Sébastien Leblanc wrote:
On 16 October 2012 01:42, gt <static.vortex@gmx.com> wrote:
Whenever I log in to a TTY, I get this message. I read my system mails through mutt, so i don't need this.
Pam is taking care of showing whether you have mail or not. In /etc/pam.d/system-login, comment this line:
session optional pam_mail.so dir=/var/spool/mail standard
You should not get new mail prompts anymore.
That did it! I had searched in the pam directory earlier, but didn't grep through the files for mail. Thanks a lot.
On Tuesday 16 of October 2012 10:33:53 Sébastien Leblanc wrote:
On 16 October 2012 01:42, gt <static.vortex@gmx.com> wrote:
Whenever I log in to a TTY, I get this message. I read my system mails through mutt, so i don't need this.
Pam is taking care of showing whether you have mail or not. In /etc/pam.d/system-login, comment this line:
session optional pam_mail.so dir=/var/spool/mail standard
You should not get new mail prompts anymore. Thank you for the solution! I have run into the same issue too, however, I'd like to keep the login msg when on TTY, but avoid it with kdm/graphical login prompt (new mail, and MOTD is displayed), I think this started with systemd/new kde ..?
Thank you for your time, Mark -- Marek Otahal :o)
On Wednesday 17 of October 2012 01:12:28 you wrote:
On Tuesday 16 of October 2012 10:33:53 Sébastien Leblanc wrote:
On 16 October 2012 01:42, gt <static.vortex@gmx.com> wrote:
Whenever I log in to a TTY, I get this message. I read my system mails through mutt, so i don't need this.
Pam is taking care of showing whether you have mail or not. In /etc/pam.d/system-login, comment this line:
session optional pam_mail.so dir=/var/spool/mail standard
You should not get new mail prompts anymore. Thank you for the solution! I have run into the same issue too, however, I'd like to keep the login msg when on TTY, but avoid it with kdm/graphical login prompt (new mail, and MOTD is displayed), I think this started with systemd/new kde ..?
Thank you for your time, Mark
Sorry, just read the older mail, there's already a filed bug at: https://bugs.archlinux.org/task/31999 -- Marek Otahal :o)
On Tue, Oct 16, 2012 at 3:33 PM, Sébastien Leblanc <leblancsebas@gmail.com> wrote:
On 16 October 2012 01:42, gt <static.vortex@gmx.com> wrote:
Whenever I log in to a TTY, I get this message. I read my system mails through mutt, so i don't need this.
Pam is taking care of showing whether you have mail or not. In /etc/pam.d/system-login, comment this line:
session optional pam_mail.so dir=/var/spool/mail standard
You should not get new mail prompts anymore.
Great - this fixes the issue for me with a mail popup when logging in to KDE also - https://bugs.archlinux.org/task/3199 -- mike c
participants (5)
-
gt
-
Krzysztof Warzecha
-
Marek Otahal
-
mike cloaked
-
Sébastien Leblanc