Trace Zimbra’s Deferred Mail to a Port 25 Timeout

When Zimbra reports Connection timed out to a recipient mail server on TCP port 25, test the outbound network path from the Zimbra MTA before changing Postfix settings. A timeout while opening the TCP connection usually points to a dropped or unreachable network path; the affected message remains deferred for retry. Identify whether Zimbra connects directly to recipient MX servers or to a configured relay, then correct the blocked hop.

The procedure below uses example hostnames and terminal output for illustration, not as a real server test. Port 25 is the standard SMTP transport port for mail transfer between servers. A failed TCP connection is different from an SMTP server rejecting a sender after the connection has been established.

1. Match the deferred queue entry to its log error

On the Zimbra MTA host, inspect the queue as the zimbra user:

su - zimbra
/opt/zimbra/common/sbin/postqueue -p

Note a recipient domain and queue ID, but do not delete or requeue messages yet. Zimbra’s Admin Console also displays queue contents under Monitor > Mail Queues. The Daffodil v10 Administrator Guide explains that messages which cannot be delivered enter the deferred queue and are scanned again for delivery.

Next, look for the matching Postfix SMTP error in the Zimbra syslog:

grep -Ei 'connect to .*:25.*timed out|status=deferred' /var/log/zimbra.log | tail -n 20

Use the queue ID, recipient domain, destination hostname, and destination IP together. Zimbra’s guide documents /var/log/zimbra.log as the syslog destination for Zimbra components, including MTA activity. If your host routes syslog elsewhere, search the configured log destination instead.

A terminal shows the Zimbra queue listing followed by a separate sample log search with a port 25 timeout; the values are illustrative.
The queue entry and separate log excerpt show what to correlate before changing settings.

A log entry that says the connection to mx.example.net[IP]:25 timed out means the SMTP client did not complete a TCP connection before its deadline. Postfix’s documented smtp_connect_timeout is a connection-establishment limit; changing it only makes the wait longer or shorter. It does not restore a blocked route.

2. Find the actual next hop

Do not assume the recipient MX is the destination. Zimbra can send nonlocal mail directly using DNS MX lookups or route it through a relay, also called a smart host. Check the effective outbound path in the Administration Console under Configure > Global Settings > MTA > Network. If your deployment has per-server MTA settings, check the MTA server’s configuration as well.

If DNS lookup is enabled and no relay is configured, resolve the recipient domain’s MX records:

dig +short MX example.net

Test the MX hosts returned for the domain, starting with the lowest preference number. If a relay is configured, test that relay’s hostname and configured port instead. Zimbra’s guide distinguishes the Relay MTA for external delivery from the Webmail MTA setting; changing the webmail MTA does not repair server-to-server outbound delivery.

A terminal runs dig for example.net and lists two sample MX hosts; the DNS output is illustrative.
Resolve the recipient domain’s MX records before testing a specific destination host.

3. Test TCP port 25 from the MTA itself

Run the connection test on the Zimbra MTA host, because a test from a laptop or a different server does not use the same firewall, NAT, or provider route. If nc is installed, use an MX hostname from the preceding lookup:

nc -vz -w 5 mx1.example.net 25

Repeat against the domain’s other MX hosts and, if useful, a second unrelated recipient domain. If you use a smart host, test its configured port instead of guessing that it uses 25. A successful TCP connection confirms that a socket opened; it does not prove the relay accepts your sender, credentials, or TLS policy.

A terminal runs nc against an example MX on TCP port 25 and displays a timeout; the result is illustrative.
A TCP test from the MTA helps separate a network timeout from an SMTP rejection.

Interpret the pattern before making changes:

  • Timeout to several unrelated MX hosts: investigate outbound firewall rules, network ACLs, routing, NAT, and any provider-level SMTP egress restriction.
  • Timeout to one MX host only: check another MX for that domain and compare results with other destinations; the problem may be isolated to that remote host or route.
  • Connection succeeds but delivery is still deferred: read the full SMTP response in the log. A later 4xx response, TLS failure, or policy rejection requires a different fix than a TCP timeout.

4. Correct the blocked hop and verify delivery

If outbound TCP/25 is blocked, allow the required outbound traffic at the layer that is dropping it: the host firewall, cloud security rules, network firewall, egress gateway, or hosting provider. Confirm that the rule applies to the MTA’s source address and intended destinations. This is an outbound-delivery issue; opening inbound port 25 alone will not fix it. If the provider does not permit direct SMTP delivery, ask for an approved relay service or an egress exception.

When using an external relay, enter the relay host in Zimbra’s Relay MTA for external delivery setting, following the relay provider’s requirements for port, TLS, and authentication. Do not simply change a port number and assume authentication is configured. Use an approved credential method, restrict who can relay, and check the setting carefully to avoid creating a mail loop. Zimbra documents this relay field in the v10 Admin Guide.

The Zimbra Administration Console shows Configure, Global Settings, MTA, Network, and the Relay MTA for external delivery field with an example relay.
The documented Relay MTA field is where an approved external relay is configured; the example value is not a recommended provider.

After the network or relay change, let the deferred queue retry. Zimbra’s documentation says that queue is scanned regularly; there is usually no need to restart all Zimbra services for a network-path fix. Avoid repeatedly flushing the whole queue as a diagnostic shortcut because it triggers immediate attempts across deferred, incoming, and active mail.

Verify the result in Monitor > Mail Queues and in /var/log/zimbra.log. The affected message should leave the deferred queue after successful delivery, and a new test message to an external mailbox should arrive. If the same destination still times out, capture the MX hostname, resolved IP, source MTA, timestamp, and TCP test result for the network or hosting team. If the TCP connection succeeds but the remote server returns an SMTP error, follow that response rather than changing firewall rules.

References: Zimbra Daffodil v10 Administrator Guide: MTA, queues, and logs; Postfix configuration parameters: smtp_connect_timeout; Postfix postqueue manual; RFC 5321: Simple Mail Transfer Protocol.

Leave a Comment

How to