O365 Emails ignoring user/mailbox config

See section C of the wiki, to rewrite all the funky addresses that FreePBX uses.

https://wiki.freepbx.org/display/PPS/Setup+Postfix+Manually

Office 365 only accepts email from either the primary box or email addresses it’s authorized to “send as”… hence your problem.

I have several FreePBX clients using Office 365 (as 95% of my clients do) and I can confirm that it works. With Gmail/G Suite the system doesn’t care and will accept email from any address so long as it authenticates the mailbox.

For ISPs like 1and1 that will reject the message if the from user and the sending
user don’t match you can add these rules to /etc/postfix/generic replacing all
[email protected]” with the real data used above for authentication.

root [email protected]
root@localhost [email protected]
[email protected] [email protected]
root@freepbx [email protected]
[email protected] [email protected]
asterisk [email protected]
asterisk@localhost [email protected]
[email protected] [email protected]
asterisk@freepbx [email protected]
[email protected] [email protected]
vm@asterisk [email protected]

To rewrite the domain for all addresses from the local pbx, use this format in /etc/postfix/generic:
@freepbx.localdomain @real-domain.com

Add the following to the end of /etc/postfix/main.cf
smtp_generic_maps = hash:/etc/postfix/generic

Then run:
postmap /etc/postfix/generic
service postfix restart

2 Likes