[Dovecot] Dovecot cannot connect to PostgreSQL server

Reindl Harald h.reindl at thelounge.net
Sat Apr 26 16:33:00 UTC 2014


first: don't reply off-list and don't top-post

Am 26.04.2014 18:26, schrieb Christian Vaas:
> How do I determine my postgresql socket location?
> 
> On Apr 26, 2014 6:17 PM, "Reindl Harald" <h.reindl at thelounge.net <mailto:h.reindl at thelounge.net>> wrote:
> 
>     Am 26.04.2014 18 <tel:26.04.2014%2018>: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"

why don't you know that? it's your machine and i don't use PostgreSQL at all
"updatedb; locate post | grep socket" may be a good start

just read the man page of your distribtion or use google
google: "name-of-your-distribution postgresql unix socket"

or simply try 127.0.0.1 which is as explained different to localhost
localhost is typically unix-socket and 127.0.0.1 TCP/IP, in any case
you have to make sure that the user is allowed

in case of mysql i can set different permissions for "user1 at localhost"
and "user1 at 127.0.0.1", most likely PostgeSQL supports that too

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20140426/c764575f/attachment.sig>


More information about the dovecot mailing list