Mailbox can't be created
Hi,
I have setup postfix master.cf to use dovecot-lda to deliver (using -m) all messages to PreInbox: dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -a ${recipient} -d ${user}@${nexthop} -m PreINBOX
And enabled lda_mailbox_autocreate.
The message I have now it: Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: save failed to open mailbox PreINBOX: Mailbox can't be created Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: saved mail to INBOX
Why wouldn't dovecot itself be able to create mailboxes?
I am using virtual domains and users on a mysql database through postfix and mailboxes saved in MailDir format.
Configuration of dovecot is: # 2.2.18: /etc/dovecot/dovecot.conf # OS: Linux 4.1.5-x86_64-linode61 x86_64 Fedora release 22 (Twenty Two) ext4 auth_debug = yes auth_mechanisms = plain login digest-md5 cram-md5 auth_verbose = yes auth_verbose_passwords = yes default_internal_user = root imap_client_workarounds = delay-newmail tb-extra-mailbox-sep lda_mailbox_autocreate = yes mail_debug = yes mail_location = maildir:/home/vmail/%d/%n/Maildir maildir_very_dirty_syncs = yes mbox_write_locks = fcntl namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = INBOX. separator = . type = private } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } postmaster_address = pmatos protocols = imap quota_full_tempfail = yes service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-master { mode = 0600 user = vmail } user = $default_internal_user } ssl = required ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes driver = static } protocol lda { auth_socket_path = /var/run/dovecot/auth-master deliver_log_format = msgid=%m: %$ log_path = /home/vmail/dovecot-deliver.log } protocol imap { mail_max_userip_connections = 100 }
Regards,
-- Paulo Matos
Please check permissions as this sounds like a permissions issue m On 27/08/2015 12:08 PM, "Paulo Matos" <paulo@matos-sorge.com> wrote:
Hi,
I have setup postfix master.cf to use dovecot-lda to deliver (using -m) all messages to PreInbox: dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -a ${recipient} -d ${user}@${nexthop} -m PreINBOX
And enabled lda_mailbox_autocreate.
The message I have now it: Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: save failed to open mailbox PreINBOX: Mailbox can't be created Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: saved mail to INBOX
Why wouldn't dovecot itself be able to create mailboxes?
I am using virtual domains and users on a mysql database through postfix and mailboxes saved in MailDir format.
Configuration of dovecot is: # 2.2.18: /etc/dovecot/dovecot.conf # OS: Linux 4.1.5-x86_64-linode61 x86_64 Fedora release 22 (Twenty Two) ext4 auth_debug = yes auth_mechanisms = plain login digest-md5 cram-md5 auth_verbose = yes auth_verbose_passwords = yes default_internal_user = root imap_client_workarounds = delay-newmail tb-extra-mailbox-sep lda_mailbox_autocreate = yes mail_debug = yes mail_location = maildir:/home/vmail/%d/%n/Maildir maildir_very_dirty_syncs = yes mbox_write_locks = fcntl namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = INBOX. separator = . type = private } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } postmaster_address = pmatos protocols = imap quota_full_tempfail = yes service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-master { mode = 0600 user = vmail } user = $default_internal_user } ssl = required ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes driver = static } protocol lda { auth_socket_path = /var/run/dovecot/auth-master deliver_log_format = msgid=%m: %$ log_path = /home/vmail/dovecot-deliver.log } protocol imap { mail_max_userip_connections = 100 }
Regards,
-- Paulo Matos
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Thanks,
Paulo Matos
On 27/08/15 12:46, Paulo Matos wrote:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Doh, it says on the line I quoted earlier from master.cf: dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -a ${recipient} -d ${user}@${nexthop} -m PreINBOX
It runs under vmail:vmail. There should be no problem creating a new mailbox.
Is there a way to understand what's really going on with dovecot?
Thanks,
Make it 755 and be done with it. On 27/08/2015 3:05 PM, "Paulo Matos" <paulo@matos-sorge.com> wrote:
On 27/08/15 12:46, Paulo Matos wrote:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Doh, it says on the line I quoted earlier from master.cf: dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -a ${recipient} -d ${user}@${nexthop} -m PreINBOX
It runs under vmail:vmail. There should be no problem creating a new mailbox.
Is there a way to understand what's really going on with dovecot?
Thanks,
ps aux | grep lda On 27/08/2015 2:58 PM, "Paulo Matos" <paulo@matos-sorge.com> wrote:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Thanks,
Paulo Matos
On 27/08/15 13:00, Muzaffer Tolga Ozses wrote:
ps aux | grep lda
Strange... postfix 1315 0.0 0.1 121220 7472 ? S 12:59 0:00 pipe -n dovecot -t unix flags=DRhu user=vmail vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -a ${recipient} -d ${user}@${nexthop} -m PreINBOX
I notice that the arg to pipe is 'user=vmail vmail' instead of 'user=vmail:vmail'. This is strange. I certanly have a colon on the master.cf file.
According to 'man pipe' the correct syntax is user=<user>:<group> so I can only assume this is where it's going wrong somehow.
On 27/08/2015 2:58 PM, "Paulo Matos" <paulo@matos-sorge.com> wrote:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Thanks,
Paulo Matos
Having said that, /home/vmail should be owned by vmail, however dovecot-lda should have write access so 700 is a bad idea. On 27/08/2015 3:00 PM, "Muzaffer Tolga Ozses" <tolga@ozses.net> wrote:
ps aux | grep lda On 27/08/2015 2:58 PM, "Paulo Matos" <paulo@matos-sorge.com> wrote:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Thanks,
Paulo Matos
dovecot-lda is being executed as vmail so it shouldn't be a problem in theory.
On 27/08/2015 13:03, Muzaffer Tolga Ozses wrote:
Having said that, /home/vmail should be owned by vmail, however dovecot-lda should have write access so 700 is a bad idea. On 27/08/2015 3:00 PM, "Muzaffer Tolga Ozses" <tolga@ozses.net> wrote:
ps aux | grep lda On 27/08/2015 2:58 PM, "Paulo Matos" <paulo@matos-sorge.com> wrote: On 27/08/15 10:42, Muzaffer Tolga Ozses wrote: Please check permissions as this sounds like a permissions issue m I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
How can I determine which user dovecot-lda runs under?
Thanks,
Paulo Matos
-- Paulo Matos
Am 27.08.2015 um 13:46 schrieb Paulo Matos:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
That statement is not correct nowadays as UNIX permissions aren't all any longer. There are tools like AppArmor and in your case with Fedora there is SELinux preventing even actions by root user.
Make sure the SELinux context fits. "/home/vmail" and the subfolder "Maildir" has to be SELinux labeled correctly.
ausearch -m avc
How can I determine which user dovecot-lda runs under?
Thanks,
Alexander
On 27/08/15 18:55, Alexander Dalloz wrote:
Am 27.08.2015 um 13:46 schrieb Paulo Matos:
On 27/08/15 10:42, Muzaffer Tolga Ozses wrote:
Please check permissions as this sounds like a permissions issue m
I am confused then. /home/vmail/Maildir is 700 for vmail:vmail. If dovecot-lda runs as vmail then there's no problem, if it runs as root it shouldn't face problems either.
That statement is not correct nowadays as UNIX permissions aren't all any longer. There are tools like AppArmor and in your case with Fedora there is SELinux preventing even actions by root user.
Make sure the SELinux context fits. "/home/vmail" and the subfolder "Maildir" has to be SELinux labeled correctly.
ausearch -m avc
SElinux is not the issue in my case:
$ sestatus SELinux status: disabled
-- Paulo Matos
On 27 Aug 2015, at 12:07, Paulo Matos <paulo@matos-sorge.com> wrote:
Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: save failed to open mailbox PreINBOX: Mailbox can't be created
I have no idea how you could get that error message. Looking at the code I don't see any way it could happen.. This error message exists only if the mailbox is tried to be created for a "fail" storage, which you can't really do. I'd maybe try recompiling Dovecot or something.
On 29/08/15 11:31, Timo Sirainen wrote:
On 27 Aug 2015, at 12:07, Paulo Matos <paulo@matos-sorge.com> wrote:
Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: save failed to open mailbox PreINBOX: Mailbox can't be created
I have no idea how you could get that error message. Looking at the code I don't see any way it could happen.. This error message exists only if the mailbox is tried to be created for a "fail" storage, which you can't really do. I'd maybe try recompiling Dovecot or something.
dovecot sources 2.2.18 (src/lib-storage/fail-mailbox.c): static int fail_mailbox_create(struct mailbox *box, const struct mailbox_update *update ATTR_UNUSED, bool directory ATTR_UNUSED) { mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE, "Mailbox can't be created"); return -1; }
-- Paulo Matos
On 03 Sep 2015, at 23:10, Paulo Matos <paulo@matos-sorge.com> wrote:
On 29/08/15 11:31, Timo Sirainen wrote:
On 27 Aug 2015, at 12:07, Paulo Matos <paulo@matos-sorge.com> wrote:
Aug 27 10:02:29 lda(): Info: msgid=<dae42d0cf57bf4496a3dd53e162f8281@localhost.localdomain>: save failed to open mailbox PreINBOX: Mailbox can't be created
I have no idea how you could get that error message. Looking at the code I don't see any way it could happen.. This error message exists only if the mailbox is tried to be created for a "fail" storage, which you can't really do. I'd maybe try recompiling Dovecot or something.
dovecot sources 2.2.18 (src/lib-storage/fail-mailbox.c): static int fail_mailbox_create(struct mailbox *box, const struct mailbox_update *update ATTR_UNUSED, bool directory ATTR_UNUSED) {
Add here: i_panic("can't get here");
Then when it crashes, get gdb backtrace as described by http://dovecot.org/bugreport.html
participants (4)
-
Alexander Dalloz
-
Muzaffer Tolga Ozses
-
Paulo Matos
-
Timo Sirainen