
The error "554 5.4.14 Hop count exceeded - possible mail loop ATTR34" indicates that the email message has exceeded the maximum number of hops allowed to deliver an email. This can happen if there is a misconfiguration in the mail routing between your Office 365 tenant and your on-premises Exchange Server 2016.
Here are some troubleshooting steps you can try:
Verify the MX record for your domain: Ensure that the MX record for your domain is pointing correctly to your Office 365 tenant. You can check this using a DNS checker tool.
Check for forwarding loops: Review your mail routing rules and ensure that there are no loops or circular references that could be causing the email to bounce back.
Disable transport rules: Temporarily disable any transport rules on both your Office 365 tenant and your on-premises Exchange Server 2016 to see if they are interfering with mail delivery.
Check for mail flow connectors: Verify that you have the correct mail flow connectors configured in your Office 365 tenant. Ensure that the connectors are configured to allow relaying from your on-premises Exchange Server 2016 to your Office 365 tenant.
Review Exchange Tracking logs: Analyze the Exchange Tracking logs on both your Office 365 tenant and your on-premises Exchange Server 2016 to identify the exact point where the email message is getting stuck.
Check for IP reputation issues: If your on-premises Exchange Server 2016's IP address has a poor reputation, it could be causing emails to be blocked by external mail servers. Check your IP address on spam blacklists and take steps to improve your IP reputation if necessary.
Review sender authentication records: Ensure that your on-premises Exchange Server 2016 has the necessary sender authentication records in place, such as SPF and DKIM. These records help verify that your server is authorized to send emails on behalf of your domain.
Engage Microsoft support: If you have exhausted all of the above troubleshooting steps and the issue persists, consider contacting Microsoft support for further assistance. They may have more advanced tools and expertise to help identify and resolve the problem.