hello,<br><br>i new to list but i need little help.<br>I need only imap (later pop3),i have own checkpassword and own user/password database.<br> i'm using last version v1.0.rc10<br> <br>But i have problem with auth, user is authorized but cannot login, here is log:
<br><br>dovecot: Oct 17 15:00:36 Info: Dovecot v1.0.rc10 starting up<br>dovecot: Oct 17 15:00:40 Info: auth(default): client in: AUTH 1 PLAIN service=IMAP lip=<a href="http://10.0.0.1">10.0.0.1</a> rip=<a href="http://10.0.0.13">
10.0.0.13</a> resp=AG1kdgBza29sYTY2Ng==<br>dovecot: Oct 17 15:00:40 Info: auth(default): checkpassword(lampa,<a href="http://10.0.0.13">10.0.0.13</a>): Executed: /usr/local/checklocalpwd/checkpassword.pl /usr/local/dovecot/bin/dovecot/checkpassword-reply
<br>dovecot: Oct 17 15:00:40 Info: auth(default): checkpassword(lampa,<a href="http://10.0.0.13">10.0.0.13</a>): Received input: userdb_user=lampa userdb_home=/home/_mail/lampa userdb_uid=65534 userdb_gid=65534
<br>dovecot: Oct 17 15:00:40 Info: auth(default): checkpassword(lampa,<a href="http://10.0.0.13">10.0.0.13</a>): Received no input<br>dovecot: Oct 17 15:00:40 Info: auth(default): checkpassword(lampa,<a href="http://10.0.0.13">
10.0.0.13</a>): exit_status=0<br>dovecot: Oct 17 15:00:40 Info: auth(default): client out: OK 1 user=lampa<br>dovecot: Oct 17 15:00:40 Info: auth(default): master in: REQUEST 1 17950 1<br>dovecot: Oct 17 15:00:40 Info: auth(default): master out: USER 1 lampa user=lampa home=/home/_mail/lampa uid=65534 gid=65534
<br>dovecot: Oct 17 15:00:40 Info: imap-login: Internal login failure: user=<lampa>, method=PLAIN, rip=<a href="http://10.0.0.13">10.0.0.13</a>, lip=<a href="http://10.0.0.1">10.0.0.1</a><br>dovecot: Oct 17 15:00:40 Error: Logins with UID 65534 (user lampa) not permitted (see first_valid_uid in config file)
<br><br>i think that problem is that uid and gid is set to user nobody instead 508 and 502 (user lampa , end of message is passwd file)<br><br>uid 65534 is user nobody (used in auth section in conf, if i set it to root everyhting is ok)
<br><br>this is my config: <br><br>base_dir = /var/run/dovecot/<br>protocols = imap<br>listen = <a href="http://10.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 10.0.0.1</a><br>disable_plaintext_auth = no
<br><br>log_path = /var/log/dovecot/dovecot.log<br>info_log_path = /var/log/dovecot/dovecot.info<br>log_timestamp = "%b %d %H:%M:%S "<br><br>ssl_disable = yes<br><br>login_dir = /var/run/dovecot/login <br>login_chroot = yes
<br>login_user = dovecot<br><br>mail_debug = yes<br>mail_log_prefix = "%Us(%u): "<br><br>verbose_proctitle = yes<br><br>first_valid_uid = 508<br>last_valid_uid = 508<br><br>first_valid_gid = 502 <br>last_valid_gid = 502
<br><br>protocol imap {<br> login_executable = /usr/local/dovecot/bin/imap-login<br> mail_executable = /usr/local/dovecot/bin/imap<br> }<br><br>auth_executable = /usr/local/dovecot/bin/dovecot-auth <br>auth_verbose = yes
<br>auth_debug = yes<br>auth_debug_passwords = yes<br><br>auth default {<br> mechanisms = plain<br> passdb checkpassword {<br> args = /usr/local/checklocalpwd/checkpassword.pl<br> }<br><br> userdb prefetch { <br> }
<br><br> user = nobody<br>}<br><br> in file i must comment out chdir $home (program was unable to chdir) i think due to chroot<br><br>/usr/local/checklocalpwd/checkpassword.pl:<br>#!/usr/bin/perl<br><br>use POSIX;<br>use strict qw(vars);
<br><br>my $PASSWD_FILE = "/usr/local/qmail/control/passwd2";<br><br>%ENV=();<br><br>my($len, $buf);<br>open (USER, "<&=3") || _exit(2);<br>$len = read(USER, $buf, 512);<br>close USER;<br>_exit(2) if $len < 4;
<br><br>my($user, $pass) = split /\x00/, $buf;<br>$user = lc $user;<br>$buf = "\x00" x $len;<br><br>my $cwd = getcwd;<br><br>my ($passwd, $uid, $gid, $gcos, $home, $shell) = "";<br><br>open F, $PASSWD_FILE || _exit(111);
<br><br>while (<F>) {<br> if (/^$user:/) {<br> ($user, $passwd, $uid, $gid, $gcos, $home, $shell) = split(/:/);<br> }<br>}<br><br>close F;<br><br>_exit(2) unless $uid;<br><br>if (crypt($pass, $passwd) ne $passwd) {
<br> _exit(1);<br>}<br><br>$ENV{USER} = $user;<br>$ENV{UID} = $uid + 0;<br>$ENV{HOME} = $home;<br>$ENV{SHELL} = $shell;<br><br>_exit(111) unless $ENV{UID};<br><br>#chdir $home || _exit(111);<br><br>$) = $gid;<br>$( = $gid;
<br>$> = $uid;<br>$< = $uid;<br><br>exec @ARGV;<br>_exit(0);<br><br>here is passwd/user file:<br>lampa:HSExFJNuwlKvk:508:502::/home/_mail/lampa:/bin/false<br>