Send & Receive Issues

Fix Exchange SMTP Error 554 5.4.12 Hop Count Exceeded with Attachments

Phi Hung VoPhi Hung Vo Nov 4, 2026 870 views

Question details

The user receives an SMTP 554 5.4.12 hop-count exceeded error when sending emails with attachments to a specific mail contact, whereas plain text emails without attachments deliver successfully.

How to Fix Exchange SMTP Error 554 5.4.12 Hop Count Exceeded
Product
Microsoft Exchange
Device & OS
not provided
Scenario
Sending an email containing an attachment to a mail contact in a hybrid Exchange Online and on-premises Exchange Server environment.
Observed behavior
Messages without attachments succeed, but messages with attachments fail and return a Non-Delivery Report (NDR) indicating a routing loop (SMTP Error 554 5.4.12) between Exchange Online, the on-premises server, and a Linux server.
Before you start

Retrieve the complete Non-Delivery Report (NDR) bounce message, as it contains the critical message trace headers needed to identify where the routing loop is occurring between your servers.

Solution 1Recommended

Analyze the NDR and Reconfigure Send Connectors

Use the Non-Delivery Report to trace the exact server path and correct any misconfigured send connectors that might be mishandling attachments.

The 554 5.4.12 hop count exceeded error occurs when an email is trapped in a routing loop, bouncing back and forth between servers until it hits a predefined limit (usually 50 hops). In hybrid environments, third-party relays or specific send connectors might route emails with attachments differently than plain text emails, inadvertently causing a loop.

1
Inspect Message Headers

Open the complete NDR message and locate the 'Received' headers. Read them from bottom to top to trace the repeated path (e.g., bouncing between Exchange Online, the On-premises Exchange server, and a Linux mail appliance).

2
Access Exchange Admin Center

Log into the Exchange Admin Center (EAC) for your on-premises server and navigate to 'Mail flow' > 'Send connectors'.

3
Review Connector Routing

Check the routing configurations and smart hosts assigned to your send connectors. Ensure there are no conflicting rules that force emails with large payloads or attachments to route to an appliance that passes them right back to Exchange.

4
Verify Target Address

Ensure that the mail contact's ExternalEmailAddress does not point to an alias or domain that is routed internally by your on-premises server, which instantly triggers a loop.

Analyze the NDR and Reconfigure Send Connectors
Third-Party Filters: Security appliances (like Linux-based spam/virus filters) sometimes reject or reroute messages containing attachments. Check the logs on the third-party server mentioned in your NDR to ensure it isn't bouncing the message back to Exchange.
Free Microsoft Office alternative

Try WPS Office for Your Daily Productivity Needs

While resolving Exchange Server routing loops requires complex backend administration, your daily document management should be easy. WPS Office offers a free, lightweight, and highly compatible alternative to Microsoft Office for creating, editing, and sharing your files.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight installation that doesn't slow down your computer.Built-in PDF tools to compress and manage documents before attaching them to emails.Familiar, intuitive user interface that requires no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

What does Exchange SMTP Error 554 5.4.12 mean?

This error means 'hop count exceeded.' It occurs when an email bounces between mail servers in a continuous loop too many times (typically exceeding 50 hops) and is ultimately rejected to prevent the loop from running infinitely.

Why does the hop count error only happen when I attach files?

This happens when your Exchange environment or a third-party gateway has specific transport rules or send connectors configured to handle messages with attachments or larger sizes differently, sending them down a misconfigured routing path that creates a loop.

How can I find out where the email is looping?

You can track the loop by examining the Non-Delivery Report (NDR). Look at the 'Received' headers in the message details, reading from bottom to top, to see exactly which servers the email bounced between before failing.

Can user inbox rules cause a 554 5.4.12 error?

Yes. If a user has an inbox rule that forwards an email to another address, and that destination mailbox has a rule forwarding it back to the original sender, it creates an infinite mail loop that results in a hop count exceeded error.