Claudio Tassini
2009-Aug-27 13:41 UTC
[Dovecot] missing .dovecot.lda-dupes file in LDAP/virtual user environment
Hi, I'm running a postfix/dovecot/ldap setup and it works quite fine. I am now trying to setup a global sieve script to forward all incoming mails to a local user for vacation management (gnarwl). I can't user the vacation extension of the sieve script itself because it is not configurable enough (each user has his vacation message and status stored in LDAP). The problem is that when deliver runs the sieve script, it tries to create the .dovecot.lda-dupes inside the user homedir, even if I didn't use the vacation feature in the script. This is the error I get: Aug 27 15:19:23 myhostname deliver(user1 at mydomain.it): file_dotlock_create( mydomain.it/1/user1 at mydomain.it/Maildir/.dovecot.lda-dupes) failed: No such file or directory Important sections from config: master.cf deliver: dovecot unix - n n - - pipe flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} dovecot -n extract: mail_location: maildir:/maildirs/%h auth default: passdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf userdb: driver: passwd userdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf plugin: quota: maildir:User Quota acl: vfile:/etc/dovecot/acls sieve_global_path: /etc/dovecot/default.sieve and extract from dovecot-ldap.conf : user_attrs = mailMessageStore=home,maildirquota=quota_rule=*:backend=%$ user_filter = (&(|(mail=%u at mydomain.it )(mail=%u)(mailalternateaddress=%u)(mailequivalentaddress=%u))(objectclass=mailrecipient)(imap-status=true)) pass_attrs mail=user,userPassword=password,mailMessageStore=userdb_home,mailquota=userdb_quota_rule=*:backend=%$ pass_filter = (&(|(mail=%u at mydomain.it )(mail=%u)(mailalternateaddress=%u)(mailequivalentaddress=%u))(objectclass=mailrecipient)(imap-status=true)) The global sieve script: require ["copy"]; if not address :is "to" "gnarwl at localhost" { redirect :copy "gnarwl at localhost"; } The format of the "home" userdb extra field as returned from the ldap is " mydomain.it/1/user1 at mydomain.it/Maildir/" . This value is normally appended to the mail_location global parameter ( /maildirs ) to build a path of the form "/maildirs/mydomain.it/1/user1 at mydomain.it/Maildir" . This works flawlessly when delivering mail, but seems that the sieve plugin ignores the "mail_location" and tries to write the dupes file in the home as it is returned from the ldap. Questions are: 1) Is it normal that lda tries to create the dupes file even if I am not using the vacation extension at all? 2) How can I tell LDA/sieve/whatever to prepend the mail_location to the home directory of the user for proper creation of the file? Many thanks in advance. -- Claudio Tassini
Timo Sirainen
2009-Aug-27 13:58 UTC
[Dovecot] missing .dovecot.lda-dupes file in LDAP/virtual user environment
On Thu, 2009-08-27 at 15:41 +0200, Claudio Tassini wrote:> dovecot -n extract: > mail_location: maildir:/maildirs/%hDon't do this. v1.2+ no longer even allows it. Rather use: mail_location = maildir:%h> user_attrs = mailMessageStore=home,maildirquota=quota_rule=*:backend=%$user_attrs = mailMessageStore=home=/maildirs/%$, ... And preferably the home wouldn't even contain the Maildir/ part, so that you'd have a separate home directory and mail_location = maildir:%h/Maildir -------------- 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/20090827/b4302811/attachment-0002.bin>
Claudio Tassini
2009-Aug-27 14:20 UTC
[Dovecot] missing .dovecot.lda-dupes file in LDAP/virtual user environment
Hi Timo, thank you for the quick reply.> mail_location: maildir:/maildirs/%h > > Don't do this. v1.2+ no longer even allows it. Rather use: > > mail_location = maildir:%hI used that for backward compatibility with our old mail system. I didn't know this was deprecated.> > user_attrs = mailMessageStore=home,maildirquota=quota_rule=*:backend=%$ > > user_attrs = mailMessageStore=home=/maildirs/%$, ...I'm going to try this..> And preferably the home wouldn't even contain the Maildir/ part, so that > you'd have a separate home directory and > > mail_location = maildir:%h/MaildirI understand that, but in my environment the "posix" home directory is stored in another ldap attribute and its structure is completely separated from the "maildir", something like: user1 home directory: /users/home/user1 (this resides on a shared NAS ) user1 maildir: /somepath/maildirs/domain/partitionnumber/username/Maildir (this is a local crypted filesystem with restricted access and a structure I need to migrate from another system ) Unfortunately I have to maintain this behavior by now.. -- Claudio Tassini