[Dovecot] Question about "reply from worker without password scheme"
I have dovecot-1.0-test64 installed on OpenBSD-3.6. It works fine with local password.
Now I fail to get dovecot to use MySQL to query for user details. Any help would be very appreciated.
Here are the details:
from /var/log/maillog:
with "default_pass_scheme = PLAIN"
Apr 3 07:20:22 www dovecot: Dovecot v1.0-test64 starting up Apr 3 07:20:23 www dovecot: auth(default): mysql: Connected to (null) (dovecot) Apr 3 07:20:23 www dovecot: auth-worker(default): mysql: Connected to (null) (dovecot) Apr 3 07:20:50 www dovecot: auth(default): client in: AUTH 1 PLAIN service=IMAP secured lip=1.2.3.4 rip=5.6.7.8 resp=AGhhemVsQGhhemVscGhhbS5jb20AemhAMTlTQXZl Apr 3 07:20:50 www dovecot: auth-worker(default): sql(client@clientdomain.com,5.6.7.8): query: SELECT pass AS password FROM user WHERE user = 'client@clientdomain.com' Apr 3 07:20:50 www dovecot: auth(default): blocking(client@clientdomain.com,5.6.7.8): Received reply from worker without password scheme Apr 3 07:20:51 www dovecot: auth(default): client out: FAIL 1 user=client@clientdomain.com temp Apr 3 07:21:50 www dovecot: imap-login: Disconnected: Inactivity [5.6.7.8]
with "default_pass_scheme = PLAIN-MD5" Apr 3 07:07:13 www dovecot: Dovecot v1.0-test64 starting up Apr 3 07:07:14 www dovecot: auth(default): mysql: Connected to (null) (dovecot) Apr 3 07:07:14 www dovecot: auth-worker(default): mysql: Connected to (null) (dovecot) Apr 3 07:07:47 www dovecot: auth(default): client in: AUTH 1 PLAIN service=IMAP se cured lip=1.2.3.4 rip=5.6.7.8 resp=AGhhemVsQGhhemVscGhhbS5jb20AemhAMTlTQXZl Apr 3 07:07:47 www dovecot: auth-worker(default): sql(client@clientdomain.com,5.6.7.8): query: SELECT pass AS password FROM user WHERE user = 'client@clientdomain.com' Apr 3 07:07:48 www dovecot: auth(default): client out: FAIL 1 user=client@clientdomain.com
Command to start dovecot: /usr/local/dovecot/sbin/dovecot -c /usr/local/dovecot/etc/dovecot.conf
Part of /usr/local/dovecot/etc/dovecot.conf: .... disable_plaintext_auth = no ....
# SQL database passdb sql { # Path for SQL configuration file, see doc/dovecot-sql.conf for # example args = /usr/local/dovecot/etc/dovecot-mysql.conf } ....
# SQL database userdb sql { # Path for SQL configuration file, see doc/dovecot-sql.conf for # example args = /usr/local/dovecot/etc/dovecot-mysql.conf } ....
I also tried with "disable_plaintext_auth = yes" without any luck.
/usr/local/dovecot-1.0-test64/etc/dovecot-mysql.conf: driver = mysql connect = host=/var/www/dovecot/mysql.sock dbname=dovecot user=dovecot password=secretpwDB default_pass_scheme = PLAIN password_query = SELECT pass AS password FROM user WHERE user = '%u' user_query = SELECT maildir AS mail, sysuid AS uid, sysgid AS gid FROM user WHERE user = '%n'
Manually query MySQL with username and passwd as specified in /usr/local/dovecot-1.0-test64/etc/dovecot-mysql.conf:
mysql> SELECT pass AS password FROM user WHERE user ='client@clientdomain.com'; +-----------+ | password | +-----------+ | secretpw | +-----------+ 1 row in set (0.00 sec)
mysql>
Thanks, Zoong
On Sunday, 3 April 2005 at 7:40:36 +1000, Zoong PHAM wrote:
I have dovecot-1.0-test64 installed on OpenBSD-3.6. It works fine with local password.
Now I fail to get dovecot to use MySQL to query for user details.
I forgot few more details in my previous post:
For mail client I use mutt and for protocol I specify imaps in /usr/local/dovecot/etc/dovecot.conf.
Notes: it works OK like that with local /etc/passwd. It just doens't work with MySQL.
Thanks, Zoong
On Sun, 2005-04-03 at 07:40 +1000, Zoong PHAM wrote:
Apr 3 07:20:50 www dovecot: auth(default): blocking(client@clientdomain.com,5.6.7.8): Received reply from worker without password scheme
It's a bug. I think it was fixed in 1.0-test65. Or at least in later nightly snapshots.
On Sunday, 3 April 2005 at 1:24:38 +0300, Timo Sirainen wrote:
On Sun, 2005-04-03 at 07:40 +1000, Zoong PHAM wrote:
Apr 3 07:20:50 www dovecot: auth(default): blocking(client@clientdomain.com,5.6.7.8): Received reply from worker without password scheme
It's a bug. I think it was fixed in 1.0-test65. Or at least in later nightly snapshots.
I just try to compile 1.0-test65 and it fails when I ran "make". The same configure command work for 1.0-test64. I am using OpenBSD-3.4 with pre-compiled package mysql-4.0.20.
Here are the details: ./configure --prefix=/usr/local/dovecot --without-pam --without-shadow --without-vpopmail --localstatedir=/var --with-ssldir=/etc/ssl --with-ssl=openssl --with-mysql make
And below is the outputs from make:
make all-recursive
Making all in src
Making all in lib
Making all in lib-sql
Making all in lib-ntlm
Making all in lib-settings
Making all in lib-charset
Making all in lib-mail
Making all in lib-imap
Making all in lib-index
source='mail-index-transaction.c' object='mail-index-transaction.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/lib -I../../src/lib-mail -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -c mail-index-transaction.c
mail-index-transaction.c: In function mail_index_buffer_convert_to_uids': mail-index-transaction.c:102: syntax error before
struct'
mail-index-transaction.c:111: count' undeclared (first use in this function) mail-index-transaction.c:111: (Each undeclared identifier is reported only once mail-index-transaction.c:111: for each function it appears in.) mail-index-transaction.c:112:
i' undeclared (first use in this function)
mail-index-transaction.c:113: seq' undeclared (first use in this function) mail-index-transaction.c:115:
j' undeclared (first use in this function)
mail-index-transaction.c:115: warning: left-hand operand of comma expression has no effect
mail-index-transaction.c:117: rec' undeclared (first use in this function) mail-index-transaction.c:120:
view' undeclared (first use in this function)
mail-index-transaction.c: In function arrays_convert_to_uids': mail-index-transaction.c:133: syntax error before
*'
mail-index-transaction.c:139: updates' undeclared (first use in this function) mail-index-transaction.c:139:
count' undeclared (first use in this function)
mail-index-transaction.c:140: i' undeclared (first use in this function) mail-index-transaction.c: In function
mail_index_seq_range_array_add':
mail-index-transaction.c:265: syntax error before struct' mail-index-transaction.c:268:
value' undeclared (first use in this function)
mail-index-transaction.c:277: data' undeclared (first use in this function) mail-index-transaction.c:277:
count' undeclared (first use in this function)
mail-index-transaction.c:302: idx' undeclared (first use in this function) mail-index-transaction.c:302:
left_idx' undeclared (first use in this function)
mail-index-transaction.c:302: right_idx' undeclared (first use in this function) mail-index-transaction.c: In function
mail_index_seq_range_array_remove':
mail-index-transaction.c:347: syntax error before struct' mail-index-transaction.c:353:
data' undeclared (first use in this function)
mail-index-transaction.c:353: count' undeclared (first use in this function) mail-index-transaction.c:374:
idx' undeclared (first use in this function)
mail-index-transaction.c:374: left_idx' undeclared (first use in this function) mail-index-transaction.c:374:
right_idx' undeclared (first use in this function)
mail-index-transaction.c:398: value' undeclared (first use in this function) mail-index-transaction.c: In function
mail_index_seq_array_lookup':
mail-index-transaction.c:636: syntax error before unsigned' mail-index-transaction.c:639:
count' undeclared (first use in this function)
mail-index-transaction.c:646: seq_p' undeclared (first use in this function) mail-index-transaction.c:648:
idx' undeclared (first use in this function)
mail-index-transaction.c:650: left_idx' undeclared (first use in this function) mail-index-transaction.c:650:
right_idx' undeclared (first use in this function)
mail-index-transaction.c: In function mail_index_seq_array_add': mail-index-transaction.c:675: syntax error before
void'
mail-index-transaction.c:685: idx' undeclared (first use in this function) mail-index-transaction.c:687:
p' undeclared (first use in this function)
mail-index-transaction.c: In function mail_index_update_header_ext': mail-index-transaction.c:775: warning: unused parameter
t'
mail-index-transaction.c:776: warning: unused parameter ext_id' mail-index-transaction.c:776: warning: unused parameter
offset'
mail-index-transaction.c:777: warning: unused parameter data' mail-index-transaction.c:777: warning: unused parameter
size'
*** Error code 1
Stop in /usr/local/zoong/src/dovecot-1.0-test65/src/lib-index. *** Error code 1
Stop in /usr/local/zoong/src/dovecot-1.0-test65/src (line 271 of Makefile). *** Error code 1
Stop in /usr/local/zoong/src/dovecot-1.0-test65 (line 328 of Makefile). *** Error code 1
Stop in /usr/local/zoong/src/dovecot-1.0-test65 (line 214 of Makefile).
Thanks, Zoong
On Sun, 2005-04-03 at 08:58 +1000, Zoong PHAM wrote:
I just try to compile 1.0-test65 and it fails when I ran "make". .. source='mail-index-transaction.c' object='mail-index-transaction.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/lib -I../../src/lib-mail -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -c mail-index-transaction.c mail-index-transaction.c: In function
mail_index_buffer_convert_to_uids': mail-index-transaction.c:102: syntax error before
struct'
This is fixed in 1.0-test66.
On Sunday, 3 April 2005 at 2:06:28 +0300, Timo Sirainen wrote:
On Sun, 2005-04-03 at 08:58 +1000, Zoong PHAM wrote:
I just try to compile 1.0-test65 and it fails when I ran "make". .. source='mail-index-transaction.c' object='mail-index-transaction.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/lib -I../../src/lib-mail -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -c mail-index-transaction.c mail-index-transaction.c: In function
mail_index_buffer_convert_to_uids': mail-index-transaction.c:102: syntax error before
struct'This is fixed in 1.0-test66.
Thanks Timo.
I compile 1.0-test66 OK now.
However, the problem with "reply from worker without password scheme" is still happening with 1.0-test66.
Cheers, Zoong
Ditto. Works fine on the rows with {scheme} in but doesn't fallback to the default scheme in the sql conf.
Regards Andrew
On Sun, 2005-04-03 at 09:10 +1000, Zoong PHAM wrote:
Thanks Timo.
I compile 1.0-test66 OK now.
However, the problem with "reply from worker without password scheme" is still happening with 1.0-test66.
Cheers, Zoong
-- Andrew Hutchings (A-Wing) Linux Guru - Netserve Consultants Ltd. - www.domaincity.co.uk Random BOFH excuse: Write-only-memory subsystem too slow for this machine. Contact your local dealer.
It only seem to happen if CRYPT is the default scheme. I did a bit a debugging and found that the following is working in passdb-sql.c so am not sure where the fault is:
scheme = password_get_scheme(&password);
if (scheme == NULL) {
scheme = passdb_sql_conn->set.default_pass_scheme;
i_assert(scheme != NULL);
}
I should imagine it is in the next stage somewhere but don't fully understand it without the time to look into it.
Regards Andrew
On Wed, 2005-04-06 at 15:29 +0100, Andrew Hutchings wrote:
Ditto. Works fine on the rows with {scheme} in but doesn't fallback to the default scheme in the sql conf.
Regards Andrew
On Sun, 2005-04-03 at 09:10 +1000, Zoong PHAM wrote:
Thanks Timo.
I compile 1.0-test66 OK now.
However, the problem with "reply from worker without password scheme" is still happening with 1.0-test66.
Cheers, Zoong
-- Andrew Hutchings (A-Wing) Linux Guru - Netserve Consultants Ltd. - www.domaincity.co.uk Random BOFH excuse: Write-only-memory subsystem too slow for this machine. Contact your local dealer.
-- Andrew Hutchings (A-Wing) Linux Guru - Netserve Consultants Ltd. - www.domaincity.co.uk Random BOFH excuse: Daemons did it
Here is a working temporary patch for the 'Received reply from worker without password scheme' bug in passdb-sql.c until Timo can re-write it in better code than my 5 minute hash job :) Timo: blocking code scheme detect doesn't take into account schemes that cannot be detected and are not in the password string (in {SCHEME}password form). This patch adds {SCHEME} to the password string if default is required. --- passdb-sql.c 2005-03-29 09:39:33.000000000 +0100 +++ /root/dovecot-1.0-test66/src/auth/passdb-sql.c 2005-04-06 20:38:42.297163120 +0100 @@ -14,6 +14,7 @@ #include "db-sql.h" #include "passdb.h" +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -54,6 +55,7 @@ struct auth_request *auth_request = sql_request->auth_request; enum passdb_result passdb_result; const char *user, *password, *scheme; + char tmp[50]; int ret; passdb_result = PASSDB_RESULT_INTERNAL_FAILURE; @@ -87,6 +89,8 @@ scheme = password_get_scheme(&password); if (scheme == NULL) { scheme = passdb_sql_conn->set.default_pass_scheme; + sprintf(tmp,"{%s}%s",scheme,password); + auth_request->passdb_password = tmp; i_assert(scheme != NULL); } -- Andrew Hutchings (A-Wing) Linux Guru - Netserve Consultants Ltd. - www.domaincity.co.uk Random BOFH excuse: Browser's cookie is corrupted -- someone's been nibbling on it.
On Wed, 2005-04-06 at 20:51 +0100, Andrew Hutchings wrote:
Here is a working temporary patch for the 'Received reply from worker without password scheme' bug in passdb-sql.c until Timo can re-write it in better code than my 5 minute hash job :)
Thanks. I made it more generic so that it works with LDAP and some possibly future ones as well.
On Sunday, 3 April 2005 at 1:24:38 +0300, Timo Sirainen wrote:
On Sun, 2005-04-03 at 07:40 +1000, Zoong PHAM wrote:
Apr 3 07:20:50 www dovecot: auth(default): blocking(client@clientdomain.com,5.6.7.8): Received reply from worker without password scheme
It's a bug. I think it was fixed in 1.0-test65. Or at least in later nightly snapshots.
Timo,
The problem still happening with 1.0-test66. Is the bug fixed yet or still outstanding?
Thanks, Zoong
participants (3)
-
Andrew Hutchings
-
Timo Sirainen
-
Zoong PHAM