This was quite a frustrating issue as it appeared all in a sudden, after adding a new domain in our hybrid exchange server.
Point is that emails were accepted through mx gateways and were successfully being relayed to our Exchange, then relayed back to mx, creating a weird internal loop, having emails residing in the submission queue, getting an error of a mysterious looping.
Steps we followed to identify the issue were all the recommendations provided by Microsoft, including:
- verification of Connectors for the on-Premises and the O365 side
- verification of the new Domain
- check that the new Domain was listed in remote domains, accepted domains
- check that the correct DNS records/txt records existed in our external DNS servers
- check that the Edge server was correctly synchronized
- check for possible certificates issues
We even followed some recommendations on forums, suggesting a restart of the transport service or even a whole server restart to resolve the issue.
A couple of hours later, and after limiting our chances to find a misconfiguration on Exchange or O365, we managed to narrow the affected users, from initially the whole organization, to just 3, we decided to check and combine the users’ attributes.
What we noticed at this point, was that the Routing Address was changed to the primary smtp email address, rather being the correct one of mail.onmicrosoft.com (Remember, it’s a hybrid Exchange with relevant routing to and from O365).
Altering this to the mail.onmicrosoft.com address, instantly resolved the issue for us.