Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having to set up an email server for a class and have installed exim (using Maildir mailbox format) and sent myself an email. I can't read the email though: I have set the MAIL variable to ~/Maildir but when I try to open mail I get

pad-20@PAD-20:~$ mail
mail: /home/pad-20/Maildir/: Is a directory

I also changed the settings in /etc/pam.d/{login,su,sshd} according to this guide, but all that's done is give me a new email summary when I log in.

The strange thing is that frm works:

pad-20@PAD-20:~$ frm
    Test 2 from telnet

(That's the subject of the test email I sent).

There is another question on askubuntu that is similar, except that their problem was fixed after setting the MAIL variable correctly.

share|improve this question
up vote 10 down vote accepted

The traditional unix /usr/bin/mail only supports mailbox format. It's older than maildir, after all.

Under Ubuntu, /usr/bin/mail has two alternatives: heirloom-mailx Install heirloom-mailx and bsd-mailx Install bsd-mailx. Each of the two have extensions to the historical utility, but the Heirloom version more so. In particular, Only the Heirloom version has maildir support (and IMAP, and decent charset handling, and MIME).

Make sure you have the Heirloom version installed. If you have both, the alternative defaults to heirloom-mailx; check that you haven't changed the default setting by running sudo update-alternatives --config mailx.

share|improve this answer
Thanks, installing heirloom-mailx solved the issue. I'd vote you up too but don't have enough rep. – bob esponja Jun 9 '11 at 10:02

Previously i do this to fix de enviroment variables:

First install : apt-get install mailutils Note: Do not touch /etc/login.defs;

Edit files in /etc/pam.d/login session optional dir=~/Maildir standard

Edit files in /etc/pam.d/su session optional dir=~/Maildir nopen

Edit files in /etc/pam.d/sshd session optional dir=~/Maildir standard

Post: update-alternatives --config mailx

Shows: (in my case) Existen 2 opcioens para la alternativa mailx (que provee /usr/bin/mailx).

> >   Selección   Ruta                     Prioridad  Estado
> > ------------------------------------------------------------
>   0            /usr/bin/bsd-mailx        50        modo automático  
>   1            /usr/bin/bsd-mailx        50        modo manual
> * 2            /usr/bin/mail.mailutils   30        modo manual

I choose the option (2) "mailutils"

Result: Maildir format, i can type "mail" and shows me the incoming messages in console. the log looks good.

Thanks for the support of the voters that qualified me negative, this encourages me to continue to collaborate

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Pilot6 Feb 1 at 9:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.