By nhebb
For the most part, I have successfully configured Postfix to send emails. Emails sent to outside domains, e.g. example@gmail.com, are delivered fine. The problem I’m having is when I send emails from my website’s contact form, via the PHP mail() function, to my domain’s own email addresses.
Here are the problems I’m experiencing:
Configuration Notes
/etc/postfix/main.cf:
/etc/aliases:
/etc/postfix/virtual
I ran postmap on /etc/postfix/virtual and /etc/init.d/postfix reload before attempting the send the emails.
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!
You mentioned that your contact form sends emails to your local user as defined in your postfix/virtual file but you also mention that you want them forwarded to Gmail which is what your MX records are set to point to.
If you have set your MX records to Gmail I’m assuming that you want Gmail to handle your inbox so why did you define local mailboxes as well?
Outside of that though, the reason that they are being delivered to the local in-box is because if your sending through postfix it will check its internal routes before it looks up the MX records and so it will successfully deliver that email locally.
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.