Office 365 Setup

I am following this guide:

Did all that but get “unknown user Sentinel” in debug which does exist in office 365

Feb 28 10:18:40 SentecPBX postfix/local[29837]: C71C32F86: to=[email protected], relay=local, delay=0.24, delays=0.13/0.06/0/0.05, dsn=5.1.1, status=bounced (unknown user: “sentinel”)
Feb 28 10:18:40 SentecPBX postfix/cleanup[29831]: F2EAF3559: message-id=[email protected]
Feb 28 10:18:40 SentecPBX postfix/qmgr[29426]: F2EAF3559: from=<>, size=2349, nrcpt=1 (queue active)
Feb 28 10:18:41 SentecPBX postfix/bounce[29838]: C71C32F86: sender non-delivery notification: F2EAF3559
Feb 28 10:18:41 SentecPBX postfix/local[29837]: F2EAF3559: to=[email protected], relay=local, delay=0.03, delays=0/0/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
Feb 28 10:18:41 SentecPBX postfix/qmgr[29426]: F2EAF3559: removed
Feb 28 10:18:41 SentecPBX postfix/qmgr[29426]: C71C32F86: removed

But that worked ? You see email in the “asterisk” user mail box via 365 ? Check SPAM ?

Where is it getting user asterisk?

Probably /etc/asterisk/voicemail.conf

close now but it wants to send from asterisk email which I don’t have and therefore I get SendAsDeniedException in the debug.

Why is it trying to send from [email protected]? How do I change this?

This is a great tutorial below - which I use for most of my installs. Because Office 365 (versus Gmail) only allows you to send as the primary email (or associated alias/group), you need to be sure to rewrite the header to always come from that user. For instance if your user is [email protected], you need to make SURE that all messages are sent FROM that address, otherwise Office 365 will reject it outright.

https://secopsmonkey.com/mail-relaying-postfix-through-office-365.html

it’s working now but still sending from [email protected] which I don’t want

Backup emails also are adding the hostname in front of the domain

You need to rewrite the header to overwrite any address with your Office 365 user. I also have this from my notes:

Here’s an example of an /etc/postfix/smtp_header_checks configuration that will change the From(header) address of every outgoing message to LOCALHOST System <[email protected]>:

/^From:.*/ REPLACE From: LOCALHOST System <[email protected]>

Please note I’m not a regex expert, so you may want to test your own regex rather than relying on the one above.

After adding smtp_header_checks, the following config option must be added to /etc/postfix/main.cf:

smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

Then reload the postfix config (assuming systemd) and send a test message:

sudo systemctl reload postfix

sendmail [email protected] << EOF Subject: Test email to root. Testing. EOF

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.