freescout-helpdesk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
2.67k stars 458 forks source link

Freescout IMAP connection error - Error: connection failed #4002

Open semaf opened 3 weeks ago

semaf commented 3 weeks ago

Hey,

I have an issue with the IMAP connection with type of encryption. SMTP is working fine. It is a local connection between two docker containers in same network.

How is the password forwarded? Plain, crypted? Maybe its the TLS version?

Would be about some help.

If using STARTTLS, the log: Apr 26, 15:30:02 Error fetching email Error: connection failed; File: /www/html/overrides/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php (82)

Dovecot log: dovecot-mailcow-1 | dovecot: imap-login: Disconnected: Aborted login by logging out (auth failed, 1 attempts in 3 secs): user=<domain>, method=PLAIN, rip=172.22.1.16, lip=172.22.1.250, TLS, TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)

Using TLS, the log Apr 26, 15:30:02 Error fetching email Error: connection failed; File: /www/html/overrides/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php (82)

Dovecot: dovecot-mailcow-1 | dovecot: imap-login: Disconnected: Too many invalid commands (no auth attempts in 0 secs): user=<>, rip=172.22.1.16, lip=172.22.1.250

Using none encryption: Apr 26, 15:34:04 | Error fetching email | Error: connection setup failed; File: /www/html/vendor/webklex/php-imap/src/Client.php (391)

Dovecot: dovecot-mailcow-1 | dovecot: imap-login: Disconnected: Aborted login by logging out (auth failed, 1 attempts in 0 secs): user=<domain>, rip=172.22.1.16, lip=172.22.1.250

freescout-helpdesk commented 2 weeks ago

Try to add APP_NEW_FETCHING_LIBRARY=true parameter to the .env file and clear cache.

torrelasley commented 2 days ago

I am receiving the same error:

Error fetching email Error: connection failed; File: /www/html/overrides/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php (82)

This started today after upgrading from 1.8.139 to 1.8.140

I tried adding the APP_NEW_FETCHING_LIBRARY=true parameter and clearing the cache, however the error persists. I did not change any settings before or after upgrading to 1.8.140.

Any other suggestions?

torrelasley commented 2 days ago

I looked over the code changes from 1.8.139 to 1.8.140 and see that APP_NEW_FETCHING_LIBRARY is now defaulted to "true".

In case it helps anyone else reading this, my issue was resolved by setting APP_NEW_FETCHING_LIBRARY=false and clearing the cache.

freescout-helpdesk commented 1 day ago

@torrelasley What email service are you using? Can you send the screenshot of your Fetching settings.

In the future the old fetching library will be removed, so better to make sure you are able to fetch via the new library.

Try the following: 1) Remove APP_NEW_FETCHING_LIBRARY parameter from the .env file. 2) Clear cache. 3) Go to your mailbox's "Fetching Emails" settings and try different "Encryption" options:

2024-05-18_07-40-50

torrelasley commented 1 day ago

I followed your steps and removed APP_NEW_FETCHING_LIBRARY and cleared the cache.

Switching to STARTTLS worked for my system!

Note that you must click "Save Settings" after making the change before pushing the "Check Connection" button. At first I thought none of the Encryption settings would work until I realized this.

Unfortunately I didn't take a screenshot before I made the change so I don't know how it was previously set. Thank you for your help!