I set a receive connector to allow anonymous relay for internal addresses and all works except when I try to send from the Exchange server itself. The exchange server will only send to internal address and not to external addresses. The email is sent using a powershell script running on 2012 R2 servers in addition to printers. All email sent using the anonymous allowed receive connector works, except from the Exchange server itself.
I created the connector as a frontend connector. Allowed specific IP addresses to use it (including the IP of the exchange 2013 server). Authentication: TLS and Permission Groups: Exchange Servers & Anonymous users . I added the required AD extended rights for anonymous (Ms-Exch-SMTP-Accept-Any-Recipient).
After I did all above to make the receive connector, sending from printers and with powershell scripts on others servers listed in the allowed IPs works, except for the powershell script running on the exchange server itself. I added AD permission for the computer account of the exchange server and added Exchange Servers to the permission groups, but did not help.
The error message is: "Mailbox unavailable. The server response was: 5.7.1 Unable to relay".
you sir, are a gentleman and a scholar.
The Exchange server was indeed connecting to itself using the IPv6 Link Local address. I changed the anonymous receive connector to be bound to all IPv6 interfaces and added the link-local IPv6 address of the exchange server to the allowed remote servers. I also changed the scope of the internet connector to not include the link-local address range .