[Dovecot] imap+unix users and pop3+virtual users
This should be simple, but I'm missing something. My virtual users cannot access their mail.
I would like Unix users to get their mail via imap which is deposited in /var/spool/mail/username. (This works.)
I would like virtual users to get their mail via pop3 which is deposited in /var/spool/mail/vhosts/example.com/auser/mail/inbox (postfix does in fact put the mail there). Those users can get authenticated via file /var/dovecot/passwd, but cannot retrieve their mail.
The log message is shown below. The file/directory is there, but doesn't dovecot see it?
Thanks,
Wendell
Info: POP3(auser@example.com): mbox: data=/var/spool/mail/vhosts/example.com/auser/mail/:INBOX=/var/mail/auser@example.com
Info: POP3(auser@example.com): mbox: root=/var/spool/mail/vhosts/example.com/auser/mail, index=/var/spool/mail/vhosts/example.com/auser/mail, inbox=/var/mail/auser@example.com
Info: POP3(auser@example.com): Mailbox init failed top=0/0, retr=0/0, del=0/0, size=0
/usr/sbin/dovecot -n
1.0.7: /etc/dovecot.conf
log_path: /var/log/dovecot.log info_log_path: /var/log/dovecot-info.log protocols: pop3 imap imaps pop3s ssl_cert_file: /etc/CA/cert.pem ssl_key_file: /etc/CA/key.pem login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login mail_location: mbox:~/mail/:INBOX=/var/mail/%u mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 auth default: verbose: yes debug: yes debug_passwords: yes passdb: driver: pam passdb: driver: passwd-file args: /etc/dovecot/passwd userdb: driver: passwd userdb: driver: static args: uid=vmail gid=vmail home=/var/spool/mail/vhosts/%d/%n
On Fri, Dec 14, 2007 at 11:24:16PM +0200, Evaggelos Balaskas wrote:
No, that made no difference.
In the log file, what are root, index, and inbox files? Are they top-level search directories, the actual inbox, or what?
The trailing '/' means mbox format, correct?
mbox: data=/var/spool/mail/user@example.com/mail/:INBOX=/var/mail/user@example.com
mbox: root=/var/spool/mail/user@example.com/mail, index=/var/spool/mail/user@example.com/mail, inbox=/var/mail/user@example.com
However, I solved my own problem, but I don't know why. Enlightenment would be appreciated.
this part is ok: userdb: driver: static args: uid=vmail gid=vmail home=/var/spool/mail/vhosts/%d/%n
however this was the offending line: mail_location: mbox:~/mail/:INBOX=/var/mail/%u
Q: why did commenting out the mail_location line make pop3 retrieval of the virtual host mailboxes work correctly?
Thanks,
Wendell
[Reversing the top-posting]
On Sun, 16 Dec 2007, Wendell Turner wrote:
[...]
The trailing '/' means mbox format, correct?
No. The trailing '/' means maildir format. (The '/' makes the path look like a directory.)
Commenting out the mail_location line made dovecot fall back to the default locations. See: http://wiki.dovecot.org/MailLocation
Best, Ben
On Sun, 16 Dec 2007, Benjamin R. Haskell wrote:
Forgot to add: specifying the 'mbox:' explicitly should make that a moot point. Dovecot only has to guess (by using "Does the path end in '/'?") if you don't specify mbox/dbox/maildir/etc. (I suspect it might also depend on whether the file/dir already exists.)
On Sun, Dec 16, 2007 at 09:47:02PM -0500, Benjamin R. Haskell wrote:
[Reversing the top-posting]
oops, thought that was the way the earlier postings were done
Wow, so dovecot is pretty smart after all(!). That advice helps a lot, I knew it was something simple.
Thank you very much for your help.
Wendell
On Thu, 20 Dec 2007, Timo Sirainen wrote:
Not true.
Using either dovecot-1.1_beta11 or dovecot-1.0.0 (from hg).
Using mail_location = ~/test-mail/, it errors out with: " Ambiguous mail location setting, don't know what to do with it: /home/username/test-mail/ (try prefixing it with mbox: or maildir:) "
if test-mail is: nonexistent, a file, or a directory without new,tmp,cur. But it succeeds when test-mail is a proper maildir.
Using mail_location = ~/test-mail, it also succeeds in the case that test-mail is a file.
E.g.
maildir autodetect: stat(/home/user/test-mail//cur) failed: Not a directory
vs.
maildir autodetect: stat(/home/user/test-mail/cur) failed: Not a directory
Best, Ben
On Thu, 2007-12-20 at 13:28 -0500, Benjamin R. Haskell wrote:
Well, okay, autodetection is a different thing. :) I didn't think of it. But even there Dovecot doesn't itself check if there's a '/' suffix. It's just that stat("test-mail/") happens to return an error if test-mail is a file, while it works for a directory.
If you specify the maildir: or mbox: prefix (as is preferred), then the suffix is always removed.
participants (4)
-
Benjamin R. Haskell
-
Evaggelos Balaskas
-
Timo Sirainen
-
Wendell Turner