[Dovecot] When dovecot delivery, nested maildir (<user>/maildir/maildir) is "auto"created
Scenario: Sogo/Mysql+Postfix+Dovecot(only IMAP)+LDAP (Active Directory)
To make clean the understand of my issue I've performed those step go to /var/vmail/utente2 and perform in this directory "rm -rf *"
After I send email to utente2 via "telenet localhost 25"
I return to /var/vmail/utente2 and perform "ls -la" that shows me: maildir |-maildir |-cur |-new |-tmp
but the expected results was |-maildir |-cur |-new |-tmp
the relevant part of telnet session is: Mar 05 19:53:17 auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth Mar 05 19:53:17 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libauthdb_ldap.so Mar 05 19:53:17 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so Mar 05 19:53:17 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libmech_gssapi.so Mar 05 19:53:17 auth: Debug: auth client connected (pid=3286) Mar 05 19:54:35 auth: Debug: master in: USER 1 utente2/maildir/@domain.local service=lda Mar 05 19:54:35 auth: Debug: master out: USER 1 utente2/maildir/@domain.local uid=500 gid=500 home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda: Debug: auth input: utente2/maildir/@domain.local uid=500 gid=500 home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: Effective uid=500, gid=500, home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: Home dir not found: /var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: maildir++: root=/var/vmail/utente2/maildir//maildir, index=, control=, inbox=/var/vmail/utente2/maildir//maildir Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: none: root=, index=, control=, inbox= Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Info: msgid=<20130305185423.6E56B407B6@posta.domain.local>: saved mail to INBOX
NB: note the wrong path of inbox inbox=/var/vmail/utente2/maildir//maildir
From SOGO when I login the "autocreate" work well: in root folder of "utente2" I can see |-maildir |-cur |-new |-tmp
But if I send email from SOGO frontend, same error of "telnetting" *What is wrong in my config?*
dovecot -n # 2.0.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-279.el6.x86_64 x86_64 CentOS release 6.3 (Final) ext4 auth_debug = yes auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@/ auth_username_format = %Lu first_valid_gid = 500 last_valid_gid = 500 last_valid_uid = 500 log_path = /var/log/dovecot mail_debug = yes mail_location = maildir:/var/vmail/%n/maildir mbox_write_locks = fcntl passdb { driver = pam } postmaster_address = administrator@domain.local protocols = imap service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } unix_listener auth-userdb { group = vmail mode = 0600 user = vmail } } ssl = no ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { args = uid=500 gid=500 home=/var/vmail/%Lu allow_all_users=yes driver = static } valid_chroot_dirs = /var/vmail
/etc/postfix/master.cf (relevant) # Dovecot LDA dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
/etc/postfix/ldap-groups.cf server_host = domain.local search_base = CN=users,DC=domain,DC=local
bind = yes bind_dn = query@domain.local bind_pw = **********
query_filter = (&(objectclass=group) (mail=%s)) leaf_result_attribute = mail special_result_attribute = member version = 3
--
*Nunzio Falcone* nunzio.falcone@gmail.com
*Cell * +39 320 1167923 *Voip*+39 081 0117933 *Fax * +39 081 0113049
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 7 Mar 2013, Nunzio Falcone wrote:
After I send email to utente2 via "telenet localhost 25"
I return to /var/vmail/utente2 and perform "ls -la" that shows me: maildir |-maildir |-cur |-new |-tmp
but the expected results was |-maildir |-cur |-new |-tmp
Mar 05 19:54:35 auth: Debug: master in: USER 1 utente2/maildir/@domain.local service=lda Mar 05 19:54:35 auth: Debug: master out: USER 1 utente2/maildir/@domain.local uid=500 gid=500 home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda: Debug: auth input: utente2/maildir/@domain.local uid=500 gid=500 home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: Effective uid=500, gid=500, home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: Home dir not found: /var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: maildir++: root=/var/vmail/utente2/maildir//maildir, index=, control=, inbox=/var/vmail/utente2/maildir//maildir
When I interprete lines 1 and 2 correctly, you pass "utente2/maildir/@domain.local" as username to Dovecot. Line 3 evaluates your homedir using "%Lu" correctly, 6th line is using "%n" variable, which resembles to "utente2/maildir/"; there you get the double "maildir//maildir" - note the double /, too, one from the username, one from the mail_location pattern.
For some reason, I do not know, you allow "/" in usernames, hence, they gets passed to the path of homedir and mail location.
The only question now is, do you really send the message to: utente2/maildir/@domain.local
or does Postfix mangles the recipient in some way?
Via SoGo you do logon with utente2 instead of "utente2/maildir/@domain.local", hence, there is just one "maildir" autocreated, because "%n" is substituted by "utente2" instead of "utente2/maildir/".
From SOGO when I login the "autocreate" work well: in root folder of "utente2" I can see |-maildir |-cur |-new |-tmp
mail_location = maildir:/var/vmail/%n/maildir userdb { args = uid=500 gid=500 home=/var/vmail/%Lu allow_all_users=yes
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUTiZW13r2wJMiz2NAQLdYwgAkNu9/d2P0EKvi5PnygDRQaT30I4hbfTg lPfHuO3Zl+B3d87VjOwMC1cq240YHjQoOTQhOBaiCFy1FnlPy5sH8ocPeqZLvTYb 4R27oTt9/o4i+mhGKwzDTYZ69qDdCEzZ+vUYbcrlyU2DAvnj+oo3pEgYDd6acFDf hDxqJssg6mv0xfk/F6jXjLGXOQ7wEjf4UixW/hQReSPaTzDZE5ZhOJ5938tjYE5s tHIzioszyyxPwlaK/3U7HC40W6ixzmcbO7qH4NLs4OiZqCJhytSs3lqlemb9eznL 35pw/8L8U0T2zCnmuHL8gtDAmt2SeDhMqmOxjkxOCd0t1V71Z5uvpA== =9Nai -----END PGP SIGNATURE-----
Il 07/03/2013 14:42, Steffen Kaiser ha scritto:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 7 Mar 2013, Nunzio Falcone wrote:
After I send email to utente2 via "telenet localhost 25"
I return to /var/vmail/utente2 and perform "ls -la" that shows me: maildir |-maildir |-cur |-new |-tmp
but the expected results was |-maildir |-cur |-new |-tmp
Mar 05 19:54:35 auth: Debug: master in: USER 1 utente2/maildir/@domain.local service=lda Mar 05 19:54:35 auth: Debug: master out: USER 1 utente2/maildir/@domain.local uid=500 gid=500 home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda: Debug: auth input: utente2/maildir/@domain.local uid=500 gid=500 home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: Effective uid=500, gid=500, home=/var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: Home dir not found: /var/vmail/utente2/maildir/@domain.local Mar 05 19:54:35 lda(utente2/maildir/@domain.local): Debug: maildir++: root=/var/vmail/utente2/maildir//maildir, index=, control=, inbox=/var/vmail/utente2/maildir//maildir
When I interprete lines 1 and 2 correctly, you pass "utente2/maildir/@domain.local" as username to Dovecot. Line 3 evaluates your homedir using "%Lu" correctly, 6th line is using "%n" variable, which resembles to "utente2/maildir/"; there you get the double "maildir//maildir" - note the double /, too, one from the username, one from the mail_location pattern.
For some reason, I do not know, you allow "/" in usernames, hence, they gets passed to the path of homedir and mail location.
The only question now is, do you really send the message to: utente2/maildir/@domain.local
or does Postfix mangles the recipient in some way?
i've performed those task
set /etc/dovecot/conf.d/10-auth.conf # modifiche dovecot+postfix+ad #auth_username_format = %Lu *auth_username_format = %n* auth_debug = yes ssl = no first_valid_uid = 500 last_valid_uid = 500 first_valid_gid = 500 last_valid_gid = 500
and execute the following telnet session [root@posta ~]# telnet localhost 25 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 posta.domain.local ESMTP Postfix HELO domain.local 250 posta.domain.local mail from:domain@domain.local 250 2.1.0 Ok rcpt to:utente2 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> blabla . 250 2.0.0 Ok: queued as EF9CE406F9
note the use of login (only "utente2)
this is the debug session Mar 07 23:06:15 auth: Debug: master in: USER 1 utente2/maildir/@domain.local service=lda Mar 07 23:06:15 auth: Debug: master out: USER 1 utente2/maildir/ uid=500 gid=500 home=/var/vmail/utente2/maildir/ Mar 07 23:06:15 lda: Debug: auth input: utente2/maildir/ uid=500 gid=500 home=/var/vmail/utente2/maildir/ Mar 07 23:06:15 lda: Debug: changed username to utente2/maildir/ Mar 07 23:06:15 lda(utente2/maildir/): Debug: Effective uid=500, gid=500, home=/var/vmail/utente2/maildir/ Mar 07 23:06:15 lda(utente2/maildir/): Debug: Home dir not found: /var/vmail/utente2/maildir/ Mar 07 23:06:15 lda(utente2/maildir/): Debug: maildir++: root=/var/vmail/utente2/maildir//maildir, index=, control=, inbox=/var/vmail/utente2/maildir//maildir Mar 07 23:06:15 lda(utente2/maildir/): Debug: Namespace : Permission lookup failed from /var/vmail/utente2/maildir//maildir Mar 07 23:06:15 lda(utente2/maildir/): Debug: Namespace : Using permissions from /var/vmail/utente2/maildir//maildir: mode=0700 gid=-1 Mar 07 23:06:15 lda(utente2/maildir/): Debug: none: root=, index=, control=, inbox= Mar 07 23:06:15 lda(utente2/maildir/): Info: msgid=<20130307220609.EF9CE406F9@posta.domain.local>: saved mail to INBOX
but the result is the same maildir |-maildir |-cur |-new |-tmp
this is my first insallation so any help is appreciated
--
*Nunzio Falcone* nunzio.falcone@gmail.com
*Cell * +39 320 1167923 *Voip*+39 081 0117933 *Fax * +39 081 0113049
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 7 Mar 2013, Nunzio Falcone wrote:
and execute the following telnet session [root@posta ~]# telnet localhost 25 Trying 127.0.0.1... 220 posta.domain.local ESMTP Postfix
rcpt to:utente2 250 2.1.5 Ok
note the use of login (only "utente2)
this is the debug session Mar 07 23:06:15 auth: Debug: master in: USER 1 utente2/maildir/@domain.local service=lda Mar 07 23:06:15 auth: Debug: master out: USER 1 utente2/maildir/ uid=500 gid=500 home=/var/vmail/utente2/maildir/
Hmm, utente2 became utente2/maildir/@domain.local again. I have no experience with postfix, so I would first make sure, postfix passes the correct values to the Dovecot LDA, by:
create wrapper script: ===== START #!/bin/bash
( date echo arguments "$@" id /usr/libexec/dovecot/deliver "$@" rc=$? echo rc=$rc exit $rc ) >> /tmp/dovecot-lda-wrapper.$$.log 2>&1 ==== END
/etc/postfix/master.cf (relevant) # Dovecot LDA dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/path/to/wrapper -f ${sender} -d ${recipient}
see changed argv= argument.
Then check the created log files in /tmp, if the argument of "-d" does or does not contain the "/maildir/" part.
If it does, you will have to check your postfix installation, when the recipient string gets changed. Maybe your postfix was configured to deliver to Maildirs directly before and therefore at some point the "/maildir/" is added.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUTmk9F3r2wJMiz2NAQLpWwgAsg6f+nIjmOmeBsfK9kAwUhkAgOO7HtKu jmiaqY5DxDo9GRp+8X62y3kBGvVtrKCbJcoRqW4wlBwYvJaBbZqAZU2NS0q3QVV0 Dz63/DjSQsj+eQcMWnuX2Ci0D9JlC/UDA8FD+c2Os86LwIz0zBGET2sdqkUHqYxv wm6YwK7CBRzlmF98hRHMcj3bnZSpXWDx8+1nygoylUdwzV4rwcflWJ67jnGTs58+ RJfsiVnAzdlWzrwEjwlswOClM5mmRlwU5MVHfOczZMO9Z/XmHXxrISCx9pFKrwjT +X++0MDEerEqLuc+S8vrobe8XeTlvHzWmdpqd6F6RiEncGuy/21IRg== =y3pK -----END PGP SIGNATURE-----
#!/bin/bash
( date echo arguments "$@" id /usr/libexec/dovecot/deliver "$@" rc=$? echo rc=$rc exit $rc ) >> /tmp/dovecot-lda-wrapper.$$.log 2>&1
Il 08/03/2013 09:44, Steffen Kaiser ha scritto: this is output Fri Mar 8 16:39:00 CET 2013 arguments -f domain@domain.local -d utente2/maildir/@nolanitalia.local uid=500(vmail) gid=500(vmail) groups=500(vmail) rc=0
the -d argument contains "/maildir"!!!
what do you think of this? what postfix config to check?
Thanx
--
*Nunzio Falcone* nunzio.falcone@gmail.com
*Cell * +39 320 1167923 *Voip*+39 081 0117933 *Fax * +39 081 0113049
Il 08/03/2013 16:58, Nunzio Falcone ha scritto:
#!/bin/bash
( date echo arguments "$@" id /usr/libexec/dovecot/deliver "$@" rc=$? echo rc=$rc exit $rc ) >> /tmp/dovecot-lda-wrapper.$$.log 2>&1
Il 08/03/2013 09:44, Steffen Kaiser ha scritto: this is output Fri Mar 8 16:39:00 CET 2013 arguments -f domain@domain.local -d utente2/maildir/@nolanitalia.local uid=500(vmail) gid=500(vmail) groups=500(vmail) rc=0
the -d argument contains "/maildir"!!!
what do you think of this? what postfix config to check?
*SOLVED* modifyng /etc/postfix/ldap-users.cf (relevant)
from query_filter = (&(objectclass=person) (mail=%s)) result_attribute = sAMAccountName version = 3 result_format=%s/Maildir/
to query_filter = (&(objectclass=person) (mail=%s)) result_attribute = sAMAccountName version = 3 *result_format=%s*
ThankU for your support
--
*Nunzio Falcone* nunzio.falcone@gmail.com
*Cell * +39 320 1167923 *Voip*+39 081 0117933 *Fax * +39 081 0113049
participants (2)
-
Nunzio Falcone
-
Steffen Kaiser