Solved How do I stop sshd from setting the MAIL env. variable?

Hi gang,

So... I moved away from mbox to the Maildir format courtesy of Sendmail, procmail & Mutt; this setup works like a charm.

However... there's a problem when the MAIL environment variable it set (this defaults to /var/mail/$USER) because this will make Mutt switch to focussing on the mbox again. So... I changed /etc/login.conf (and ran cap_mkdb), verified /usr/share/skel and my local shell setups... everything checks out.

When I log onto the console... no more MAIL. But... when I log on using SSH... lo and behold: MAIL=/var/mail/peter returns.

I already set PermitUserEnvironment to 'no' in /etc/ssh/sshd_config but even that doesn't stop it. It also doesn't matter if I log on using PuTTY or Windows' own SSH client.. the variable gets set.

Anyone got an idea how to tell SSHd to stop doing this? At least that's my conclusion so far...

(edit)

In the mean time I temporarily resolved this idiocy by adding the following line to ~/.profile:
Code:
if [ ! -z $MAIL ]; then unset MAIL; fi
...but that's obviously not a very satisfying solution as this shouldn't have been set in the first place.
 
looking at the source it seems you can't
just use .profile
Appreciate the feedback, especially because I've also been studying the source tree as well, came to the same conclusion but wasn't fully sure of my findings. Well, onto plan B ;) Just finished setting up DSpam and I'm just going to "ab"use the mbox as a fallback quarantine and add a macro to Mutt that gets me to my IMAP server so that you're basically forced to check the quarantine first.
 
Back
Top