0

I configured a postfix virtual machine in Azure to act as a relay host for outgoing emails of my Office365-Exchange online hosted domain, because I had to replicate my old on-premise architecture, where there was an Exchange server with a postfix relay. This relay makes some transformation on sender addresses of outgoing emails, following my company policies. Office365-Exchange online is configured with a connector to route all outgoing emails to that Postfix VM on Azure.

On premises setup worked without problems for years. Now that I replicated that setup on Exchange online + Azure postfix VM, the mail flow works without problems, except for recipient domains that are also hosted on outlook.com domains. Every mail sent is bounced with this error:

host xxx-xxx.mail.protection.outlook.com[X.X.X.X] said: 554 5.4.14 Hop count exceeded - possible mail loop ATTR1 [xxx-xxx.prod.protection.outlook.com] (in reply to end of DATA command)

Do you have any clue?

Edit: We are still facing the problem, but I have more details:

Not every mail sent to any Office365 domain is bounced with the loop error, only mails sent to domains that have the same *.outlook.com server that we have: searching in postfix logs, i found that our emails are going out from 3 outlook.com servers, with 3 different IP addresses; I found the same and only 3 IP addresses in error logs related to the bounce error.

Here is an example, IP addresses are all fake:

mycompany-com.outlook.com [104.1.2.3] -> Postfix relay [54.1.2.3] -> recipient_first-com.outlook.com [104.1.2.3] = Bounce error

mycompany-com.outlook.com [104.1.2.3] -> Postfix relay [54.1.2.3] -> recipient_second-com.outlook.com [104.4.5.6] = mail sent correctly

When my outgoing outlook server and the recipient incoming server have the same IP address, the error occurs.

J.B.
  • 315
  • 8
  • 23

1 Answers1

1

I found a Microsoft article about your issue for your reference This is likely caused by accepted domain configuration issues or there are misconfigured connectors in your Exchange Online organization in hybrid environments. Fix email delivery issues for error code 5.4.6 or 5.4.14 in Exchange Online

Joy Zhang
  • 1,057
  • 1
  • 5
  • 5
  • That was indeed an O365 inbound connector configuration issue, we solved with the help of Microsoft support, after a few weeks. They provided me this link that explains O365 message routing: https://techcommunity.microsoft.com/t5/exchange-team-blog/office-365-message-attribution/ba-p/749143 – J.B. Apr 27 '20 at 07:44