Help with Dovecot, Postfix and whacky results.

Derek Broughton derek at pointerstop.ca
Wed Jun 3 14:29:38 UTC 2009


Daevid Vincent wrote:

> I don't understand what's happening here.
> 
> Installed packages in question:
> dovecot 1.1.4-0ubuntu1.2
> postfix 2.5.5-1
...
> I have *my* user account "daevid" and everything works fantastic. I use
> Outlook, Evolution, Alpine, Roundcube, and things are great!
> 
> $ ll /var/spool/mail
> -rw-rw----  1 daevid     mail 1202532 2009-06-02 15:00 daevid
> 
> $ ll /home/daevid/mail

That one is probably not relevant - ~/mail is used by your mail client not 
dovecot and postfix (unless you actually have postfix dropping the mail 
there... which, below, it seems you might, via procmail)
 
> So then I added another user to my system and that user can't get mail via
> ANY of the clients mentioned above!!?? WTF? Plus a new directory Maildir
> is added to their home folder (and this is where new mail is showing up vs
> the /var/spool/mail dir that my mail shows in):

That's not a problem.  Dovecot looks in all the usual suspects, including 
/var/mail/$USER, /var/spool/mail/$USER and /home/$USER/Maildir.  
var/spool/mail should just be a symlink to /var/mail.
> 
> root@:/var/spool/mail# ll
> -rw-rw----  1 daevid     mail 1202532 2009-06-02 15:00 daevid
> -rw-rw----  1 mike       mail       0 2009-05-20 13:11 mike
... 
> If I send a test message from Alpine ON my server to this new account, it
> will show up in this folder (and not in /var/spool/mail as *my* mail does.
> huh?

Postfix configuration problem.  :-(  You appear to have "daevid" being 
delivered in "mbox" format and "mike" as "maildir".  iirc, postfix uses 
/var/mail/ by default if you want mbox, but puts maildir deliveries in the 
user's directory - I _really_ don't know postfix though. 

I can't tell you how to make postfix behave, but I'm fairly sure that if you 
just delete /var/spool/mail/mike, which isn't being used anyway, dovecot 
will find his ~/Maildir directory (stop and restart dovecot).

> So what really baffles me is that I don't understand why one account would
> work fine and the other wouldn't? Shouldn't this be an all or nothing
> situation? And how do I fix it so that other accounts work like mine does?

You might not really want to - I've waffled for a decade on whether I want 
mail in /var/mail (convenient for backup up all users' mail) or 
/home/$USER/Maildir (more convenient for getting a user's mail backed up 
with the rest of his data).  atm, I'm on the user's Maildir side of the 
fence, but I wouldn't be surprised if next year I'm back to /var/mail :-)

> I do use procmail in my account, but I don't see any setting that tells it
> to redirect to /var/spool/mail
> http://www.daevid.com/content/examples/procmail.php

I don't know procmail, either, but typically deliveries to .../filename go 
to an mbox and deliveries to .../filename/ go to a Maildir (I think qmail 
introduced that convention).
-- 
derek






More information about the ubuntu-users mailing list