0

Running Ubuntu server 18.04 and have installed PostFix and mailutils.

I have sent some test emails to postfix and they are stored in a plain text file at /var/mail named as the recipient alias. When I use the mail command, it gives the path of the mailbox and says no mail available.

Cannot open mailbox /home/user/Maildir/: Is a directory
No mail for user
You have mail in /home/user/Maildir/

The folder is empty and the reply is contradicting. How do I set this up properly? It got changed when I was blindly following other directions and now I'm lost as it's not default anymore.

1 Answer 1

0

It seems that postfix is working properly if storing mails in mbox format in /var/mail is desired, but mailutils are confused with some configuration in /etc/mail.rc, e. g. inspect that file. You can try to invoke mail command with -n option to avoid reading default config and it should bring some result.

The other option is to teach postfix to store mail to users home space - typically to /home/$USER/Maildir and it is IMO what you want and need - you can do it envoking command

sudo postconf -e "home_mailbox = Maildir/"

which adds home_mailbox directive to /etc/postfix/main.cf - you can check it before you do it. And after you do it.

You have to choose whether you want mbox style or maildir style. For short: mbox is better for thousands of small messages (typically spam) mostly for "write only" access and maildir is great when handling large messages. For mailboxes bellow 100MB it mostly doesn't matter what you choose.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .