Exchange ServerDeep dive

Exchange Server queue LastError messages: a quick reference for stuck queues

Decode a stuck Exchange queue: what 441 4.4.1, Winsock 10061, 454 4.7.0 Temporary authentication failure, Retry, the Unreachable queue and 30 more mean, and the first check.

When mail stops leaving an Exchange server, the queue's LastError usually tells you why, but in a compressed form: an SMTP code, a socket error, a remote server's reply in quotes or just a queue state. This quick reference decodes the LastError texts and queue states admins meet on Exchange Server SE, 2019 and 2016: what each means, the usual cause and the first check, with links to the detailed guides.

Codes in this quick reference

  • 441 4.4.1 Error encountered while communicating with primary target IP address: the connection to the next hop failedGet-Queue LastError / Queue Viewer
  • Failed to connect. Winsock error code: 10060, Win32 error code: 10060.Get-Queue LastError
  • Attempted failover to alternate host, but that did not succeed.Get-Queue LastError
  • Either there are no alternate hosts, or delivery failed to all alternate hosts.Get-Queue LastError
  • 451 4.4.0 Error encountered while communicating with primary target IP address: "421 4.4.2 Connection dropped due to SocketError."Get-Queue LastError
  • Winsock error code: 10061 WSAECONNREFUSED: the target computer actively refused the connectionGet-Queue LastError (Failed to connect)
  • Winsock error code: 10054 WSAECONNRESET: connection reset by peer (forcibly closed by the remote host)Get-Queue LastError (Failed to connect)
  • Winsock error code: 10053 WSAECONNABORTED: software caused connection abort on the local hostGet-Queue LastError (Failed to connect)

+ 27 more codes in the tables below.

How this guide is organized: How to read a LastError → Connection failures → Winsock codes in "Failed to connect" → Remote replies → Routing, DNS and special queues → Queue states and delivery types → Related errors with their own guides → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read a LastError. 2. Connection failures. 3. Winsock codes in "Failed to connect". 4. Remote replies. 5. Routing, DNS and special queues. 6. Queue states and delivery types. 7. Related errors with their own guides. 8. How to verify a fix. Toolbox: Event ID 1035, Event ID 12014, Get-Queue, Retry-Queue, Get-Message.1How to read aLastError2Connection failures3Winsock codes in"Failed to connect"4Remote replies5Routing, DNS andspecial queues6Queue states anddelivery types7Related errors withtheir own guides8How to verify a fixTOOLBOXEvent ID 1035Event ID 12014Get-QueueRetry-QueueGet-MessageHow this guide is organized: How to read a LastError → Connection failures → Winsock codes in "Failed to connect" → Remote replies → Routing, DNS and special queues → Queue states and delivery types → Related errors with their own guides → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read a LastError. 2. Connection failures. 3. Winsock codes in "Failed to connect". 4. Remote replies. 5. Routing, DNS and special queues. 6. Queue states and delivery types. 7. Related errors with their own guides. 8. How to verify a fix. Toolbox: Event ID 1035, Event ID 12014, Get-Queue, Retry-Queue, Get-Message.1How to read a LastError2Connection failures3Winsock codes in "Failed to connect"4Remote replies5Routing, DNS and special queues6Queue states and delivery types7Related errors with their own guides8How to verify a fixTOOLBOXEvent ID 1035Event ID 12014Get-QueueRetry-QueueGet-Message
At a glance: how this guide is organized · 8 sections · 5 key settings and tools

How to read a LastError#

Reading a queue's LastError by its wordingDoes the queue show a LastError text? if No, just a state: Decode the queue state (Look up its Status and DeliveryType instead); if Yes: Which phrase does the LastError contain? if Error encountered: The connection itself failed (Look up the Winsock code or socket error in the quoted text); if Responded with: The remote server answered and refused (The quoted text is its SMTP reply; look it up on the receiving side); if Attempted failover: Exchange already tried other hosts (Other MX hosts, addresses or smart hosts; {LED=...} holds the error)Does the queue show aLastError text?NOTEDecode the queue stateLook up its Status andDeliveryType insteadNo, just a stateWhich phrase does theLastError contain?NOTEThe connection itselffailedLook up the Winsock codeor socket error in thequoted textError encounteredNOTEThe remote serveranswered and refusedThe quoted text is its SMTPreply; look it up on thereceiving sideResponded withNOTEExchange already triedother hostsOther MX hosts, addressesor smart hosts; {LED=...}holds the errorAttempted failoverYesReading a queue's LastError by its wordingDoes the queue show a LastError text? if No, just a state: Decode the queue state (Look up its Status and DeliveryType instead); if Yes: Which phrase does the LastError contain? if Error encountered: The connection itself failed (Look up the Winsock code or socket error in the quoted text); if Responded with: The remote server answered and refused (The quoted text is its SMTP reply; look it up on the receiving side); if Attempted failover: Exchange already tried other hosts (Other MX hosts, addresses or smart hosts; {LED=...} holds the error)Does the queue show a LastError text?No, just a stateNOTEDecode the queue stateLook up its Status and DeliveryType insteadYesWhich phrase does the LastError contain?Error encounteredNOTEThe connection itself failedLook up the Winsock code or socket error in thequoted textResponded withNOTEThe remote server answered and refusedThe quoted text is its SMTP reply; look it up onthe receiving sideAttempted failoverNOTEExchange already tried other hostsOther MX hosts, addresses or smart hosts;{LED=...} holds the error
Figure 1 · Decision tree Reading a queue's LastError by its wording. Get-Queue, Get-Message and Queue Viewer show the text. Read it early: by default senders get a delay notice after four hours and an NDR after two days.
  • Where: Get-Queue shows the queue's last error, Get-Message the error for each message, and Queue Viewer in the Exchange Toolbox shows both in the Last Error column.
  • "Error encountered while communicating with primary target IP address": the connection itself failed. The quoted text gives a Winsock code or a socket error.
  • "Primary target IP address responded with": the remote server answered, and the text in quotes is its SMTP reply. Look that reply up, on the receiving side.
  • "Attempted failover to alternate host": Exchange already tried the other MX hosts, addresses or smart hosts. On recent builds the text is often wrapped in fields such as {LED=...} (the error) and {FQDN=...} (the host).
  • Time pressure: by default senders get a delay notice after four hours and an NDR after two days, so read LastError early.
PowerShell
Get-Queue -Server EX01 | Where-Object { $_.MessageCount -gt 0 } |
    Format-Table Identity, DeliveryType, Status, MessageCount, Velocity, NextHopDomain -AutoSize
Get-Queue -Identity "EX01\fabrikam.com" |
    Format-List DeliveryType, NextHopDomain, Status, LastError, LastRetryTime, NextRetryTime
Get-Message -Queue "EX01\fabrikam.com" | Format-Table FromAddress, Status, RetryCount, LastError -AutoSize
Get-QueueDigest -Dag DAG01

Get-QueueDigest summarizes queues across servers; by default it lists delivery queues with ten or more messages.

Connection failures#

LastErrorMeaningUsual causeFirst check
441 4.4.1 Error encountered while communicating with primary target IP addressExchange couldn't hold an SMTP connection with the next hopOutbound port 25 blocked, remote host down, smart host unreachableTest-NetConnection <IP> -Port 25 from each source server (441 guide)
Failed to connect. Winsock error code: 10060, Win32 error code: 10060.The TCP connection timed out: nothing answeredFirewall, NAT or provider blocking port 25, or the host is downThe same test from outside your network
Attempted failover to alternate host, but that did not succeed.The other MX hosts, addresses or smart hosts failed tooAll targets share one problem, often your own egressTest each target address
Either there are no alternate hosts, or delivery failed to all alternate hosts.No other target existed, or every one failedOne smart host or one MX recordAdd a second smart host where you control routing
451 4.4.0 Error encountered while communicating with primary target IP address: "421 4.4.2 Connection dropped due to SocketError."The connection opened but broke during the sessionTLS negotiation, firewall SMTP inspection, MTU problems on large messagesSend protocol log (protocol logging guide)

Winsock codes in "Failed to connect"#

CodeMeaning (Microsoft)Usual cause in a queueFirst check
10061 WSAECONNREFUSEDConnection refused: the target actively refused it, usually because nothing is listeningRemote SMTP service stopped, wrong connector port, or a device rejecting port 25Test-NetConnection to that port; the connector's Port
10054 WSAECONNRESETConnection reset by peer: the remote host forcibly closed itRemote restart, or a firewall or IPS cutting the sessionThe protocol log step where it resets
10053 WSAECONNABORTEDSoftware on this server aborted the connection, possibly after a time-out or protocol errorLocal time-outs or security softwareA small test message; local security software
10051 WSAENETUNREACHNetwork is unreachable: no known routeMissing default gateway or route, VPN downGet-NetRoute -DestinationPrefix 0.0.0.0/0
10065 WSAEHOSTUNREACHNo route to hostRouting to that one hostTest-NetConnection <IP> -TraceRoute
10050 WSAENETDOWNNetwork is down: the stack, interface or local network failedNIC or network failure on the serverAdapter status; System log
10013 WSAEACCESPermission denied: socket access forbidden by its access permissionsA local firewall rule or security product blocking outbound SMTPHost firewall and antivirus rules for port 25

Remote replies: "Primary target IP address responded with"#

LastErrorMeaningUsual causeFirst check
451 4.4.0 Primary target IP address responded with: "421 4.4.1 Connection timed out."The session with the next hop timed outMicrosoft documents a TLS certificate not enabled for SMTP; the send log shows TLS negotiation failed with error UnknownCredentialsGet-ExchangeCertificate | fl Thumbprint,Services
451 4.4.0 Primary target IP address responded with: "454 4.7.0 Temporary authentication failure."Another Exchange server refused Exchange authenticationClocks more than 5 minutes apart, AD replication, SMTPSVC SPN problems, blocked Kerberos portssetspn -L <server>; setspn -X; time on servers and DCs
Event ID 1035: Inbound authentication failed with error IllegalMessage for Receive connectorThe receiving server's side of the 454 4.7.0 failure (mechanism ExchangeAuth)As above, or Exchange authentication off on the receive connectorGet-ReceiveConnector | fl Identity,AuthMechanism
421 4.3.2 The maximum number of concurrent server connections has exceeded a per-source limit, closing transmission channelThe receiving Exchange server hit its per-source connection limitOne server or gateway opening many parallel sessionsMaxInboundConnectionPerSource on the receiving connector (gateway guide)
421 Exceeded allowable connection time, disconnecting.A Cisco Secure Email Gateway public listener closed the session at its total connection time limitExchange relaying through a public listener, which applies these timersRelay through a private listener where the model has one (Cisco guide)
421 Timed out waiting for successful message injection, disconnecting.The public listener closed a connection that hadn't delivered a message in timeSlow or stalled sessions through a public listenerThe same listener choice; the protocol log for slow sessions

Routing, DNS and special queues#

LastError or queueMeaningUsual causeFirst check
DNS query failed with error InfoNoRecordsDNS returned no records of the type transport neededA domain without usable MX or A records, or an internal zone shadowing itResolve-DnsName <domain> -Type MX (DNS guide)
Unreachable queue (Unreachable Domain)Messages that can't be routed to their destinationConfiguration changes to the routing path: a removed connector, address space or domainRecent connector changes; messages resubmit when configuration updates arrive, unless the queue is suspended
Poison message queue (Poison Message)Messages judged harmful after a crash; never resumed or expired automaticallyTransport crashing on a message or a faulty agentApplication log crashes (poison guide)
Submission queue (Submission) growingAccepted messages waiting for the categorizerCategorization stalled: back pressure, agents, directory accessEvent ID 15004; Get-TransportAgent
Shadow queue (ShadowRedundancy) growingRedundant copies held until the primary server deliversThe primary server named in NextHopDomain is down or slowThat server's queues

Queue states and delivery types#

ValueMeaningUsual causeFirst check
Status: RetryThe last connection attempt failed; the queue waits to retryWhatever LastError saysNextRetryTime; Retry-Queue after a fix
Status: SuspendedSuspended by an administrator; messages stay until resumedMaintenance or troubleshooting left unfinishedResume-Queue
Status: Connecting that doesn't clearThe queue is still connecting to the next hopSlow or filtered connectionsThe 441 checks above
Velocity below 0, growing MessageCountMessages arrive faster than they leaveA slow or failing next hopIncomingRate and OutgoingRate
DnsConnectorDelivery in RetryExternal domain reached through MX lookupsDNS or port 25 problemsLastError; DNS and 441 guides
SmartHostConnectorDelivery in RetryThe smart hosts in NextHopDomain aren't accepting mailSmart host down, or authentication or TLS mismatchConnectivity and the smart host's logs
SmtpDeliveryToMailbox growingDelivery to the mailbox database named in NextHopDomain is stalledDatabase dismounted or failing over, or a delivery service problemGet-MailboxDatabaseCopyStatus; Get-Service MSExchangeDelivery
SmtpRelayToDag / SmtpRelayToRemoteActiveDirectorySite in RetryAn internal hop to another DAG or AD site failsWAN or firewall between sites, or Exchange authentication (454 4.7.0)Test-NetConnection <server> -Port 25
SmtpRelayWithinAdSiteToEdge in RetryThe hop to the Edge Transport server failsEdge unreachable, EdgeSync or certificate problemsEdgeSync guide
SmtpRelayToConnectorSourceServers in RetryThe Send connector's source server is another server, and it isn't reachableThat server down or refusing connectionsThe connector's source servers
SmtpRelayToServers in RetryMessages for a distribution group with a specific expansion server, named in NextHopDomainThe expansion server is down or retiredGet-DistributionGroup | fl Name,ExpansionServer
Message PendingRemove / PendingSuspendRemoved or suspended by an administrator while in transmissionNormal after Remove-Message or Suspend-MessageWait for the transmission attempt to end

How to verify a fix#

  1. Force a new attempt instead of waiting: Retry-Queue, with -Resubmit $true if you changed routing.
  2. Get-Queue shows the queue draining: MessageCount falling, Velocity above 0 and no new LastError.
  3. Message tracking shows SEND or DELIVER events for the stuck messages (message tracking guide).
PowerShell
Retry-Queue -Identity "EX01\fabrikam.com" -Resubmit $true
Get-Queue -Identity "EX01\fabrikam.com" | Format-List Status, MessageCount, Velocity, LastError
Get-MessageTrackingLog -Server EX01 -EventId SEND -Start (Get-Date).AddHours(-1) |
    Format-Table Timestamp, Recipients, RecipientStatus -AutoSize

Good: the queue is empty or Ready, and RecipientStatus shows the next hop's 250 acceptance.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)