New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
TroubleshootingUpdated 26 Oct 2026

421 4.4.2 Timeout and Lost Connection Errors: Why SMTP Sessions Drop and How to Fix Them

Causes of SMTP timeouts and 421 4.4.2 connection closed errors: idle timeouts, slow DNS or reverse lookups, firewalls and MTU problems, large messages, overloaded servers, and a step-by-step diagnosis for senders and administrators.

JL
Written by Jonas Lindqvist
Security Engineer
Reviewed by Karan Malhotra
  • Published1 Oct 2025
  • Read time7 min
  • Length1,350 words
Share this guide

An SMTP conversation is a dialogue between two machines, and either side may hang up when the other takes too long or when something in between cuts the line. The result appears in logs and bounces as 421 4.4.2 Timeout waiting for client input, 421 4.4.2 Connection timed out, 4.4.1 Connection timed out, lost connection with remote host while sending end of data or simply a client-side message about a read timeout. These are temporary failures, so a well-behaved sender queues the message and retries. When they persist, they point to a problem in the path: a slow or failing DNS lookup, a firewall that drops packets, a mismatch in packet size, an overloaded receiver, a message too big for the timeouts in force or a client that sits idle too long. This guide explains the different stages where timeouts occur, how to tell them apart from the log and the reply, how to test each hypothesis with simple commands and what to change on the sending and receiving sides.

Class4xx temporary: retry later; persistent timeouts need a cause found
Where it happensConnection, greeting, TLS handshake, commands, DATA transfer or after the final dot
Common causesFirewall or routing, slow DNS or reverse lookups, MTU issues, big messages, overloaded server, idle clients
MethodTime each stage with openssl or telnet, then change one thing at a time

Stages where a timeout can occur

StageWhat is happeningTypical symptom
TCP connectClient opens a connection to port 25, 465 or 587Connection timed out; no greeting at all
Greeting bannerServer sends 220 after accepting the connectionDelay before 220; some servers pause deliberately or perform lookups first
EHLO and STARTTLSCapabilities exchange and TLS handshakeHang after STARTTLS; handshake never completes
AuthenticationClient sends credentialsDelay while the server consults a slow directory
MAIL FROM / RCPT TOAddresses are checked by the serverDelay while the server does DNS or policy lookups
DATA transferClient sends the message bodyTimeout mid-transfer, often for large messages or slow links
After the final dotServer processes the message and replies 250Timeout waiting for the response; message may or may not be accepted
Idle between messagesPooled connection sits unused421 4.4.2 Timeout waiting for client input

The distinction matters. A timeout before the greeting points to the network or the server being down. A pause after RCPT TO suggests the receiver is performing slow lookups on you. A timeout after the final dot is the most delicate, because the server may have accepted the message but the client never saw the 250; a blind retry then sends a duplicate. See SMTP connection pooling for idle handling and reliable sending queues for idempotency.

Diagnosing from the client

# 1. Can we reach the port at all? (time the stages)
time nc -vz mail.example.net 25

# 2. See the greeting and EHLO response (plain text)
openssl s_client -starttls smtp -connect mail.example.net:25 -crlf -servername mail.example.net

# 3. Trace the path to find where packets stop
mtr -rwz -c 20 mail.example.net

# 4. Test packet size problems: try a do-not-fragment ping of typical size
ping -M do -s 1472 mail.example.net

If step 1 fails or hangs, the connection is blocked or the host is down; check outbound firewall rules, your provider's policy on port 25 and the server's status. See why port 25 is blocked. If the greeting arrives slowly, the server is busy or performs lookups before replying. If the session dies right after STARTTLS, suspect a TLS problem: see SMTP timeouts and TLS errors and certificate errors. If the large DATA transfers fail while small messages succeed, suspect MTU or size limits.

MTU and fragmentation

A classic cause of sessions that start fine and then hang is a path MTU problem. Small commands fit in one packet; the message body fills larger packets, which a router or tunnel along the path cannot carry, and if ICMP "fragmentation needed" messages are blocked by a firewall, the sender never learns to use smaller packets. The connection hangs during DATA until a timeout. VPNs, tunnels and some cloud networks reduce the MTU below 1500. The fix is to allow the relevant ICMP messages, or to lower the MTU or enable MSS clamping on the gateway. The ping test above, with decreasing sizes, shows the largest packet that passes.

