[Dovecot] Dovecot cannot connect to PostgreSQL server
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512 password_query = SELECT email as user, password, 'maildir:/home/mail'||maildir as userdb_mail FROM users WHERE email = '%u'
How can I debug this situation?
Cheers Chris
Chris Vaas skrev den 2014-04-26 18:06:
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512 password_query = SELECT email as user, password, 'maildir:/home/mail'||maildir as userdb_mail FROM users WHERE email = '%u'
How can I debug this situation?
check /etc/gai.conf if localhost should prefer ipv4 last or first
are postgresql listning on both ipv4 ipv6 ?
is dovecot using the incorrect if no ?
Both versions are enabled on all participants. On Apr 26, 2014 6:14 PM, "Benny Pedersen" me@junc.eu wrote:
Chris Vaas skrev den 2014-04-26 18:06:
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512 password_query = SELECT email as user, password, 'maildir:/home/mail'||maildir as userdb_mail FROM users WHERE email = '%u'
How can I debug this situation?
check /etc/gai.conf if localhost should prefer ipv4 last or first
are postgresql listning on both ipv4 ipv6 ?
is dovecot using the incorrect if no ?
Christian Vaas skrev den 2014-04-26 18:25:
Both versions are enabled on all participants.
then its in postgresql it self
failing SHA512 auth
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512 password_query = SELECT email as user, password, 'maildir:/home/mail'||maildir as userdb_mail FROM users WHERE email = '%u'
Am 26.04.2014 18:06, schrieb Chris Vaas:
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512 password_query = SELECT email as user, password, 'maildir:/home/mail'||maildir as userdb_mail FROM users WHERE email = '%u'
How can I debug this situation?
try "host=/path/to/your/unix/socket" instead just only "localhost" or switch to TCP with using 127.0.0.1 instead localhost
in case of mysqld this would be "host=/var/lib/mysql/mysql.sock"
participants (4)
-
Benny Pedersen
-
Chris Vaas
-
Christian Vaas
-
Reindl Harald