MAIL environment variable set wrong

David Banks david.banks at proporta.com
Fri Jul 31 08:18:49 UTC 2009


Andrew Farris wrote:
> Following your trail, I decided to check and see if my own $MAIL
> variable was set to anything...lo and behold, it's empty. The only other
> difference I noticed between what I got on my system, and whay you
> showed, is that I dont have/use SSH, so the line about
> "/etc/pam.d/sshd:session" wasn't there for me. Other than that,
> everything else is the same.  I haven't the fondest idea why SSH would
> make a difference, but maybe somebody with some SSH experience could
> explain?

Thanks, Andrew.  Looking at it again, the last thing I did was comment 
out all lines referencing pam_mail within /etc/pam.d.  This reproduces 
your behaviour - physical logins don't get MAIL set, and SSH logins do.

I looked a bit more and found this:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532754

So it's possible that sshd is setting MAIL itself in the child process. 
  SSHing into 2 other Ubuntu servers that we run, I notice they both 
also have MAIL set (I don't have physical access to them so I can't see 
if they also have it unset on physical login, but this is more evidence 
that it's set by sshd itself.*)

So it looks like the only solution to this is patch the source?  And add 
a note to the bug to show that there's demand for the behaviour I guess.

Cheers,
David




More information about the ubuntu-users mailing list