Dovecot authentication through proxy
Hi everybody, I run two redundant Dovecot servers with a shared Maildir on a GlusterFS volume and a SQL authentication backend based on a mirrored MariaDB database. Because of the splitbrain situation I would like to add two Dovecot Director as proxies. Since a few days I am trying to get the setup running. In the meantime I have achieved that the clients can successfully authenticate on the proxy and that the client connections are forwarded to the backend servers. Unfortunately I still have the problem that no authentication attempts are made on the backend servers. Can someone explain me how to solve this problem? I have read that it is eventually possible to work with Master Users. But I guess that won't work for me, because I use the mailcrypt plugin and the client password is also the password for the encryption key. Best regards Daniel ### Proxy Log ### ############### Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth-worker(20760): Debug: sql(***@***.**,192.168.1.100,<sNTHFdOcbeDAqAFk>): Finished passdb lookup Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth-worker(20760): Debug: conn unix:auth-worker (pid=20753,uid=112): auth-worker<1>: Finished Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth: Debug: sql(***@***.**,192.168.1.100,<sNTHFdOcbeDAqAFk>): username changed ***@***.** -> *** Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth: Debug: sql(***,192.168.1.100,<sNTHFdOcbeDAqAFk>): username changed *** -> ***@***.** Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth: Debug: sql(***@***.**,192.168.1.100,<sNTHFdOcbeDAqAFk>): Finished passdb lookup Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth: Debug: auth(***@***.**,192.168.1.100,<sNTHFdOcbeDAqAFk>): Auth request finished Jan 23 19:48:21 vsrv-***-prx01 dovecot: auth: Debug: client passdb out: OK#0111#011user=***@***.**#011proxy#011ssl=any-cert#011starttls=any-cert#011lip=192.168.20.49#011lport=993#011pass=<hidden> Jan 23 19:48:21 vsrv-***-prx01 dovecot: imap-login: Debug: Ignoring unknown passdb extra field: lip Jan 23 19:48:21 vsrv-***-prx01 dovecot: imap-login: Debug: Ignoring unknown passdb extra field: lport ### Backend Log ### ################### Jan 23 18:48:51 vsrv-***-mta01 dovecot: imap-login: Disconnected (no auth attempts in 30 secs): user=<>, rip=192.168.20.49, lip=192.168.20.28, TLS handshaking: Connection closed, session=<r9yRF9OcZODAqBQx> Jan 23 18:48:51 vsrv-***-mta01 dovecot: imap-login: Disconnected (no auth attempts in 30 secs): user=<>, rip=192.168.20.49, lip=192.168.20.28, TLS handshaking: Connection closed, session=<4C+SF9OcauDAqBQx> Jan 23 18:48:51 vsrv-***-mta01 dovecot: imap-login: Disconnected (no auth attempts in 30 secs): user=<>, rip=192.168.20.49, lip=192.168.20.28, TLS handshaking: Connection closed, session=<KDGSF9OcZuDAqBQx> Jan 23 18:48:51 vsrv-***-mta01 dovecot: imap-login: Disconnected (no auth attempts in 30 secs): user=<>, rip=192.168.20.49, lip=192.168.20.28, TLS handshaking: Connection closed, session=<lwKTF9OcbuDAqBQx> ### Proxy Config ### #################### # 2.3.9.2 (cf2918cac): /etc/dovecot/dovecot.conf # OS: Linux 4.15.0-74-generic x86_64 Ubuntu 18.04.3 LTS # Hostname: vsrv-***-prx01 auth_debug = yes director_mail_servers = 192.168.20.28 192.168.20.29 director_servers = 192.168.20.49:9090 192.168.20.58:9090 disable_plaintext_auth = no mail_location = mbox:~/mail:INBOX=/var/mail/%u namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } passdb { driver = pam } protocols = " imap" service director { inet_listener { port = 9090 } unix_listener login/director { mode = 0666 } } service imap-login { executable = imap-login director } service pop3-login { executable = pop3-login director } ssl = required ssl_cert =
On 27 Jan 2020, at 11.56, Daniel Niewerth daniel@niewerth.it wrote:
Hi everybody,
I run two redundant Dovecot servers with a shared Maildir on a GlusterFS volume and a SQL authentication backend based on a mirrored MariaDB database. Because of the splitbrain situation I would like to add two Dovecot Director as proxies.
I would not run on GlusterFS because of bad experiences and index corruptions on the past experiments.
Can someone explain me how to solve this problem?
### Proxy Config ### ####################
passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql }
please show contents of this file.
passdb { driver = pam }
please remove this if you are using sql as auth db.
Sami
Hi Sami,
thank you for your answer.
I use GlusterFS because the dovecot replication does not work with the mailcrypt plugin. I will wait and see how reliable it works for me. I have only a very small personal mail server. So it is not really critical if something does not work.
The dovecot-sql.conf has the following content:
driver=mysql connect = "host=192.168.20.24 dbname=vmail user=*** password=***" default_pass_scheme = SHA512-CRYPT
password_query = SELECT username AS user, domain, password, '%w' AS userdb_mail_crypt_private_password, 'yes' AS proxy, 'any-cert' AS 'ssl', 'any-cert' AS starttls, 'Y' as nopassword FROM accounts WHERE username = '%n' AND domain = '%d' and enabled = true; user_query = SELECT concat('*:storage=', quota, 'M') AS quota_rule FROM accounts WHERE username = '%n' AND domain = '%d' AND sendonly = false;
iterate_query = SELECT username, domain FROM accounts where sendonly = false;
Best regards
Daniel
Am 28.01.2020 um 07:54 schrieb Sami Ketola sami.ketola@dovecot.fi:
On 27 Jan 2020, at 11.56, Daniel Niewerth
mailto:daniel@niewerth.it> wrote: Hi everybody,
I run two redundant Dovecot servers with a shared Maildir on a GlusterFS volume and a SQL authentication backend based on a mirrored MariaDB database. Because of the splitbrain situation I would like to add two Dovecot Director as proxies.
I would not run on GlusterFS because of bad experiences and index corruptions on the past experiments.
Can someone explain me how to solve this problem?
### Proxy Config ### ####################
passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql }
please show contents of this file.
passdb { driver = pam }
please remove this if you are using sql as auth db.
Sami
-- This email was Malware checked by vsrv-dus6-fwl01
participants (2)
-
Daniel Niewerth
-
Sami Ketola