Hi to all,
This is my very first post and I think is a good chance to express my gratitude and satisfaction with DO services and great community support.
I have setup a working Linux mail server on my DO droplet, however recently, I have decided to switch over to Office 365 subscription and updated my DNS tables records to forward MX for my domain to Microsoft Exchange servers.
Everything was successful and now it was deployed in production.
On my Droplet webpage there is a contact mail form for visitors, which sends email to mailbox accounts registered on my droplet mail server.
Same mail accounts boxes are already setup in Office 365, however the problem is that all messages sent form the webpage mail form are routed locally - only on the droplet mail server itself since the domain name and mail accounts are both identical on my Linux box and Office 365 .
My setup:
On the Postfix server and Office 365 I have:
alias - hostmaster@example.com forwarded to user1@example.com user2@example.com user3@example.com
Is there a workaround to actually force Postfix to send the messages to external Exchange server given the fact that both servers are sending mail for example.com
Your valuable advise and support would be highly appreciated.
Thanks
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!
Install
sudo apt-get install postfix
Add
Create a hash db file by
sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
Change this:
# specify SMTP relay host
relayhost = [servername or domain or ip]:PORT
And add this at the end :
smtp_sasl_auth_enable = yes
# disallow methods that allow anonymous authentication.
smtp_sasl_security_options = noanonymous
# where to find sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
# Enable STARTTLS encryption
smtp_use_tls = yes
# where to find CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
Restart Postfixsudo service postfix restart
Test it ;
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.