salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.45k stars 2.08k forks source link

testing email on email settings page locks up crm session until php execution timeout expires #9984

Open kale1d0code opened 1 year ago

kale1d0code commented 1 year ago

Issue

When testing email settings for EmailMan config. the modal window gets stuck with the message "one moment please"

all other tabs using the same session will then freeze when navigating to a different page until the php execution timeout expires for when the email settings was tested

Expected Behavior

in an event of an issue with email settings the modal window will display information regarding the issue and allow for the crm to be used

Actual Behavior

in certain situations (selecting TLS or SSL) will cause the test to freeze the users session across all tabs

Possible Fix

Steps to Reproduce

  1. add email settings
  2. select TLS or SSL
  3. click SEND TEST EMAIL
  4. enter test address and send

Context

Takes much longer than necessary to connect email to CRM

Your Environment

pgorod commented 1 year ago

At the time when it hangs, are there are relevant messages in php_errors.log or suitecrm.log?

What about in the browser, do you see errors in the Javascript console?

kale1d0code commented 1 year ago

Hi pgorod when the timeout is eventually reached. the following is printed in the suitecrm.log Fri Mar 17 15:44:15 2023 [59117][62045295-ed77-fe11-517c-5aa251e3979f][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not connect to SMTP host. Fri Mar 17 15:44:15 2023 [59117][62045295-ed77-fe11-517c-5aa251e3979f][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not connect to SMTP host

the JavaScript console displays the typical warnings Suite generates like Found 6 elements with non-unique id #query_string Found 3 elements with non-unique id #searchform but nothing which indicates it is interferring with the test.

same with PHP logs just the general SuiteCRM warnings no fatals or errors PHP Warning: include(metadata/securitygroups_usersMetaData.php): Failed to open stream: No such file or directory PHP Warning: include(metadata/securitygroups_defaultsMetaData.php): Failed to open stream: No such file or directory

pgorod commented 1 year ago

That looks like an SMTP issue. SuiteCRM is trying to talk SMTP to the address:port you provided, and it looks like

gunnicom commented 1 year ago

@pgorod I think the problem here ( I stumbled across, too ) is that the test is done synchronous, thus blocking. Would be better if it is done async not blocking the session.

pgorod commented 1 year ago

Ok... but you mean that is an additional problem, on top of the SMTP problem, right? That there is a SMTP timeout, and additionally that the UI doesn't handle it gracefully?

gunnicom commented 1 year ago

@pgorod I do not think there is an SMTP problem. It is just the blocking of the session that is quite annoying.

chris001 commented 1 year ago

That looks like an SMTP issue. SuiteCRM is trying to talk SMTP to the address:port you provided, and it looks like

* it doesn't exist

* or the DNS can't resolve the name to an IP address

* or that server is not reachable

* or the server is reachable but is not listening on that port

Could someone update the SugarMailer error message to print more detailed information than just that generic SMTP Error: Could not connect to SMTP host ?

First, print the SMTP host name and port it was trying to connect to!

Second, OK it couldn't connect, but print why exactly?
Host doesn't exist?
DNS error?
SMTP server not reachable ie IP address won't connect?
Port is not listening with SMTP hello message?

This more detailed error message would go a long way to identifying the exact cause of this issue.