[Dovecot] Problem with default_mail_env in beta9
Hallo,
I am playing arround with dovecot I hat version 1.0.beta7 running fine. After installing beta9 there is a problem with default_mail_env setting.
I have all users in ldap. there is an attribute "mailMessageStore" which contains a relative path to users maildir mailMessageStore: sca/
my mailer completes this relative pathinformation to /var/mail/sca/
therefor I setup default_mail_env to "maildir:/var/mail/%h" dovecot-ldap.conf includes "user_attrs = mailMessageStore=home,uidNumber=uid,gidNumber=gid"
all fine in beta7
in beta9 I got this in my log: dovecot: Jun 16 14:50:22 Info: Dovecot v1.0.beta9 starting up dovecot: Jun 16 14:50:30 Info: auth(default): client in: AUTH 1 PLAIN service=POP3 lip=127.0.0.1 rip=127.0.0.1 resp=random dovecot: Jun 16 14:50:30 Info: auth(default): ldap(sca,127.0.0.1): bind search: base=o=datev,c=de filter=(uid=sca) dovecot: Jun 16 14:50:30 Info: auth(default): client out: OK 1 user=sca dovecot: Jun 16 14:50:30 Info: auth(default): master in: REQUEST 1 30400 1 dovecot: Jun 16 14:50:30 Info: auth(default): ldap(sca,127.0.0.1): base=o=datev,c=de scope=subtree filter=(uid=sca) fields=mailMessageStore,uidNumber,gidNumber dovecot: Jun 16 14:50:30 Info: auth(default): master out: USER 1 t02985a home=sca/ uid=30014 gid=30007 dovecot: Jun 16 14:50:30 Info: pop3-login: Login: user=<sca>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1 dovecot: Jun 16 14:50:30 Error: POP3(sca): dovecot: Jun 16 14:50:30 Fatal: chdir(sca/) failed with uid 30014: Permission denied dovecot: Jun 16 14:50:30 Error: child 30407 (pop3) returned error 89
If I change user_attrs to "user_attrs = mailMessageStore=FOO,uidNumber=uid,gidNumber=gid" I got dovecot: Jun 16 14:54:36 Info: Dovecot v1.0.beta9 starting up dovecot: Jun 16 14:54:41 Info: auth(default): client in: AUTH 1 PLAIN service=POP3 lip=127.0.0.1 rip=127.0.0.1 resp=random dovecot: Jun 16 14:54:41 Info: auth(default): ldap(sca,127.0.0.1): bind search: base=o=datev,c=de filter=(uid=sca) dovecot: Jun 16 14:54:41 Info: auth(default): client out: OK 1 user=sca dovecot: Jun 16 14:54:41 Info: auth(default): master in: REQUEST 1 30475 1 dovecot: Jun 16 14:54:41 Info: auth(default): ldap(sca,127.0.0.1): base=o=datev,c=de scope=subtree filter=(uid=sca) fields=mailmessagestore,uidNumber,gidNumber dovecot: Jun 16 14:54:41 Info: auth(default): master out: USER 1 sca uid=30014 gid=30007 dovecot: Jun 16 14:54:41 Info: pop3-login: Login: user=<sca>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1 dovecot: Jun 16 14:54:41 Info: POP3(sca): Effective uid=30014, gid=30007 dovecot: Jun 16 14:54:41 Info: POP3(sca): maildir: data=/var/mail//HOME_DIRECTORY_USED_BUT_NOT_GIVEN_BY_USERDB dovecot: Jun 16 14:54:41 Info: POP3(sca): maildir: root=/var/mail//HOME_DIRECTORY_USED_BUT_NOT_GIVEN_BY_USERDB, index=/var/mail//HOME_DIRECTORY_USED_BUT_NOT_GIVEN_BY_USERDB, control=, inbox=
this inicates to me, that
- homedirvariable is unset OK, because I assigned mailMessageStore to local FOO
- default_mail_env is correct evaluated to maildir:/var/mail/%h
Question: Why is default_mail_env not correct evalueted to maildir:/var/mail/sca/ if sca/ is set as homedir ?
As mentions above, this worked fine with beta7 ...
What do I wrong ??? My I provide more Informations ?
-- Andreas Schulze
DATEV eG, Paumgartner Strasse 6-14, D - 90429 Nürnberg Abt. Internet- und Securitydienste Telefon : +49 911 276 2648 Telefax : +49 911 276 7892 Mobil : +49 172 8122883 E-Mail : andreas.schulze_at_datev.de
On Fri, 2006-06-16 at 15:00 +0200, Andreas Schulze wrote:
I have all users in ldap. there is an attribute "mailMessageStore" which contains a relative path to users maildir mailMessageStore: sca/
my mailer completes this relative pathinformation to /var/mail/sca/
therefor I setup default_mail_env to "maildir:/var/mail/%h" dovecot-ldap.conf includes "user_attrs = mailMessageStore=home,uidNumber=uid,gidNumber=gid" .. dovecot: Jun 16 14:50:30 Error: POP3(sca): dovecot: Jun 16 14:50:30 Fatal: chdir(sca/) failed with uid 30014: Permission denied
Dovecot tries to chdir() to the home directory before starting up the pop3 process, and since the default startup directory is /var/run/dovecot, it tried to chdir() under it. I've no idea why it happened to be working for you with beta7. Maybe I added some extra check which broke it for you.
One easy way to fix this would be to just comment out the chdir() call from src/master/mail-process.c. The proper way would be to make the home directory be an absolute path.
Perhaps the LDAP code needs a bit more changing so that you can use the values received from LDAP in a template for Dovecot's settings. Something like:
user_attrs = mailMessageStore=home=/var/mail/%1,uidNumber=uid,gidNumber=gid
BTW. This would break that other guy's quota configuration who I just recently replied to that I wouldn't be breaking it.. :)
On Sun, Jun 18, Timo Sirainen wrote:
On Fri, 2006-06-16 at 15:00 +0200, Andreas Schulze wrote:
I have all users in ldap. there is an attribute "mailMessageStore" which contains a relative path to users maildir mailMessageStore: sca/
my mailer completes this relative pathinformation to /var/mail/sca/
therefor I setup default_mail_env to "maildir:/var/mail/%h" dovecot-ldap.conf includes "user_attrs = mailMessageStore=home,uidNumber=uid,gidNumber=gid" .. dovecot: Jun 16 14:50:30 Error: POP3(sca): dovecot: Jun 16 14:50:30 Fatal: chdir(sca/) failed with uid 30014: Permission denied
Dovecot tries to chdir() to the home directory before starting up the pop3 process, and since the default startup directory is /var/run/dovecot, it tried to chdir() under it. I've no idea why it happened to be working for you with beta7. Maybe I added some extra check which broke it for you.
One easy way to fix this would be to just comment out the chdir() call from src/master/mail-process.c. The proper way would be to make the home directory be an absolute path. this hack works for me ...
Perhaps the LDAP code needs a bit more changing so that you can use the values received from LDAP in a template for Dovecot's settings. Something like:
user_attrs = mailMessageStore=home=/var/mail/%1,uidNumber=uid,gidNumber=gid
BTW. This would break that other guy's quota configuration who I just recently replied to that I wouldn't be breaking it.. :)
-- Andreas Schulze
DATEV eG, Paumgartner Strasse 6-14, D - 90429 Nürnberg Abt. Internet- und Securitydienste Telefon : +49 911 276 2648 Telefax : +49 911 276 7892 Mobil : +49 172 8122883 E-Mail : andreas.schulze_at_datev.de
On Mon, Jun 19, Andreas Schulze wrote:
On Sun, Jun 18, Timo Sirainen wrote:
On Fri, 2006-06-16 at 15:00 +0200, Andreas Schulze wrote:
I have all users in ldap. there is an attribute "mailMessageStore" which contains a relative path to users maildir mailMessageStore: sca/
my mailer completes this relative pathinformation to /var/mail/sca/
therefor I setup default_mail_env to "maildir:/var/mail/%h" dovecot-ldap.conf includes "user_attrs = mailMessageStore=home,uidNumber=uid,gidNumber=gid" .. dovecot: Jun 16 14:50:30 Error: POP3(sca): dovecot: Jun 16 14:50:30 Fatal: chdir(sca/) failed with uid 30014: Permission denied
Dovecot tries to chdir() to the home directory before starting up the pop3 process, and since the default startup directory is /var/run/dovecot, it tried to chdir() under it. I've no idea why it happened to be working for you with beta7. Maybe I added some extra check which broke it for you.
One easy way to fix this would be to just comment out the chdir() call from src/master/mail-process.c. The proper way would be to make the home directory be an absolute path. this hack works for me ... My problem where relative paths in mailmessagestore Dovecot works fine without the hack, if I chdir to /var/mail _before_ starting dovecot ...
Perhaps the LDAP code needs a bit more changing so that you can use the values received from LDAP in a template for Dovecot's settings. Something like:
user_attrs = mailMessageStore=home=/var/mail/%1,uidNumber=uid,gidNumber=gid
BTW. This would break that other guy's quota configuration who I just recently replied to that I wouldn't be breaking it.. :)
-- Andreas Schulze
DATEV eG, Paumgartner Strasse 6-14, D - 90429 Nürnberg Abt. Internet- und Securitydienste Telefon : +49 911 276 2648 Telefax : +49 911 276 7892 Mobil : +49 172 8122883 E-Mail : andreas.schulze_at_datev.de
-- Andreas Schulze
DATEV eG, Paumgartner Strasse 6-14, D - 90429 Nürnberg Abt. Internet- und Securitydienste Telefon : +49 911 276 2648 Telefax : +49 911 276 7892 Mobil : +49 172 8122883 E-Mail : andreas.schulze_at_datev.de
participants (2)
-
Andreas Schulze
-
Timo Sirainen