freescout-help-desk / freescout

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

Error fetching and sending emails #2482

Closed marianmurin closed 1 year ago

marianmurin commented 1 year ago

I have a problem after installing grive app to fetch and receive emails in Freescout. I am using Gsuite email for helpdesk.

Fetch errors: Error: imap_open(): Couldn't open stream {imap.gmail.com:993/imap/novalidate-cert/ssl}. Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Invalid credentials (Failure); Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Invalid credentials (Failure); Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure); File: /www/wwwroot/helpdesk.improve.sk/overrides/webklex/laravel-imap/src/IMAP/Client.php (230)

Send errors: Failed to authenticate on SMTP server with username "support@improve.sk" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials dk11-20020a0564021d8b00b0046c91fa5a4asm6126442edb.70 - gsmtp " in /www/wwwroot/helpdesk.improve.sk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:457 Stack trace: #0 /www/wwwroot/helpdesk.improve.sk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(341): Swift_Transport_AbstractSmtpTransport->assertResponseCode() #1 /www/wwwroot/helpdesk.improve.sk/overrides/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(305): Swift_Transport_AbstractSmtpTransport->executeCommand() #2 ....

Snímka obrazovky 2022-12-20 o 21 10 29 Snímka obrazovky 2022-12-20 o 21 11 00
freescout-helpdesk commented 1 year ago

Check these: https://github.com/freescout-helpdesk/freescout/wiki/Fetching-Emails#troubleshooting-fetching-issues https://github.com/freescout-helpdesk/freescout/wiki/Sending-Issues https://github.com/freescout-helpdesk/freescout/wiki/Connect-G-Suite-to-FreeScout

marianmurin commented 1 year ago

I have already checked that and tried almost everything, but with no luck. I have even talk 2 hours with Google with the same result. They talk about some certificate which is needed to communicate with Gmail server, but I did n ot find anything about this server stuff on the forum and our knowledgebase.

Could tbis be related with OpenSSL ON MY VPs?

freescout-helpdesk commented 1 year ago

Fetching and sending errors are indicating that your credentials were not accepted. It means your server is able to connect and OpenSSL is not a problem. Are you using App Passwords?

marianmurin commented 1 year ago

Yes, I am using App Password 2FA is turned ON. I am attaching screebshot from connection setting for fetching and sending.

Snímka obrazovky 2022-12-21 o 13 58 33 Snímka obrazovky 2022-12-21 o 13 58 45
minghuiyu commented 1 year ago

Sometimes, for whatever reason, fetching emails failed, and error below

Error fetching email | Error: connection setup failed; File: .. ... /vendor/webklex/php-imap/src/Client.php (391)

I also sometimes have this issue.

Whenever this error happens, system shows 2 cron jobs are running and one process shall be killed.

Whenever 2 cron jobs are running, server CPU utilization goes to 100%.

Questions:

  1. How to prevent the error from happening? (It happens a few times a week. I have multiple mailboxes and frequency is 1 min each mailbox, so I would say it is an infrequent error)
  2. Where to get the specific error logs? e.g.: which email fetching produced the error, and why? (I checked Manage->log->fetch email, but no useful information)
  3. When it happens, how to kill the process automatically?

Thanks!

freescout-helpdesk commented 1 year ago

Try to change App Password. Are you using GSuite or you've somehow set a custom domain (support@improve.sk) for a regular Gmail?

marianmurin commented 1 year ago

I have already changed App password, but It does not help. 2FA is trun ON and I am using paid GSuite.

freescout-helpdesk commented 1 year ago

We don't have any other ideas.

marianmurin commented 1 year ago

Me neither