Overview
Sometimes users report that their emails are not getting sent to external mail servers, domains, or recipients. The warning log shows dozens of entries similar to this:
[14/Jul/2019 14:50:43] Cannot connect to SMTP server <server_name>. Messages will stay in the message queue.
In such a situation, Message Queue in Kerio Connect Webadmin is full of emails with status 4.4.1 Cannot connect to host.
Requirements
- Access to Kerio Connect server
- Access to firewall settings
Root Cause
A firewall is blocking communication from the Kerio Connect server to External Mailservers.
Resolution
To resolve the connection issue:
-
Check MX records for Kerio Connect domain (using the MX Lookup Tool). The records should be pointing to the correct mail server. The first record should be starting from
mail.connect_domain.com
-
Enable additional Debug logs.
- Open Kerio Connect Webadmin.
- Navigate to Logs > Debug, right-click on logs area, and click on Clear Log.
- Right-click on logs and click on Messages.
- Enable SMTP Server, SMTP client, and Queue processing.
- Send a test email to the (desired) outside email address.
- Gather Debug logs: Navigate to Logs > Debug, right-click on logs and click on Save Log.
- Generate Support Information file by navigating to Status > System Health > Support Information.
- Analyze Debug logs. You will see an output with messages similar to the below:
[14/Jul/2019 19:22:31][123145371508736] {qproc} SEND_REMOTE: Started delivery of queued message id=5d2be366-00000000 sender=<username@connect_domain.com>
[14/Jul/2019 19:22:31][123145371508736] {qproc} The default MX delivery rule is applied for sender <username@connect_domain.com> and recipient <ext_user@external_domain.com>
[14/Jul/2019 19:22:31][123145371508736] {qproc} Scheduling recipient: ext_user@external_domain.com to a batch in rule 'external_domain.com'
[14/Jul/2019 19:22:31][123145371508736] {smtpc} Connecting to server mail.external_domain.com (<ip_address_of_external_server>:25) using local interface 0.0.0.0 ...
[14/Jul/2019 19:23:45][123145371508736] {smtpc} Deliver mail: Cannot connect to SMTP server. User: , server: mail.external_domain.com
[14/Jul/2019 19:23:45][123145371508736] {qproc} SEND_MX: Result for recipient ext_user@external_domain.com: delayed, Status: 4.4.1 Cannot connect to host - Try to telnet to
external_domain.com
.
telnet external_domain.com 25
The connection will be refused. - Check Firewall or Antivirus settings to allow traffic flowing from SMTP standard port (25) to the outside world (external servers).
Confirmation
If everything is okay, you will see ESMTP ready output while performing Telnet.
Additional Information
For more information about Firewall setup, refer to Securing Kerio Connect - section 'Configuring your firewall'.
If you are using Kerio Control in front of Kerio Connect, please refer to Configuring Kerio Control Firewall to allow Kerio Connect services.
Priyanka Bhotika
Comments