Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dovecot/mysql authentication problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
h0mer`-
Apprentice
Apprentice


Joined: 02 Aug 2004
Posts: 215

PostPosted: Mon Jan 26, 2009 2:46 pm    Post subject: [SOLVED] dovecot/mysql authentication problem Reply with quote

Hi all,

i followed this guide - http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot
but i am having difficulties understanding the authentification part with mysql.

this is what i am getting in my system log:

Code:
dovecot: auth(default): client in: AUTH  1       PLAIN   service=imap    secured lip=[SERVERIP]        rip=[CLIENTIP]       lport=993       rport=21299     resp=AHBvc3RtYXN0ZXJAY2JveC5jYwBiVTFkMGczcHdu
dovecot: auth(default): client out: OK   1       user=postmaster@testdomain.com
dovecot: auth-worker(default): sql(postmaster@testdomain.com,[CLIENTIP]): query: SELECT username as user, password FROM mailbox WHERE username = 'postmaster@testdomain.com' AND active = 1
dovecot: auth(default): master in: REQUEST       1       16296   1
dovecot: auth(default): prefetch(postmaster@testdomain.com,[CLIENTIP]): passdb didn't return userdb entries
dovecot: auth(default): userdb(postmaster@testdomain.com,[CLIENTIP]): user not found from userdb prefetch
dovecot: auth(default): master out: NOTFOUND     1
dovecot: imap-login: Internal login failure (auth failed, 1 attempts): user=<postmaster@testdomain.com>, method=PLAIN, rip=[CLIENTIP], lip=[SERVERIP], TLS


using the following query in mysql i get a valid user/password entry
Code:
SELECT username as user, password FROM mailbox WHERE username = 'postmaster@testdomain.com' AND active = 1


but what about those passdb and userdb errors from the system log?


this are the relevant parts of my config files

dovecot.conf
Quote:
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}

userdb prefetch {
}


dovecot-sql.conf
Quote:
password_query = SELECT username as user, password FROM mailbox WHERE username = '%u' AND active = 1
user_query = SELECT CONCAT('/var/mail/', maildir) AS home, CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active = 1


Last edited by h0mer`- on Tue Jan 27, 2009 11:42 am; edited 1 time in total
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Mon Jan 26, 2009 7:58 pm    Post subject: Reply with quote

Drop the prefetch. The logs are complaining that it's not returning data in the required format.
Back to top
View user's profile Send private message
h0mer`-
Apprentice
Apprentice


Joined: 02 Aug 2004
Posts: 215

PostPosted: Mon Jan 26, 2009 9:44 pm    Post subject: Reply with quote

awesome - works. thanks.

what kind of password/login encryption should i use?
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Tue Jan 27, 2009 5:39 am    Post subject: Reply with quote

You'll be restricted to ones your clients can support. Take a look at what they can cope with.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum