0

I try to get mail server to work on PostgreSQL but I get a error below:

Apr 16 20:48:57 alm authdaemond: PGSQL_CONNECTION could not be established
Apr 16 20:48:57 alm authdaemond: FATAL:  database "mail_admin" does not exist.

I followed this manual and try somehow to get it work in PostgreSQL instead MySQL: https://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-ubuntu-14.04-lts

Yes I have database mail and it's user mail_admin and this user haves a access to mail database.

Here is more error logs.

Apr 16 20:58:35 alm imapd: LOGIN FAILED, user=xxx.xxx@yourdomain.com, ip=[::ffff:91.154.218.57]
Apr 16 20:58:36 alm postfix/smtpd[21430]: warning: SASL authentication failure: Password verification failed
Apr 16 20:58:36 alm postfix/smtpd[21430]: warning: unknown[78.128.113.99]: SASL PLAIN authentication failed: authentication failure
Apr 16 20:58:37 alm postfix/smtpd[21430]: lost connection after AUTH from unknown[78.128.113.99]
Apr 16 20:58:37 alm postfix/smtpd[21430]: disconnect from unknown[78.128.113.99] ehlo=1 auth=0/1 commands=1/2
  • did you configure the remote connection for the database in the /var/lib/pgsql/data/pg_hba.conf file? Did you start the database from available template? – AtomiX84 Apr 16 '20 at 22:25
  • No. And not new email appears to my server but I still can't download email vie Thunderbird. PostgreSQL work little different. So this must be write like this: SELECT CONCAT(split_part(email,'@',2),'/',split_part(email,'@',1),'/') FROM users WHERE email='%s' – Matti Kiviharju Apr 16 '20 at 22:47
  • PostgreSQL work fine wit all other software which I am using it. – Matti Kiviharju Apr 16 '20 at 22:51
  • It seams to be authentcation error. My sever not accept encrypted password over STARTSL. – Matti Kiviharju Apr 16 '20 at 23:04
  • By the way, how email passwords must be encrypted on PostgreSQL 10? – Matti Kiviharju Apr 16 '20 at 23:15
  • And what I set to here? PGSQL_MAILDIR_FIELD SELECT CONCAT(split_part(email,'@',2),'/',split_part(email,'@',1),'/') FROM users WHERE email='%s' – Matti Kiviharju Apr 17 '20 at 00:07

1 Answers1

0

I got this finally works.

users table need little change because authpgsql Courier work different way in MySQL authmysql.

Like it need these columns:

email   crypt   quota   name    uid     gid     clear   home    auxoptions

In crypt column crypted password is stored as crypt: https://xnode.org/page/Crypt_Generator Can be generated on address mentioned earlier

then home must be set like this per domain you host: /home/vmail/domain1.com/ /home/vmail/domain2.com/

And file authpgsqlrc need this:

PGSQL_MAILDIR_FIELD split_part(email,'@',1)