[Dovecot] Postgresql and Dovecot
I am having some issues getting dovecot to work with postgres. Dovecot starts up and runs fine without using postgres (ie passwd and pam). There is nothing in /var/log/messages other than:
Aug 28 12:44:05 mail dovecot: dovecot startup succeeded
Then ps -A shows no running dovecot processes (or the imap-login or pop-login). I have tried with both the RPMs that are on the download page and buidling it myself on 2 different boxes (yes I configured with --with-pgsql - Red Hat 7.3 and Red Hat 9.0).
Any suggestions would be appreciated as this is the only imap/pop server with pgsql support and flatfile support I can find.
Michael
Sorry, it has been a long day. I noticed my message left something out. When I start dovecot using "pgsql /etc/dovecot-pgsql.conf" for auth_passdb and auth_userdb it dies with no error.
On Thu, 2003-08-28 at 16:28, Michael Ducy wrote:
I am having some issues getting dovecot to work with postgres. Dovecot starts up and runs fine without using postgres (ie passwd and pam). There is nothing in /var/log/messages other than:
Aug 28 12:44:05 mail dovecot: dovecot startup succeeded
Then ps -A shows no running dovecot processes (or the imap-login or pop-login). I have tried with both the RPMs that are on the download page and buidling it myself on 2 different boxes (yes I configured with --with-pgsql - Red Hat 7.3 and Red Hat 9.0).
Any suggestions would be appreciated as this is the only imap/pop server with pgsql support and flatfile support I can find.
Michael
On Fri, 2003-08-29 at 00:47, Michael Ducy wrote:
Sorry, it has been a long day. I noticed my message left something out. When I start dovecot using "pgsql /etc/dovecot-pgsql.conf" for auth_passdb and auth_userdb it dies with no error.
dovecot process dies too? If there's no error, it means it crashes. Check if there's a core file in /usr/local/var/run/dovecot/? Or if not:
gdb /usr/local/sbin/dovecot run -F
then you should see where it crashes? "bt" gives backtrace.
gdb says the program exits normally. However I have found the problem.
In my dovecot-pgsql.conf file my user_query was written as
user_query= SELECT .....;
dovecot doesn't like that (and doesn't let me know that :) )
user_query = SELECT works.
Thanks, Michael
On Fri, 2003-08-29 at 03:19, Timo Sirainen wrote:
On Fri, 2003-08-29 at 00:47, Michael Ducy wrote:
Sorry, it has been a long day. I noticed my message left something out. When I start dovecot using "pgsql /etc/dovecot-pgsql.conf" for auth_passdb and auth_userdb it dies with no error.
dovecot process dies too? If there's no error, it means it crashes. Check if there's a core file in /usr/local/var/run/dovecot/? Or if not:
gdb /usr/local/sbin/dovecot run -F
then you should see where it crashes? "bt" gives backtrace.
On Friday, Aug 29, 2003, at 17:00 Europe/Helsinki, Michael Ducy wrote:
user_query= SELECT .....;
OK, have to fix that. The space shouldn't be so important there.
dovecot doesn't like that (and doesn't let me know that :) )
Maybe you're just looking into wrong place, or configured logging wrong in some way? :)
Aug 29 17:12:38 hurina dovecot: Dovecot starting up Aug 29 17:12:39 hurina dovecot-auth: Error in configuration file /usr/local/etc/dovecot-pgsql.conf line 81: Missing value Aug 29 17:12:39 hurina dovecot: Auth process died too early - shutting down Aug 29 17:12:39 hurina dovecot: child 11731 (auth) returned error 89
I didn't touch the logging settings, however I would be more than happy too. :) I didn't set a verboseness level in dovecot.conf. I am now putting informational messages into a file. Any other settings I should change?
I have another question. I am authenticating against an existing database. Postfix drops mail in /var/spool/mail/%u . The existing database only has login (the username) and password. My user_query is:
user_query = SELECT '/var/spool/mail'||login as mail, 89 AS uid, 89 AS gid FROM user_common WHERE login='%u';
I am getting : +OK dovecot ready. user username +OK pass password +OK Logged in.
- BYE Internal login failure. Connection closed by foreign host.
default_mail_env is set to: default_mail_env = mbox:/var/spool/mail/%u
89 is the uid and gid of the dovecot user which is what auth_user is set to.
Any ideas on the "Internal login failure" failure?
Thanks, Michael
On Fri, 2003-08-29 at 09:15, Timo Sirainen wrote:
On Friday, Aug 29, 2003, at 17:00 Europe/Helsinki, Michael Ducy wrote:
user_query= SELECT .....;
OK, have to fix that. The space shouldn't be so important there.
dovecot doesn't like that (and doesn't let me know that :) )
Maybe you're just looking into wrong place, or configured logging wrong in some way? :)
Aug 29 17:12:38 hurina dovecot: Dovecot starting up Aug 29 17:12:39 hurina dovecot-auth: Error in configuration file /usr/local/etc/dovecot-pgsql.conf line 81: Missing value Aug 29 17:12:39 hurina dovecot: Auth process died too early - shutting down Aug 29 17:12:39 hurina dovecot: child 11731 (auth) returned error 89
On Friday, Aug 29, 2003, at 18:19 Europe/Helsinki, Michael Ducy wrote:
I didn't touch the logging settings, however I would be more than happy too. :) I didn't set a verboseness level in dovecot.conf. I am now putting informational messages into a file. Any other settings I should change?
No, and the verbosivity isn't really needed either. If you mean auth_verbose, it only says why some login failed (invalid password, no such user etc).
I have another question. I am authenticating against an existing database. Postfix drops mail in /var/spool/mail/%u . The existing database only has login (the username) and password. My user_query is:
user_query = SELECT '/var/spool/mail'||login as mail, 89 AS uid, 89 AS gid FROM user_common WHERE login='%u';
Shouldn't you have / after the /var/spool/mail? And it's not really needed anyway if it's the same as default_mail_env. And I think
- BYE Internal login failure.
Any ideas on the "Internal login failure" failure?
It's told in log file. If you don't see it, you really have some logging problem :)
I have another question. I am authenticating against an existing database. Postfix drops mail in /var/spool/mail/%u . The existing database only has login (the username) and password. My user_query is:
user_query = SELECT '/var/spool/mail'||login as mail, 89 AS uid, 89 AS gid FROM user_common WHERE login='%u';
I think you want a slash after /var/spool/mail, and select the mail directory field as "home", not "mail":
user_query = SELECT '/var/spool/mail/'||login AS home, 89 AS uid, 89 AS gid FROM user_common WHERE login='%u';
-- Alex Howansky Wankwood Associates http://www.wankwood.com/
participants (3)
-
Alex Howansky
-
Michael Ducy
-
Timo Sirainen