By ClintonLee83
I’m unable to get postfix to work with our office 365 mail.
here’s the main.cf file:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = signa-01
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = signa.com, signa-01, localhost.localdomain, localhost
relayhost = [smtp.office365.com]:587
mynetworks = 127.0.0.0/
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
smtp_use_tls = yes
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_generic_maps = hash:/etc/postfix/generic
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_sasl_mechanism_filter = login
And here is the error from mail.log:
Jul 15 04:50:28 signa-01 postfix/smtp[29736]: 211B2184D2E: SASL authentication failed; server smtp.office365.com[132.245.73.194] said: 535 5.7.3 Authentication unsuccessful
Jul 15 04:50:28 signa-01 postfix/smtp[29736]: connect to smtp.office365.com[2a01:111:f400:5387::2]:587: Network is unreachable
Jul 15 04:50:28 signa-01 postfix/smtp[29736]: 211B2184D2E: to=<clgsplace@gmail.com>, relay=none, delay=13, delays=0.02/0.02/13/0, dsn=4.4.1, status=deferred (connect to smtp.office365.com[2a01:111:f400:5387::2]:587: Network is unreachable)
Things I’ve done:
How can I troubleshoot this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi!
Per the error log:
Jul 15 04:50:28 signa-01 postfix/smtp[29736]: connect to smtp.office365.com[2a01:111:f400:5387::2]:587: Network is unreachable
It looks like Postfix is not able to connect to Office356’s SMTP relays. By default, Postfix tries to use either IPv6 or IPv4 in that order. However, SMTP traffic is blocked on our IPv6 addresses as to prevent abuse because Droplets currently receive /16 blocks instead of the more commonly used /64 size.
In order to configure Postfix to make and accept connections over IPv4 only, add the following line to main.cf:
inet_protocols = ipv4
and restart Postfix:
sudo service postfix restart
Let me know how that goes!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.