Andreas Helmcke
2012-Apr-19 14:56 UTC
[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, altApr 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=, altApr 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=, altApr 19 16:38:04 elablnmail02 dovecot: lda(ahelmcke): Debug: none: root=, index=, control=, inbox=, altApr 19 16:51:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Destination address: ahelmcke at elablnmail02.ela-bln.local (source: user at 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, altApr 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=, altApr 19 16:37:37 elablnmail02 dovecot: lda(ahelmcke): Debug: Namespace : type=private, prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes locationApr 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 = </etc/pki/dovecot/certs/mail.ela-soft.com.crt ssl_key = </etc/pki/dovecot/private/mail.ela-soft.com.2048bit.nopp.key userdb { args = /etc/dovecot/dovecot-ldap.conf driver = ldap } protocol lmtp { mail_plugins = " sieve" } Any ideas? Greetings Andreas
Timo Sirainen
2012-Apr-19 15:53 UTC
[Dovecot] error when using dovecot-lda as non root (vmail) user
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..
Andreas Helmcke
2012-Apr-19 16:09 UTC
[Dovecot] error when using dovecot-lda as non root (vmail) user
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/%uActually 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, altApr 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=, altApr 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=, altApr 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