Hi, all. I use dovecot-1.1.11 with OpenLDAP backend. but i found the mail_location is not correct. How can i override mail_location setting in dovecot.conf? LDAP user data and dovecot config are attached below. in dovecot config, mail_location is: ---- mail_location = maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/ ---- but the correct maildir should be 'homeDirectory' + 'mailMessageStore': ---- maildir:/home/vmail/a.cn/w/ww/www/ ---- LDAP user: ---- dn: mail=www at a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org objectClass: inetOrgPerson objectClass: mailUser objectClass: top cn: www sn: www uid: www mail: www at a.cn accountStatus: active homeDirectory: /home/vmail mailQuota: 104857600 userPassword: {SSHA}crkYO5tg8KRkOY7W3bRgjtLQ+79U4NgG enabledService: mail enabledService: smtp enabledService: pop3 enabledService: imap enabledService: deliver mailMessageStore: a.cn/w/ww/www/ ---- Dovecot ldap config file: ---- user_attrs = homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$ ---- Dovecot main config file: ---- # dovecot -n # 1.1.11: /etc/dovecot.conf # OS: Linux 2.6.18-128.el5 x86_64 Red Hat Enterprise Linux Server release 5.3 (Tikanga) log_path: /var/log/dovecot.log protocols: pop3 pop3s imap imaps listen: * ssl_cert_file: /etc/pki/iRedMail/SSL_Cert.pem ssl_key_file: /etc/pki/iRedMail/SSL_Key.pem login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login mail_uid: 500 mail_gid: 500 mail_location: maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/ mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota zlib mail_plugins(imap): quota imap_quota zlib mail_plugins(pop3): quota zlib mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh auth default: mechanisms: plain login default_realm: a.cn user: vmail passdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: ldap args: /etc/dovecot-ldap.conf socket: type: listen client: path: /var/spool/postfix/dovecot-auth mode: 438 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 438 user: vmail group: vmail plugin: quota: maildir quota_rule: *:storage=10M expire: Trash 7 Trash/* 7 Junk 30 expire_dict: proxy::expire auth_socket_path: /var/run/dovecot/auth-master sieve: /home/vmail/sieve/%Ld/%Ln/.dovecot.sieve dict: expire: db:/var/lib/dovecot/expire/expire.db ---- -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, 13 Mar 2009, Zhang Huangbin wrote:> I use dovecot-1.1.11 with OpenLDAP backend. but i found the > mail_location is not correct. How can i override mail_location setting > in dovecot.conf?> homeDirectory: /home/vmail > mailMessageStore: a.cn/w/ww/www/ > user_attrs = > homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$"mailMessageStore=maildir:mail" this looks odd. Try: mailMessageStore=mail Dovecot should detect Maildir vs. mbox itself by existance of cur subdir. But if relative paths work? As far as I know Dovecot cannot concat strings retrieved from a backend. A SQL-backend itself can do it and will pass the result back, but LDAP cannot. Depending on your user management it should be easier to add another LDAP attribute, say "mailDovecotLocation" with the prebuilt string, so you can add :INDEX, too. Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBSbpzanWSIuGy1ktrAQJWrgf/RK1FLtRil8kWqpax+RKk9goSTkJglapx V91bAaUSDnVSIz1nlDJNkYmhBeFkz7yLllRlpar6+QSZS2SjBfIjJMaRIdJdBtM3 zYXlXimyFoYkoptd0sBXpJKz6e79CE1urJSMUht7JY8esxsFtevEsYgOcBzHxOgV zW0OuB8oDDbZwgRv7/sraLY7enDx1cxFf0zq1WcCyexHxr+hZgyZEC+0s6jBSJMM QHDixP9yNqrfC2n1MdgNmVZFyWq//rsQS8w7YHc0gfN5XNSsLtCe5nkHWGmx5HMF Zi41LMYbzGvVaZ88tAj60guZzBSDhkHOCAaVEalXtBwt6gzbgwYthQ==b1Fu -----END PGP SIGNATURE-----
On Fri, 2009-03-13 at 22:17 +0800, Zhang Huangbin wrote:> homeDirectory: /home/vmailIs it always /home/vmail?> user_attrs = > homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$Maybe mailMessageStore=maildir:/home/vmail/%$ Also home directory should be different for each user, so you most likely don't want to set homeDirectory=home. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090313/92e5cf8c/attachment-0002.bin>
Timo Sirainen wrote:> On Fri, 2009-03-13 at 22:17 +0800, Zhang Huangbin wrote: > >> homeDirectory: /home/vmail >> > > Is it always /home/vmail? >Yes, homeDirectory is always /home/vmail.>> user_attrs = >> homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$ >> > > Maybe mailMessageStore=maildir:/home/vmail/%$ >I set it like this: ---- user_attrs = homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:/home/vmail/%$,mailQuota=quota_rule=*:bytes=%$ ---- It find the correct path, but deliver to path setting in mail_location: ---- deliver(www at a.cn): Mar 14 09:49:31 Info: auth input: home=/home/vmail deliver(www at a.cn): Mar 14 09:49:31 Info: auth input: quota_rule=*:bytes=104857600 deliver(www at a.cn): Mar 14 09:49:31 Info: auth input: maildir:/home/vmail/%$=/home/vmail/a.cn/w/ww/www/ deliver(www at a.cn): Mar 14 09:49:31 Info: auth input: sieve_dir=/home/vmail/sieve/a.cn/www/ deliver(www at a.cn): Mar 14 09:49:31 Info: Quota root: name= backend=maildir argsdeliver(www at a.cn): Mar 14 09:49:31 Info: Quota rule: root= mailbox=* bytes=104857600 messages=0 deliver(www at a.cn): Mar 14 09:49:31 Info: maildir: data=//home/vmail/a.cn/www/:INDEX=//home/vmail/a.cn/www/ deliver(www at a.cn): Mar 14 09:49:31 Info: maildir++: root=//home/vmail/a.cn/www, index=, control=, inbox=//home/vmail/a.cn/www deliver(www at a.cn): Mar 14 09:49:31 Info: cmusieve: Using sieve path: /home/vmail/sieve/a.cn/www/.dovecot.sieve deliver(www at a.cn): Mar 14 09:49:31 Info: cmusieve: Executing script /home/vmail/sieve/a.cn/www/.dovecot.sievec deliver(www at a.cn): Mar 14 09:49:31 Info: msgid=<49BB0D17.8070101 at a.cn>: saved mail to Junk ---- setting in dovecot.conf: ---- mail_location = maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/ ----> Also home directory should be different for each user, so you most > likely don't want to set homeDirectory=home. >I will try to change this, thanks Timo :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/
Timo Sirainen wrote:> On Fri, 2009-03-13 at 22:17 +0800, Zhang Huangbin wrote: > >> homeDirectory: /home/vmail >> > > Is it always /home/vmail? > > >> user_attrs = >> homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$ >> > > Maybe mailMessageStore=maildir:/home/vmail/%$ > > Also home directory should be different for each user, so you most > likely don't want to set homeDirectory=home. > >hi, Timo. Any suggestion about these LDAP attributes: homeDirectory mailMessageStore Both are absolute path? like /home/vmail/a.cn/w/ww/www/ or what? Need to add more attributes? How about mailbox INDEX? -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/
Reasonably Related Threads
- [Help] quota_rule with LDAP backend, dovecot-1.1.1
- (v1.1.6) Fatal: userdb didn't return a home directory, but mail location used it (%h)
- Error while set mailQuota=0 with mbox and LDAP backend
- trying to combine static userdb with LDAP passdb with per-user userdb_mail and userdb_home
- converting from maildir to mdbox ?