$MAIL surprise
Steve VanDevender
stevev at darkwing.uoregon.edu
Sat Apr 7 06:32:42 EST 2001
Lewandowsky, Matt writes:
> Is there anyway for it to evaluate, at runtime, say $HOME? As your
> mailspools are under each users's home directory, if I read correctly...
It wouldn't be that hard to add some code in session.c to do something
like this:
#ifdef MAILSPOOLHOME
snprintf(buf, sizeof buf, "%.200s/.50s",
pw->pw_dir, MAILSPOOLHOME);
child_set_env(&env, &envsize, "MAIL", buf);
#else
snprintf(buf, sizeof buf, "%.200s/%.50s",
_PATH_MAILDIR, pw->pw_name);
child_set_env(&env, &envsize, "MAIL", buf);
#endif
This is probably the local change I'll put into our source tree.
However, this isn't the only way that people modify mail spooling in
large installations; another is the "/var/mail/u/user" hashing scheme.
I'm certainly not arguing for putting in a bunch of code to deal with
all these kinds of customizations, especially when there's no good way
to specify the different methods algorithmically.
Just as a random thought, what about making the setting of MAIL
conditional on whether "CheckMail yes" is specified in sshd_config?
More information about the openssh-unix-dev
mailing list