HI Timo & all. We're an mbox environment, inboxes in /var/mail/$USER (I'll include dovecot -n output at the bottom of this mail). mail_location is set accordingly for deliver. I'd assumed that if the /var/mail/$USER file doesn't exist, dovecot would create it, but we've discovered from experience (and I verified it in mbox-storage.c) that if access(path, R_OK|W_OK) fails--as it does if the file doesn't exist--that dovecot defaults then to delivering in root_dir/inbox. I'm curious why this is. It seems like if the configured INBOX file doesn't exist, dovecot should create it if possible; it's a different case than if, say, the user doesn't have write access to that directory, in which case it of course would be appropriate to fall back to some other location rather than rejecting mail. Is there something I'm missing that makes my idea wrong? Thanks, -Brian Hayden OIT Internet Services University of MN # ./dovecot -n # /etc/opt/dovecot/dovecot.conf syslog_facility: local6 protocols: imap imaps pop3 pop3s listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 ssl_cert_file: /etc/opt/openssl/certs/dovecot.pem ssl_key_file: /etc/opt/openssl/private/dovecot.pem shutdown_clients: no login_dir: /var/opt/dovecot/run/dovecot/login login_executable(default): /opt/dovecot/libexec/dovecot/imap-login login_executable(imap): /opt/dovecot/libexec/dovecot/imap-login login_executable(pop3): /opt/dovecot/libexec/dovecot/pop3-login login_log_format_elements: user=<%u> pid=<%p> method=%m rip=%r lip=%l %c login_processes_count: 32 login_max_processes_count: 6000 max_mail_processes: 8192 first_valid_uid: 100 mail_location: mbox:~:INBOX=/var/mail/%u:INDEX=/var/mail/.dovecot-index/%1u/%u/ mail_debug: yes mbox_lazy_writes: no mail_executable(default): /opt/dovecot/libexec/dovecot/mail_path.sh mail_executable(imap): /opt/dovecot/libexec/dovecot/mail_path.sh mail_executable(pop3): /opt/dovecot/libexec/dovecot/pop3 mail_plugins(default): acl mail_plugins(imap): acl mail_plugins(pop3): mail_plugin_dir(default): /opt/dovecot/lib/dovecot/imap mail_plugin_dir(imap): /opt/dovecot/lib/dovecot/imap mail_plugin_dir(pop3): /opt/dovecot/lib/dovecot/pop3 mail_log_prefix: [%p] %Us(%u): mail_log_max_lines_per_sec: 0 imap_client_workarounds(default): delay-newmail outlook-idle tb-extra-mailbox-sep imap_client_workarounds(imap): delay-newmail outlook-idle tb-extra-mailbox-sep imap_client_workarounds(pop3): outlook-idle pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %08Xu%08Xv namespace: type: private separator: / location: mbox:~:INBOX=/var/mail/%u:INDEX=/var/mail/.dovecot-index/%1u/%u/ inbox: yes namespace: type: private separator: / prefix: mail/ location: mbox:~/mail/:INDEX=/var/mail/.dovecot-index/%1u/%u/ hidden: yes namespace: type: private separator: / prefix: ~/mail/ location: mbox:~/mail/:INDEX=/var/mail/.dovecot-index/%1u/%u/ hidden: yes namespace: type: private separator: / prefix: ~%u/mail/ location: mbox:~/mail/:INDEX=/var/mail/.dovecot-index/%1u/%u/ hidden: yes namespace: type: private separator: / prefix: Shared/ location: maildir:~/Maildir/Shared/:INDEX=/var/mail/.dovecot-index/%1u/%u/shared:CONTROL=/var/mail/.dovecot-index/%1u/%u/shared-control auth default: username_format: %Lu passdb: driver: pam args: session=yes * userdb: driver: passwd plugin: acl: vfile:
On Wed, 2007-08-01 at 08:58 -0500, bhayden at umn.edu wrote:> We're an mbox environment, inboxes in /var/mail/$USER (I'll include dovecot > -n output at the bottom of this mail). mail_location is set accordingly for > deliver. > > I'd assumed that if the /var/mail/$USER file doesn't exist, dovecot would > create it, but we've discovered from experience (and I verified it in > mbox-storage.c) that if access(path, R_OK|W_OK) fails--as it does if the > file doesn't exist--that dovecot defaults then to delivering in > root_dir/inbox.That access() check is done only if INBOX location isn't explicitly specified. Is this a problem only with deliver or also with imap?> mail_location: > mbox:~:INBOX=/var/mail/%u:INDEX=/var/mail/.dovecot-index/%1u/%u/Looks OK. I just tried this: mail_location = mbox:~:INBOX=/var/mail/%u And deliver created the file to /var/mail/ just fine.> mail_debug: yesWhat does Dovecot show in logs when logging in / delivering the message? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070801/cf697794/attachment-0002.bin>
On Aug 1 2007, Timo Sirainen wrote:>On Wed, 2007-08-01 at 08:58 -0500, bhayden at umn.edu wrote: >> We're an mbox environment, inboxes in /var/mail/$USER (I'll include >> dovecot >> -n output at the bottom of this mail). mail_location is set accordingly >> for deliver. >> >> I'd assumed that if the /var/mail/$USER file doesn't exist, dovecot >> would create it, but we've discovered from experience (and I verified it >> in mbox-storage.c) that if access(path, R_OK|W_OK) fails--as it does if >> the file doesn't exist--that dovecot defaults then to delivering in >> root_dir/inbox. > >That access() check is done only if INBOX location isn't explicitly >specified. > >Is this a problem only with deliver or also with imap?Deliver only. On further review, I discovered where the problem lies locally, it was not a Dovecot issue. Sorry to bother. :) Thanks for your help, -Brian