Hello,
When a use creates an e-mail account, in the SMTP config part, for a STARTTLS server, the test connection is made with a timeout of two (2) seconds, which is abusively short.
The error message is rather cryptic:
17:03:12: Trying STARTTLS connection to smtp.company.com:587 …
Error when communicating with the server. (2)
This setting is okay when attempting autodetection, but it is much too short when the user has clicked on “Manual entry”, especially since there is no way to bypass this check and force the config to accept the given settings. Our server is slightly slow when connecting, and because of that we were unable to setup e-mail accounts.
This timeout is located in /usr/share/egroupware/emailadmin/inc/class.emailadmin_wizard.inc.php line 32.
We tried setting up the account with another server, and then changing the server name and port to ours, and sending e-mails work after that, so a correct timeout is provided when sending e-mails, the problem arises just with the test connection script.
Please fix this by using the same timeout for the test connection as for when sending e-mails, at least when the user has clicked on “Manual entry”.
Also, Horde provides more detailed information about the error, when it throws an exception in /usr/share/egroupware/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp/Connection.php it fills in the info $this->_params[‘debug’]->info(“ERROR: Server read/timeout error.”); which would have been nice to have. Showing the timeout and other relevant connection details could be nice, too.
1) /usr/share/egroupware/json.php(106): egw_json_request->parseRequest('mail.etemplate_...', '{"request":{"pa...')
2) /usr/share/egroupware/phpgwapi/inc/class.egw_json.inc.php(82): egw_json_request->handleRequest('mail.etemplate_...', Array)
3) /usr/share/egroupware/phpgwapi/inc/class.egw_json.inc.php(163): call_user_func_array(Array, Array)
4) [internal function]: etemplate_new->ajax_process_content('mail_gduperon_5...', Array, false)
5) /usr/share/egroupware/etemplate/inc/class.etemplate_new.inc.php(319): ExecMethod('mail.mail_wizar...', Array)
6) /usr/share/egroupware/phpgwapi/inc/common_functions.inc.php(1055): call_user_func(Array, Array)
7) [internal function]: emailadmin_wizard->smtp(Array)
8) /usr/share/egroupware/emailadmin/inc/class.emailadmin_wizard.inc.php(732): Horde_Mail_Transport_Smtphorde->getSMTPObject()
9) /usr/share/egroupware/vendor/pear-pear.horde.org/Horde_Mail/Horde/Mail/Transport/Smtphorde.php(160): Horde_Smtp->login()
10) /usr/share/egroupware/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp.php(416): Horde_Smtp->_getResponse(220, Array)
11) /usr/share/egroupware/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp.php(1043): Horde_Smtp_Connection->read()
12) /usr/share/egroupware/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp/Connection.php(138): Horde_Smtp_Connection->generateCallTrace()
Thank you,
Georges Dupéron