Configuring Postfix As Email Relay For Office 365 - Geekdudes
Configuring Postfix As Email Relay For Office 365 - Geekdudes
geekdudes
IT Tips&Tricks
stay updated via rss
in /etc/postfix folder create file sasl_passwd and put username and password of mailbox which will
be used as relay
[smtp.office365.com]:587 [email protected]:Pass
[email protected] [email protected]
All emails will be rewri en with in from field with one we just specified
postmap hash:/etc/postfix/sasl_passwd
postmap hash:/etc/postfix/generic
https://geekdudes.wordpress.com/2018/04/11/configuring-postfix-as-relay-for-office-365/ 1/5
8/16/2020 Configuring Postfix as email relay for Office 365 | geekdudes
relayhost = [smtp.office365.com]:587
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = yes
smtp_generic_maps = hash:/etc/postfix/generic
smtp_tls_security_level = may
smtp_sasl_security_options = noanonymous
Restart postfix service and you should be able to send emails through Office 365
Certificate authentication
https://geekdudes.wordpress.com/2018/04/11/configuring-postfix-as-relay-for-office-365/ 2/5
8/16/2020 Configuring Postfix as email relay for Office 365 | geekdudes
smtp_send_dummy_mail_auth = yes
smtp_always_send_ehlo = yes
smtp_tls_security_level = encrypt
smtp_use_tls = yes
smtp_tls_CAfile = /etc/postfix/cacert.pem
Comments
https://geekdudes.wordpress.com/2018/04/11/configuring-postfix-as-relay-for-office-365/ 3/5
8/16/2020 Configuring Postfix as email relay for Office 365 | geekdudes
Reply
Jordan Acosta says:
February 5, 2019 at 12:03 am
Muchas gracias, funciono perfecto con esta documentacion.
Reply
Mikhail says:
March 25, 2019 at 4:56 pm
Great instruction! helped me a lot!
Reply
Tamás Bors says:
August 2, 2019 at 2:48 pm
I did everything, but I got this error when sending email:
any ideas?
thank you
Reply
dragan979 says:
August 2, 2019 at 7:38 pm
according to error it seems account you’re using have no send as permissions, go to Office 365
console and check mailbox permissions.
Reply
Hasanain says:
April 29, 2020 at 12:06 pm
I have Microsoft SMTP relay server and i need to shift CentOS 8 server to be as SMTP relay server
and i found POSTFIX tool to work as relay.
i need to install fresh installation& configuration of PostFix in CentOS 8 to be SMTP relay and
integrate with Office365.
any help?
Reply
https://geekdudes.wordpress.com/2018/04/11/configuring-postfix-as-relay-for-office-365/ 4/5
8/16/2020 Configuring Postfix as email relay for Office 365 | geekdudes
dragan979 says:
April 29, 2020 at 4:09 pm
My post is just about that topic
Reply
Brent Gunn says:
June 23, 2020 at 2:39 pm
I have completed this configuration and I have positive mail flow…the message is received by O365
BUT the message is delivered to the LOGIN email address instead of the actual recipient email
specified. I am unable to figure out what is causing this to occur.
Reply
Brian L. Lawson says:
June 24, 2020 at 7:43 pm
You said you got 2 certs and you, “…copied it in cacert.pem file.” Which one did you copy? If both,
just one right after the other?
thanks
Reply
dragan979 says:
June 24, 2020 at 7:45 pm
both
Reply
Chakib Karym says:
July 1, 2020 at 11:26 am
what does this command do : [email protected] [email protected]
what are the parameters to change in this comman so it works for me?
Thanks.
Reply
dragan979 says:
July 1, 2020 at 12:39 pm
This is not command but string added to /etc/postfix/generic to identify machine from which
emails are sent.
Reply
Blog at WordPress.com.
https://geekdudes.wordpress.com/2018/04/11/configuring-postfix-as-relay-for-office-365/ 5/5