Slow DNS and reverse lookups

Receiving servers often look up your IP's reverse DNS, your HELO name and blocklists while the session is open. If their resolvers are slow, or if your reverse DNS name servers are unresponsive, the server waits and may time out. Similarly, your own server needs MX and A lookups before it can connect, and a slow resolver makes every delivery slow. Check that your DNS servers respond quickly and that the PTR record for your IP exists and its name servers answer. See reverse DNS and Gmail 550 5.7.25. On the receiving side, set sensible DNS timeouts for blocklist lookups so that a failing list does not stall your own server.

Idle timeouts and pooled connections

Servers close sessions that sit idle, typically after a few minutes, and they say so with 421 4.4.2 Timeout waiting for client input. Applications that keep a connection open between bursts of mail will see this error on the next send. The remedy is to detect the closed connection, reconnect and retry that message, to send a NOOP command now and then to keep the session alive or to close sessions when idle. Mind that the client must treat the 421 as the end of the session: after a 421 reply the server closes the connection, and further commands will fail.

A message with big attachments takes time to transfer and to scan. Both sides have timeouts for the DATA phase and for the response after the final dot, which may be long (the standard recommends ten minutes for the final reply) but is shorter on some configurations. If large messages fail while small ones succeed, reduce the size, link to files instead, or ask the administrator to raise the timeouts. See size limits and attachments and spam filters. On the sending side, make sure your own queue does not have a short per-connection timeout that cuts transfers on slow links.

Overloaded or throttling receivers

When a receiver is under heavy load, or when it deliberately slows connections from senders it distrusts (a tactic called tarpitting), the symptoms are slow responses and timeouts. They often come with 4xx replies about rate or reputation. Reduce your connection count, lower your rate to that domain and check your reputation and blocklist status with the blacklist check. See email throttling and 421 try again later.

Settings to review

SideSettingNotes
Sender (Postfix)smtp_connect_timeout, smtp_helo_timeout, smtp_data_done_timeoutDefaults are generous; raise only with evidence
Sender (application)Library socket timeout, for example 30 secondsToo short breaks slow servers; too long ties up workers
Receiver (Postfix)smtpd_timeout, smtpd_starttls_timeoutIdle and TLS handshake limits
FirewallConnection tracking timeoutsIdle connections may be dropped silently by a stateful firewall or NAT
Load balancerIdle timeout on TCP listenersMust exceed the longest expected pause
ResolverTimeout and retry countsSlow resolvers multiply every delay

A stateful firewall or NAT gateway that discards idle connections without sending a reset causes particularly confusing symptoms: the client believes the session is open, sends data and waits forever. Enabling TCP keep-alives on the client with an interval shorter than the firewall timeout prevents this.

What the sender should do with the retry

  1. Treat the failure as temporary and keep the message queued.
  2. Retry with increasing delays, from the same IP.
  3. If the failure happened after the final dot, check your logs or the recipient before assuming that the message was not delivered. Use unique Message-IDs so that duplicates can be recognised. See Message-ID header.
  4. Give up after the maximum queue time and report the last error.
  5. Alert on a rising share of timeouts; it is often the first sign of a path problem.

Timeouts look mysterious until you divide the session into stages and time each one. Test the connection, the greeting, the TLS handshake and a small and a large message in turn, and the stage at which the delay or break appears usually names the cause.

Skip the network plumbing Send through a relay with maintained connectivity and clear delivery logs.

Explore the SMTP relay

References and further reading

Frequently asked questions

What does 421 4.4.2 mean?

The server closed the connection, often because the client was idle too long or the session timed out. It is temporary, so reconnect and retry.

Why do small emails work but large ones time out?

Large messages take longer to transfer and scan, and path MTU problems or short timeouts show up only with big packets.

Why does the connection hang after STARTTLS?

A TLS problem, a firewall that mishandles the handshake or an MTU issue. Test with openssl s_client.

Can a timeout cause duplicate emails?

Yes, if the server accepted the message but the client did not see the 250 reply and retried. Use unique message IDs and idempotent queues.

How do I keep pooled SMTP connections from timing out?

Send NOOP periodically, close idle connections or reconnect on 421 and retry the message.

Topics#smtp errors#421#timeout#connection#diagnosis
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales