[Dovecot] Variable %h not recognized in userdb_mail (passwd-file)
As in subject, if you for instance create a simple passwd-file with:
test@domain.tld:{plain}pass:20000:10::/home/regular/.test::userdb_mail=maildir:%h/maildir
Dovecot (rc23 & 27) will expand %h to empty string, and try to make a directory under /
Mar 14 14:25:28 rasengan dovecot: IMAP(test@domain.tld): mkdir(/maildir/cur) failed: Permission denied Mar 14 14:25:28 rasengan dovecot: IMAP(test@domain.tld): mkdir(/maildir/.Trash/cur) failed: Permission denied ...
If tilde is used instead of %h, the expansion works properly.
While checking it, I tested other variables (putting aside craziness of using some of them), so summing it up - h,w,i,a,b don't work, all the other ones do.
In case %h is not actually intended to work in passwd-files, some wiki examples would have to be adjusted.
On Wed, 2007-03-14 at 14:36 +0100, Michal Soltys wrote:
As in subject, if you for instance create a simple passwd-file with:
test@domain.tld:{plain}pass:20000:10::/home/regular/.test::userdb_mail=maildir:%h/maildir
Dovecot (rc23 & 27) will expand %h to empty string, and try to make a directory under /
Looks like the expansion was done too early. Fixed: http://dovecot.org/list/dovecot-cvs/2007-March/008128.html
Timo Sirainen wrote:
On Wed, 2007-03-14 at 14:36 +0100, Michal Soltys wrote:
As in subject, if you for instance create a simple passwd-file with:
test@domain.tld:{plain}pass:20000:10::/home/regular/.test::userdb_mail=maildir:%h/maildir
Dovecot (rc23 & 27) will expand %h to empty string, and try to make a directory under /
Looks like the expansion was done too early. Fixed: http://dovecot.org/list/dovecot-cvs/2007-March/008128.html
Now dovecot both expands %h and treats it literally, creating following directory: /home/regular/.test/%h/maildir
Assuming passwd-file as previously.
On Wed, 2007-03-14 at 15:31 +0100, Michal Soltys wrote:
Timo Sirainen wrote:
On Wed, 2007-03-14 at 14:36 +0100, Michal Soltys wrote:
As in subject, if you for instance create a simple passwd-file with:
test@domain.tld:{plain}pass:20000:10::/home/regular/.test::userdb_mail=maildir:%h/maildir
Dovecot (rc23 & 27) will expand %h to empty string, and try to make a directory under /
Looks like the expansion was done too early. Fixed: http://dovecot.org/list/dovecot-cvs/2007-March/008128.html
Now dovecot both expands %h and treats it literally, creating following directory: /home/regular/.test/%h/maildir
I'm not sure why it would do this. The dovecot master should expand the mail environment once more, so %h should have expanded. It also worked in my tests..
Anyway, after thinking about this for a while I think the change is wrong anyway, so I reverted it. I think the solution for now is just to not use %h, since dovecot-auth can't expand it and it's not that simple to add the code to do that.
Do you see %h elsewhere in Wiki than in MailLocation? I changed that now.
Timo Sirainen wrote:
On Wed, 2007-03-14 at 15:31 +0100, Michal Soltys wrote:
On Wed, 2007-03-14 at 14:36 +0100, Michal Soltys wrote:
As in subject, if you for instance create a simple passwd-file with:
test@domain.tld:{plain}pass:20000:10::/home/regular/.test::userdb_mail=maildir:%h/maildir
Dovecot (rc23 & 27) will expand %h to empty string, and try to make a directory under / Looks like the expansion was done too early. Fixed: http://dovecot.org/list/dovecot-cvs/2007-March/008128.html Now dovecot both expands %h and treats it literally, creating following
Timo Sirainen wrote: directory: /home/regular/.test/%h/maildir
I'm not sure why it would do this. The dovecot master should expand the mail environment once more, so %h should have expanded. It also worked in my tests..
Anyway, after thinking about this for a while I think the change is wrong anyway, so I reverted it. I think the solution for now is just to not use %h, since dovecot-auth can't expand it and it's not that simple to add the code to do that.
Do you see %h elsewhere in Wiki than in MailLocation? I changed that now.
Can't find it anywhere else.
Also, some small remark could be added in http://wiki.dovecot.org/AuthDatabase/PasswdFile and possibly in http://wiki.dovecot.org/MailLocation, that %h cannot be used in userdb_mail as in mail_location.
If %h could cause problems in other places (like ldap, sql,...), http://wiki.dovecot.org/Variables might need adjusting too.
participants (2)
-
Michal Soltys
-
Timo Sirainen