SMTP relay through Office 365 from on-prem to internet problem with internal users

New Contributor




I'm having challenges understanding why e-mails won't relay between internal user mailboxes using from an on-premises IIS SMTP server to O365. We have a connector setup to allow mail from the external IP, the smart host points to the on port 25 and is set to anonymous authentication  and TLS encryption. I can submit e-mails through the relay from mailboxes on the domain to external recipients, and I can even submit e-mails through the relay on the domain from users without mailboxes to other users with mailboxes on the same domain. But what I cannot do is submit e-mails from a user with a mailbox to another user with a mailbox on the same domain. So for example, to assuming both users have mailboxes. This always goes to badmail with the following response: smtp;554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. We need to allow messages to be routed between users, DL's, etc. on the same domain through the relay. Hopefully I'm just missing a piece of the puzzle here.

Thanks in advance. 

2 Replies

So if I got this right, you have mailboxes both in ExO and in some other system on-premises? IIS SMTP relay is hardly the best tool to use in such scenarios, but without knowing the specifics we cannot give you more detailed recommendations. In any case, you can resolve this issue by adding Send As permissions for any of the accounts that already have mailboxes.


In a nutshell, they recently introduced some changes recently that make SMTP submitted messages behave pretty much like any other messages, thus if the mailbox already exists you will need Send As permissions to use that address. As part of those changes, you should also ensure that the sender address complies with RFC5322. More details here:

Sorry if I wasn't clear: no the mailboxes only exist in Exchange Online. The internal SMTP server is nothing more than a relay for internal e-mail to Office 365. The main reason for this is because there are internal applications that are configured to send through this SMTP server that cannot be changed. Formerly it was relaying through an internal Exchange 2010 server. However a migration from Exchange 2010 to Office 365 just occurred which prompted the update of the smart host on the internal server.

What I don't understand is why can I relay from a e-mail address to say a address, but I can't relay from to This makes no sense to me.

I did test the RFC5322 compliance and that did not make any difference in the way the message was processed. That is something I had experimented with before posting this up.