[Dovecot] Post-login script with LDAP virtual users
Dear sirs,
I'm working on Post-login script for migrating 40K Courier-imap users to Dovecot.
After reading related topics about post-login script in your documentation, mailing list, I cannot remove the problem described here-below. Is there any special config to add when users are virtual (authentication and user info is fed by LDAP server).
I would be grad if anyone could give me advise.
Phenomena:
Although the authentication and script execution is successfully done, Pop3 session is aborted just after that, leaving the following error message to syslog:
/var/log/maillog: Feb 7 17:45:58 pop3migr dovecot: pop3(vuser1): Post-login script denied access to user vuser1
cf. "vuser1" is UID of a virtual account on the LDAP tree. Maildir is located at /var/spool/postfixdata/%u/Maildir, and is owned by linux local user "mailuser".
Dovecot works perfect ,if post-login script configuration is commented out.
Environment:
Dovecot: dovecot-2.0.9 (built from source tar ball) OS: Linux / 2.6.30.10-105.2.23.fc11.x86_64 (Virtual machine on a xen server) Maidir: tested both with local file system and NFS (ext3, xfs) client: Using telnet on pop3 TCP port.
All the pop3 users are virtual and does not have local login account ('authentication and user information is given by LDAP server). SMTP service is managed by Postfix: ( A single local login account is writing all mails to Maildir for all the virtual users. )
Thanks in advance.
?/var/log/maillog: Feb 7 17:45:58 pop3migr dovecot: pop3(vuser1): Post-login script denied access to user vuser1
cf. "vuser1" is UID of a virtual account on the LDAP tree. Maildir is located at /var/spool/postfixdata/%u/Maildir, and is owned by linux local user "mailuser".
Surely the UID for vuser should be the same as the owner of the mailboxes. does the post-login do anything wierd? ぴ
わお。アキバまで歩く事できますよね。
Dear Peter,
I myself had thought that it might be related to user ownership or permission issue, but it has turned out to be due to omission of ' exec "$@" ' in the script. Thanks for your taking care of this matter.
P.S. 16-17min by foot from Yodobashi@Akihabara
(2011/02/07 20:14), Peter Evans wrote:
?/var/log/maillog: Feb 7 17:45:58 pop3migr dovecot: pop3(vuser1): Post-login script denied access to user vuser1
cf. "vuser1" is UID of a virtual account on the LDAP tree. Maildir is located at /var/spool/postfixdata/%u/Maildir, and is owned by linux local user "mailuser".
Surely the UID for vuser should be the same as the owner of the mailboxes. does the post-login do anything wierd?
ぴ
わお。アキバまで歩く事できますよね。
(2011/02/07 20:44), Timo Sirainen wrote:
On 7.2.2011, at 12.24, Hideo GOTO wrote:
/var/log/maillog: Feb 7 17:45:58 pop3migr dovecot: pop3(vuser1): Post-login script denied access to user vuser1 The script finish isn't being done properly. I guess you're missing the exec "$@" line?
Thanks a lot Timo for your prompt reply, which solved my problem! Indeed, I had omitted exec "$@", where script-login was not executed.
Hideo GOTO
Hideo GOTO <gotoh <at> eis.co.jp> writes:
(2011/02/07 20:44), Timo Sirainen wrote:
On 7.2.2011, at 12.24, Hideo GOTO wrote:
/var/log/maillog: Feb 7 17:45:58 pop3migr dovecot: pop3(vuser1): Post-login script denied access to user vuser1 The script finish isn't being done properly. I guess you're missing the exec
"$@" line?
Thanks a lot Timo for your prompt reply, which solved my problem! Indeed, I had omitted exec "$@", where script-login was not executed.
Hideo GOTO
Hello,
Sorry for "stealing" your thread but I'm experiencing some problems similar to yours. I need a custom post-login, which is written in perl language. This script was working fine with "dovecot 1.0-test59". Now I updated to "dovecot 2.0.12" and it stopped working, it gives me the following error in my dovecot.log: "imap(myuser01): Info: Post-login script denied access to user myuser01" Through some debugging I realized that is the "exec $@" that's not working has intended, so I've created two script, one written in bash and another in perl.
Bash Script: #!/bin/sh exec "$@"
Perl Script #!/usr/bin/perl -w exec('"$@"');
The thing is, the Bash script works and the Perl one doesn't, it comes the error stated above... I think the problem could be from perl, for forking the process, but still I can't figure it out.
Any ideas?
Thanks, Fernando
participants (4)
-
Fernando Silva
-
Hideo GOTO
-
Peter Evans
-
Timo Sirainen