[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Maildir and MAIL environment variable?



Matti Airas wrote:

> I wonder which would be the proper way to set MAIL environment
> variable when delivering mail to $HOME/Maildir? If I only set
> QMAIL_DIR in /etc/login.defs, I get the additional MAILDIR environment
> variable, but MAIL still points to /var/spool/mail/$USER. I can set
> MAIL_FILE to "Maildir/", which has the desired effect of having MAIL
> set to /home/$USER/Maildir/, but is that calling for trouble? For
> example, is it possible for MUAs etc. not understanding the Maildir
> format to wreck havoc in the mail directory?

Why would you be running an MUA that doesn't understand maildir format
if you store all your mail in maildir folders? This seems like one of
those "If it hurts when you do that, don't do it" situations.

The proper value of $MAIL depends what software you're using, and what
those programs expect to find when they look at $MAIL and the file or
directory it points to. I suggest reading the man pages for your MTA,
MUA, and whatever other programs may be involved in transporting or
viewing your mail, to see what they expect. With any luck, there will be
a single setting that is compatible with all of them. If not, try
switching to other software as needed.

The only programs that do anything with my mail are exim, fetchmail,
procmail, and mutt (plus emacs for editing, but that doesn't count).
Fetchmail delivers all incoming mail to exim, which delegates it all to
procmail, which doesn't use $MAIL (instead, one specifies DEFAULT,
ORGMAIL, and MAILDIR in ~/.procmailrc, none of which default to $MAIL).
This leaves only mutt to care about the value of $MAIL. Mutt supports
maildir format and knows what to do when $MAIL points to a directory. So
I set MAIL=/home/craig/Mail/inbox (my default maildir folder) and
everything is happy.

Craig



Reply to: