[Dovecot] error when using dovecot-lda as non root (vmail) user
Hello,
after finally having managed to setup up dovecot with virtual users and public folders I tried to get it connected to postfix. The problem is, that I can't get postix to deliver mail via dovecot-lda.
After some testing it seems to come down to dovecot-lda behaving different when called as root then when called as user vmail.
Basic setting:
- dovecot 2.1.1
- all mailboxes owned by user vmail (using mail_uid and mail_gid)
Test 1: as user root: /usr/libexec/dovecot/dovecot-lda -d ahelmcke < some_mail
working as expected; some_mail gets stored in users INBOX
Test 2: same command executed as user vmail. dovecot-lda terminates immediately.
syslog-output with mail_debug = yes: Test 1: Apr 19 16:38:04 elablnmail02 dovecot: lda: Debug: auth input: ahelmcke Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: Effective uid=494, gid=491, home=/home/mail/user/ahelmcke Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace inbox: type=private, prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=/home/mail/user/ahelmcke, alt= Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace dummy: type=private, prefix=, sep=/, inbox=no, hidden=yes, list=no, subscriptions=yes location=maildir:/home/mail/user/ahelmcke/public/ Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke/public, index=, control=, inbox=, alt= Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace Allgemeines: type=public, prefix=Allgemeines/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no location=maildir:/home/mail/Allgemeines:INDEX=/home/mail/user/ahelmcke/SEEN.Allgemeines Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/Allgemeines, index=/home/mail/user/ahelmcke/SEEN.Allgemeines, control=, inbox=, alt= Apr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: none: root=, index=, control=, inbox=, alt= Apr 19 16:51:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Destination address: ahelmcke@elablnmail02.ela-bln.local (source: user@hostname) Apr 19 16:51:37 elablnmail02 dovecot: lda(ahelmcke): msgid=unspecified: saved mail to INBOX
Test 2: Apr 19 16:37:37 elablnmail02 dovecot: lda: Debug: auth input: ahelmcke Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Effective uid=494, gid=491, home=/home/mail/user/ahelmcke Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace inbox: type=private, prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=/home/mail/user/ahelmcke, alt= Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace dummy: type=private, prefix=, sep=/, inbox=no, hidden=yes, list=no, subscriptions=yes location=maildir:/home/mail/user/ahelmcke/public/ Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke/public, index=, control=, inbox=, alt= Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes location= Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mdbox: access(/home/mail/user/ahelmcke/mdbox, rwx): failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mdbox: couldn't find root dir Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: sdbox: access(/home/mail/user/ahelmcke/sdbox, rwx): failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: sdbox: couldn't find root dir Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir: access(/home/mail/user/ahelmcke/Maildir, rwx): failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir: couldn't find root dir Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox autodetect: has .imap/: stat(/home/mail/user/ahelmcke/mail/.imap) failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox autodetect: has inbox: stat(/home/mail/user/ahelmcke/mail/inbox) failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox autodetect: has mbox: stat(/home/mail/user/ahelmcke/mail/mbox) failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox autodetect: has .imap/: stat(/home/mail/user/ahelmcke/Mail/.imap) failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox autodetect: has inbox: stat(/home/mail/user/ahelmcke/Mail/inbox) failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox autodetect: has mbox: stat(/home/mail/user/ahelmcke/Mail/mbox) failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: mbox: couldn't find root dir Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: sdbox: access(/home/mail/user/ahelmcke/sdbox, rwx): failed: No such file or directory Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: sdbox: couldn't find root dir Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Error: user ahelmcke: Initialization failed: Namespace '': Mail storage autodetection failed with home=/home/mail/user/ahelmcke Apr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Fatal: Invalid user settings. Refer to server log for more information.
doveconf -n
# 2.1.1: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-220.7.1.el6.x86_64 x86_64 CentOS release 6.2 (Final) auth_master_user_separator = * auth_verbose = yes first_valid_uid = 400 mail_debug = yes mail_gid = vmail mail_home = /home/mail/user/%u mail_uid = vmail managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave mbox_write_locks = fcntl namespace Allgemeines { location = maildir:/home/mail/Allgemeines:INDEX=/home/mail/user/%u/SEEN.Allgemeines prefix = Allgemeines/ separator = / subscriptions = no type = public } namespace dummy { alias_for = INBOX/ hidden = yes list = no location = maildir:/home/mail/user/%u/public/ prefix = separator = / type = private } namespace inbox { inbox = yes location = maildir:/home/mail/user/%u prefix = INBOX/ separator = / type = private } passdb { args = /etc/dovecot/passwd.masterusers driver = passwd-file master = yes pass = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf driver = ldap } plugin { acl = vfile sieve = /home/mail/user/%u/sieve.active sieve_dir = /home/mail/user/%u/sieve.scripts sieve_global_dir = /var/lib/dovecot/sieve/global/ sieve_global_path = /var/lib/dovecot/sieve/default.sieve } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { mode = 0600 user = vmail } } service imap-login { inet_listener imap { address = * } inet_listener imaps { address = * } } service managesieve-login { inet_listener sieve { address = * port = 4190 } } ssl = required ssl_cert =
Any ideas?
Greetings Andreas
On 19.4.2012, at 17.56, Andreas Helmcke wrote:
namespace inbox { inbox = yes location = maildir:/home/mail/user/%u prefix = INBOX/ separator = / type = private }
Move the location from the above namespace to global:
mail_location = maildir:/home/mail/user/%u
Although it probably still shouldn't have failed..
Am 19.04.2012 17:53, schrieb Timo Sirainen:
On 19.4.2012, at 17.56, Andreas Helmcke wrote:
namespace inbox { location = maildir:/home/mail/user/%u ....
Move the location from the above namespace to global:
mail_location = maildir:/home/mail/user/%u
Actually it /had/ been there and I moved it to inbox while trying to find the problem.
So, change reverted (excerpt from doveconf -n):
mail_location = maildir:/home/mail/user/%u
namespace inbox { inbox = yes location = prefix = INBOX/ separator = / type = private }
Now dovecot-lda is complaining about duplicate namespaces (still only when run as vmail; run it as root and it is working):
Apr 19 17:58:07 elablnmail02 dovecot: lda: Debug: auth input: ahelmcke Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Effective uid=494, gid=491, home=/home/mail/user/ahelmcke Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace inbox: type=private, prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=/home/mail/user/ahelmcke, alt= Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace dummy: type=private, prefix=, sep=/, inbox=no, hidden=yes, list=no, subscriptions=yes location=maildir:/home/mail/user/ahelmcke/public/ Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke/public, index=, control=, inbox=, alt= Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=, alt= Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Error: user ahelmcke: Initialization failed: namespace configuration error: Duplicate namespace prefix: "" Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Fatal: Invalid user settings. Refer to server log for more information.
Greetings Andreas
On 19.4.2012, at 19.09, Andreas Helmcke wrote:
Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace dummy: type=private, prefix=, sep=/, inbox=no, hidden=yes, list=no, subscriptions=yes location=maildir:/home/mail/user/ahelmcke/public/
Here's the dummy namespace with prefix="".
Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke
But what is this? You appear to have an empty namespace {} in your configs?
Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Error: user ahelmcke: Initialization failed: namespace configuration error: Duplicate namespace prefix: ""
That's why it fails with this.
Am 23.04.2012 12:59, schrieb Timo Sirainen:
On 19.4.2012, at 19.09, Andreas Helmcke wrote:
Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke
But what is this? You appear to have an empty namespace {} in your configs?
nope.
You might check yourself; complete dovecot -n:
# 2.1.1: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-220.7.1.el6.x86_64 x86_64 CentOS release 6.2 (Final) ext4 auth_master_user_separator = * auth_verbose = yes first_valid_uid = 400 mail_debug = yes mail_gid = vmail mail_home = /home/mail/user/%u mail_location = maildir:/home/mail/user/%u mail_uid = vmail managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave mbox_write_locks = fcntl namespace Allgemeines { location = maildir:/home/mail/Allgemeines:INDEX=/home/mail/user/%u/SEEN.Allgemeines prefix = Allgemeines/ separator = / subscriptions = no type = public } namespace dummy { alias_for = INBOX/ hidden = yes list = no location = maildir:/home/mail/user/%u/public/ prefix = separator = / type = private } namespace inbox { inbox = yes location = prefix = INBOX/ separator = / type = private } passdb { args = /etc/dovecot/passwd.masterusers driver = passwd-file master = yes pass = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf driver = ldap } plugin { quota = maildir:User quota quota_rule = *:storage=3G } protocols = imap lmtp service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { mode = 0600 user = vmail } } service imap-login { inet_listener imap { address = * } inet_listener imaps { address = * } } ssl = required ssl_cert =
And again the debug messages run as root: /usr/libexec/dovecot/dovecot-lda -d ahelmcke < some-mail
Apr 23 13:22:01 elablnmail02 dovecot: lda: Debug: auth input: ahelmcke quota_rule=*:storage=2000M Apr 23 13:22:01 elablnmail02 dovecot: lda: Debug: Added userdb setting: plugin/quota_rule=*:storage=2000M Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: Effective uid=494, gid=491, home=/home/mail/user/ahelmcke Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace inbox: type=private, prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=/home/mail/user/ahelmcke, alt= Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace dummy: type=private, prefix=, sep=/, inbox=no, hidden=yes, list=no, subscriptions=yes location=maildir:/home/mail/user/ahelmcke/public/ Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke/public, index=, control=, inbox=, alt= Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace Allgemeines: type=public, prefix=Allgemeines/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no location=maildir:/home/mail/Allgemeines:INDEX=/home/mail/user/ahelmcke/SEEN.Allgemeines Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/Allgemeines, index=/home/mail/user/ahelmcke/SEEN.Allgemeines, control=, inbox=, alt= Apr 23 13:22:01 elablnmail02 dovecot: lda(ahelmcke): Debug: none: root=, index=, control=, inbox=, alt= Apr 23 13:22:10 elablnmail02 dovecot: lda(ahelmcke): Debug: Destination address: ahelmcke@elablnmail02.ela-bln.local (source: user@hostname) Apr 23 13:22:10 elablnmail02 dovecot: lda(ahelmcke): msgid=unspecified: saved mail to INBOX
run as vmail: /usr/libexec/dovecot/dovecot-lda -d ahelmcke < some-mail
Apr 23 13:22:37 elablnmail02 dovecot: lda: Debug: auth input: ahelmcke quota_rule=*:storage=2000M Apr 23 13:22:37 elablnmail02 dovecot: lda: Debug: Added userdb setting: plugin/quota_rule=*:storage=2000M Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Effective uid=494, gid=491, home=/home/mail/user/ahelmcke Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace inbox: type=private, prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=/home/mail/user/ahelmcke, alt= Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace dummy: type=private, prefix=, sep=/, inbox=no, hidden=yes, list=no, subscriptions=yes location=maildir:/home/mail/user/ahelmcke/public/ Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke/public, index=, control=, inbox=, alt= Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Debug: maildir++: root=/home/mail/user/ahelmcke, index=, control=, inbox=, alt= Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Error: user ahelmcke: Initialization failed: namespace configuration error: Duplicate namespace prefix: "" Apr 23 13:22:37 elablnmail02 dovecot: lda(ahelmcke): Fatal: Invalid user settings. Refer to server log for more information.
On 23.4.2012, at 14.40, Andreas Helmcke wrote:
Am 23.04.2012 12:59, schrieb Timo Sirainen:
On 19.4.2012, at 19.09, Andreas Helmcke wrote:
Apr 19 17:58:07 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes location=maildir:/home/mail/user/ahelmcke
But what is this? You appear to have an empty namespace {} in your configs?
nope.
You might check yourself; complete dovecot -n:
See if this changes the behavior:
service config { unix_listener config { mode = 0666 } }
I'd guess that makes the vmail work also? Although it still doesn't explain the difference between asking config from config process vs. getting it by executing doveconf.
Am 23.04.2012 13:55, schrieb Timo Sirainen:
See if this changes the behavior:
service config { unix_listener config { mode = 0666 } }
I'd guess that makes the vmail work also? Although it still doesn't explain the difference between asking config from config process vs. getting it by executing doveconf.
Yes, with this entry sending as user vmail is working.
Thanks.
Am 23.04.2012 14:02, schrieb Timo Sirainen:
On 23.4.2012, at 14.40, Andreas Helmcke wrote:
namespace Allgemeines {
Lowercase it: namespace allgemeines {
Did the trick, also. Sending as user vmail without the service config entry, which you recommended in the other mail, is working.
participants (2)
-
Andreas Helmcke
-
Timo Sirainen