I reinstalled Dovecot this evening, because I haven't been able to receive emails recently. After configuring and adjusting for the use of PostfixAdmin, I get the following error message in Evolution:;
Failed to open folder. The reported error was "Failed to authenticate: TLS connection closed unexpectedly".
Does anyone recognize this error?
Ken
On January 7, 2022 9:51:20 AM GMT+01:00, Ken Wright daddywarlock@gmail.com wrote:
I reinstalled Dovecot this evening, because I haven't been able to receive emails recently. After configuring and adjusting for the use of PostfixAdmin, I get the following error message in Evolution:;
Failed to open folder. The reported error was "Failed to authenticate: TLS connection closed unexpectedly".
Does anyone recognize this error? Do you have a connection attempt logged by dovecot? Is there anything in the logs on the server?
Christian Kivalo
On Fri, 2022-01-07 at 10:02 +0100, Christian Kivalo wrote:
On January 7, 2022 9:51:20 AM GMT+01:00, Ken Wright daddywarlock@gmail.com wrote:
I reinstalled Dovecot this evening, because I haven't been able to receive emails recently. After configuring and adjusting for the use of PostfixAdmin, I get the following error message in Evolution:;
Failed to open folder. The reported error was "Failed to authenticate: TLS connection closed unexpectedly".
Does anyone recognize this error? Do you have a connection attempt logged by dovecot? Is there anything in the logs on the server?
Here's the output of tail /var/log/mail.log:
kwright@grace:~$ tail /var/log/mail.log Jan 7 12:17:01 grace dovecot: auth-worker(665770): Debug: sql(www-data@mydomain.com): Finished userdb lookup Jan 7 12:17:01 grace dovecot: auth-worker(665770): Debug: conn unix:auth-worker (pid=577330,uid=118): auth-worker<47>: Finished Jan 7 12:17:01 grace dovecot: auth: Debug: sql(www-data@mydomain.com): Finished userdb lookup Jan 7 12:17:01 grace dovecot: auth: Debug: userdb out: FAIL#0116 Jan 7 12:17:01 grace dovecot: lmtp(www-data@mmydomain.com)<666025><8B33CY112GGpKQoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:17:01 grace dovecot: lmtp(666025): Error: lmtp-server: conn unix:pid=666014,uid=117 [4]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:17:01 grace postfix/lmtp[666014]: 1ABE5100DB349: to=www-data@mydomain.com, orig_to=<www-data>, relay=grace.koalatyworks.com[private/dovecot-lmtp], delay=0.14, delays=0.12/0/0/0.02, dsn=4.3.0, status=deferred (host grace.mydomain.com[private/dovecot-lmtp] said: 451 4.3.0 www-data@mydomain.com Temporary internal error (in reply to RCPT TO command)) Jan 7 12:17:01 grace dovecot: lmtp(666025): Disconnect from local: Client has quit the connection (state=READY) Jan 7 12:17:03 grace dovecot: auth: Debug: client in: CONT#0111#011ZWR1Y2F0aW9uQGtvYWxhdHl3b3Jrcy5jb20= (previous base64 data may contain sensitive data) Jan 7 12:17:03 grace dovecot: auth: Debug: client passdb out: CONT#0111#011UGFzc3dvcmQ6
And here's tail /var/log/mail.err:
Jan 7 12:20:01 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666856,uid=117 [3]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:21:01 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:21:01 grace dovecot: lmtp(www-data@mydomain.com)<666838><oAcjK3122GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:21:01 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [4]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:22:01 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:22:01 grace dovecot: lmtp(www-data@mydomain.com)<666838><uFfTNbl22GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:22:01 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [5]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:23:02 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:23:02 grace dovecot: lmtp(www-data@mydomain.com)<666838><kNcEEfZ22GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:23:02 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [6]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information.
Hope this helps!
Ken
You have to enable ssl logging check the configs!
-----Original Message----- From: dovecot dovecot-bounces@dovecot.org On Behalf Of Ken Wright Sent: Friday, January 07, 2022 6:32 PM To: Christian Kivalo ml+dovecot@valo.at; dovecot@dovecot.org Subject: Re: TLS connection closed unexpectedly
On Fri, 2022-01-07 at 10:02 +0100, Christian Kivalo wrote:
On January 7, 2022 9:51:20 AM GMT+01:00, Ken Wright daddywarlock@gmail.com wrote:
I reinstalled Dovecot this evening, because I haven't been able to receive emails recently. After configuring and adjusting for the use of PostfixAdmin, I get the following error message in Evolution:;
Failed to open folder. The reported error was "Failed to authenticate: TLS connection closed unexpectedly".
Does anyone recognize this error? Do you have a connection attempt logged by dovecot? Is there anything in the logs on the server?
Here's the output of tail /var/log/mail.log:
kwright@grace:~$ tail /var/log/mail.log Jan 7 12:17:01 grace dovecot: auth-worker(665770): Debug: sql(www-data@mydomain.com): Finished userdb lookup Jan 7 12:17:01 grace dovecot: auth-worker(665770): Debug: conn unix:auth-worker (pid=577330,uid=118): auth-worker<47>: Finished Jan 7 12:17:01 grace dovecot: auth: Debug: sql(www-data@mydomain.com): Finished userdb lookup Jan 7 12:17:01 grace dovecot: auth: Debug: userdb out: FAIL#0116 Jan 7 12:17:01 grace dovecot: lmtp(www- data@mmydomain.com)<666025><8B33CY112GGpKQoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:17:01 grace dovecot: lmtp(666025): Error: lmtp-server: conn unix:pid=666014,uid=117 [4]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:17:01 grace postfix/lmtp[666014]: 1ABE5100DB349: to=www-data@mydomain.com, orig_to=<www-data>, relay=grace.koalatyworks.com[private/dovecot-lmtp], delay=0.14, delays=0.12/0/0/0.02, dsn=4.3.0, status=deferred (host grace.mydomain.com[private/dovecot-lmtp] said: 451 4.3.0 www-data@mydomain.com Temporary internal error (in reply to RCPT TO command)) Jan 7 12:17:01 grace dovecot: lmtp(666025): Disconnect from local: Client has quit the connection (state=READY) Jan 7 12:17:03 grace dovecot: auth: Debug: client in: CONT#0111#011ZWR1Y2F0aW9uQGtvYWxhdHl3b3Jrcy5jb20= (previous base64 data may contain sensitive data) Jan 7 12:17:03 grace dovecot: auth: Debug: client passdb out: CONT#0111#011UGFzc3dvcmQ6
And here's tail /var/log/mail.err:
Jan 7 12:20:01 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666856,uid=117 [3]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:21:01 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:21:01 grace dovecot: lmtp(www-data@mydomain.com)<666838><oAcjK3122GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:21:01 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [4]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:22:01 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:22:01 grace dovecot: lmtp(www-data@mydomain.com)<666838><uFfTNbl22GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:22:01 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [5]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information. Jan 7 12:23:02 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:23:02 grace dovecot: lmtp(www-data@mydomain.com)<666838><kNcEEfZ22GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:23:02 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [6]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information.
Hope this helps!
Ken
On 07/01/2022 18:31, Ken Wright wrote:
On Fri, 2022-01-07 at 10:02 +0100, Christian Kivalo wrote:
On January 7, 2022 9:51:20 AM GMT+01:00, Ken Wright daddywarlock@gmail.com wrote:
I reinstalled Dovecot this evening, because I haven't been able to receive emails recently. After configuring and adjusting for the use of PostfixAdmin, I get the following error message in Evolution:;
Failed to open folder. The reported error was "Failed to authenticate: TLS connection closed unexpectedly".
Does anyone recognize this error? Do you have a connection attempt logged by dovecot? Is there anything in the logs on the server?
Here's the output of tail /var/log/mail.log:
.... Jan 7 12:23:02 grace dovecot: auth-worker(665770): Error: sql(www-data@mydomain.com): User query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM mailbox WHERE username = 'www-data@mydomain.com' AND active='1'' at line 1 Jan 7 12:23:02 grace dovecot: lmtp(www-data@mydomain.com)<666838><kNcEEfZ22GHWLAoAThsuZQ>: Error: auth-master: userdb lookup(www-data@mydomain.com): Auth USER lookup failed Jan 7 12:23:02 grace dovecot: lmtp(666838): Error: lmtp-server: conn unix:pid=666840,uid=117 [6]: rcpt www-data@mydomain.com: Failed to lookup user www-data@mydomain.com: Internal error occurred. Refer to server log for more information.
Hope this helps!
Ken
Ken
it may or may not be related to the tls issue, but I think you will want to investigate that message about the SQL query syntax error. You are not going to be able to login if the query is giving errors. Check the user_query in the dovecot configuration, since the SQL snippet in the log doesn't reveal the cause.
John
On Fri, 2022-01-07 at 18:50 +0100, John Fawcett wrote:
it may or may not be related to the tls issue, but I think you will want to investigate that message about the SQL query syntax error. You are not going to be able to login if the query is giving errors. Check the log doesn't reveal the cause.
Know anything about SQL queries, John? Here's the user query in question:
user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%u' AND active='1'
I copied this directly from the tutorial I've been following and this is the first time I've seen this error.
On 07/01/2022 21:03, Ken Wright wrote:
On Fri, 2022-01-07 at 18:50 +0100, John Fawcett wrote:
it may or may not be related to the tls issue, but I think you will want to investigate that message about the SQL query syntax error. You are not going to be able to login if the query is giving errors. Check the log doesn't reveal the cause. Know anything about SQL queries, John? Here's the user query in question:
user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%u' AND active='1'
I copied this directly from the tutorial I've been following and this is the first time I've seen this error.
Hi Ken
looks fine to me. However, mariadb is not accepting it. I suggest you run with auth_debug = yes and check the logs.
John
On Fri, Jan 7, 2022 at 1:34 PM John Fawcett john@voipsupport.it wrote:
On 07/01/2022 21:03, Ken Wright wrote:
On Fri, 2022-01-07 at 18:50 +0100, John Fawcett wrote:
it may or may not be related to the tls issue, but I think you will want to investigate that message about the SQL query syntax error. You are not going to be able to login if the query is giving errors. Check the log doesn't reveal the cause. Know anything about SQL queries, John? Here's the user query in question:
user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%u' AND active='1'
I copied this directly from the tutorial I've been following and this is the first time I've seen this error.
Hi Ken
looks fine to me. However, mariadb is not accepting it. I suggest you run with auth_debug = yes and check the logs.
Does it help at all if you use backticks around the column names for uid and gid? I.e.
from: user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%u' AND active='1'
to:
user_query = SELECT maildir, 2000 AS uid
, 2000 AS gid
FROM mailbox
WHERE username = '%u' AND active='1'
user_query = SELECT maildir, 2000 AS uid, 2000 AS gid FROM mailbox WHERE username = '%u' AND active='1'
If you are using a static uid/gid it is not needed to have it include it in queries. You can set them in the config with:
mail_uid = 2000 mail_gid = 2000
And then shorten the query to:
user_query = SELECT maildir FROM mailbox WHERE username = '%u' AND active
participants (6)
-
Christian Kivalo
-
dovecot@ptld.com
-
John Fawcett
-
Ken Wright
-
Marc
-
Mark Moseley