Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS (postfix) places mail in /var/spool/mail but $MAIL points to /var/mail/* #7336

Closed
bjornfor opened this issue Apr 12, 2015 · 3 comments
Closed

Comments

@bjornfor
Copy link
Contributor

Workaround, run your MUA like this:

MAIL=/var/spool/mail/$USER mutt

I tried locating the base path for $MAIL. Grepping nixpkgs yields nothing. Grepping bash sources indicates that there is a ./configure variable called bash_cv_mail_dir that can be set. The weird part is that this variable gets initialized like this:

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default mail directory" >&5
$as_echo_n "checking for default mail directory... " >&6; }
if ${bash_cv_mail_dir+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -d /var/mail; then
   bash_cv_mail_dir=/var/mail
 elif test -d /var/spool/mail; then
   bash_cv_mail_dir=/var/spool/mail
 elif test -d /usr/mail; then
   bash_cv_mail_dir=/usr/mail
 elif test -d /usr/spool/mail; then
   bash_cv_mail_dir=/usr/spool/mail
 else
   bash_cv_mail_dir=unknown
 fi

fi

So I would actually expect it to be set to "unknown", given that hydra (and I) build packages in chroots.

Anyway, I see three ways to solve this:

  • build bash with MAIL=/var/spool/mail
  • add /var/mail -> /var/spool/mail symlink in NixOS
  • change NixOS/postfix mail path from /var/spool/mail to /var/mail

Data point: FHS actually recommends /var/mail:
http://www.pathname.com/fhs/pub/fhs-2.3.html#VARMAILUSERMAILBOXFILES

@peti
Copy link
Member

peti commented Apr 14, 2015

I'm not sure what you mean by "$MAIL points to /var/mail". $MAIL is undefined on my NixOS system. No variable in my declare -p environment mentions neither /var/mail nor /var/spool/mail. To me, it looks more likely that mutt has that default path compiled in; I don't believe bash has anything to do with that.

@bjornfor
Copy link
Contributor Author

What? You don't have $MAIL environment variable at all?

$ echo $MAIL
/var/mail/bfo

AFAICS, it is bash that has the compiled in $MAIL pointing to /var/mail/*.

After thinking about this for a bit, I guess the /var/mail -> /var/spool/mail symlink is the best option. Then we are the most compatible and don't have to rebuild anything.

@peti
Copy link
Member

peti commented Jun 7, 2015

Resolved by #8206.

@peti peti closed this as completed Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants