On 22/11/2025 16:16, Smith via Postfix-users wrote:
I am currently working on migrating a Postfix instance from using a local
Postgres server to a cloud-hosted one.
I have verified I can connect to the Postgres database using the credentials
and have manually executed the query. So everything is confirmed as ready to go.
So it should be as simple as swapping the `hosts=`, and doing a `reload` right ?
Wrong !
I have this in my main.cf:
relay_recipient_maps = pgsql:${config_directory}/pgsql_relay_recipient_maps.conf
And pgsql_relay_recipient_maps.conf has three lines:
hosts=
dbname=
query=
The *working* internal `hosts=` line looks something like:
hosts=postgresql://myusername:[email protected]/database_name?sslmode=require
So for the cloud provider, I just replaced `internal.server` since the user
account got migrated over retaining the same password.
I get this obscure message:
smtpd[129133]: warning: connect to pgsql server postgres://....(REMOVED FOR
BREVITY)...: local user with ID 109 does not exist?
So I thought ok, maybe I will try the full-fat version, changing "ssl=require" (which works on manual
tests) to "ssl=verify-full&sslrootcert=cert.pem" (the "cert.pem" being colocated in the
postfix config directory, but I tried full-path too).
But no. The same obscure message:
smtpd[129133]: warning: connect to pgsql server postgres://....(REMOVED FOR
BREVITY)...: local user with ID 109 does not exist?
Any ideas ?????
Hi
my suggestion would be to look at the hosts setting.
You stated above that the hosts setting started with something like this:
hosts=postgresql://
But if you compare that to the error message it is not quite the same thing:
connect to pgsql server postgres://
The postgresql C library has two different functions for connecting to
the database, one based on the url type syntax and one based on explicit
parameters. When deciding which function to call, Postfix checks whether
the hosts parameter starts with postgresql. In your original
configuration I guess this was the case, but from the error message, I
doubt whether that is still the case.
If you go back to the postgresql:// syntax hopefully you will solve the
problem.
John
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]