$MAIL surprise

Garance A Drosihn drosih at rpi.edu
Sat Apr 7 06:42:53 EST 2001


At 12:18 PM -0700 4/6/01, Steve VanDevender wrote:
>...  At first I thought he had pilfered my .bashrc, but on
>further investigation I discovered that my home directory path had been
>compiled in to sshd, because the configuration tests assume that the
>directory part of $MAIL is the systemwide mail spool.  Unfortunately on
>this system we deliver mail into user home directories, so we set MAIL
>to $HOME/.mail rather than /var/{,spool/}mail/$USER, and this user's
>shell initialization did not change MAIL from the default set by sshd.
>
>Given that I'm doing something nonstandard, an answer of "don't
>configure OpenSSH with your funky setting of MAIL" is reasonable
>enough.  I can't really think of any clean solution to put into the
>Portable OpenSSH code base to address this; ...

What happens for your mail programs if you set MAIL to
      ~/.mail
(with the ~ literally in the environment variable, don't
let the shell expand it out when the value is being set).
Do your applications understand ~ = $HOME ?

If so, then openssh could at least recognize ~ (which it
may already do...), and you might have one plausible
option.  Or at least, you could COMPILE openssh with that
value set, even if you can't just arbitrary set that for
all users.

Another option MIGHT be to see what happens if the value
for 'MAIL' is literally '$HOME/.mail' (again, without
having $HOME expanded by the shell when setting the
variable), but I suspect this is less likely to work in
other email applications.  More importantly, that then
means that openssh's behavior depends on an environment
variable the user can directly change, and that does not
sound like a good idea to me.


-- 
Garance Alistair Drosehn            =   gad at eclipse.acs.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu



More information about the openssh-unix-dev mailing list