I recently purchased a cloud VPS service - CENTOS 7.
I've configured my website everything on that front is fine and well, however I noticed email isn't always being received.
I believe the emails are being sent out using PHP mail function - which defaults to using sendmail.
In the /var/log/maillog
I can see the following:
Sep 10 21:59:01 mail sendmail[2615]: u8AKx0ZK002614: to=root, ctladdr=<apache@mywebsitedomain.co.uk> (48/48), delay=00:00:01, xdelay=00:00:01, mailer=local, pri=41036, dsn=2.0.0, stat=Sent
Sep 10 22:03:16 mail sendmail[2656]: u8AL3G7U002656: from=apache, size=10690, class=0, nrcpts=1, msgid=<015be58bc4d8990a25ba7895538ea4db@mywebsitedomain.co.uk>, relay=apache@localhost
Sep 10 22:03:16 mail sendmail[2657]: u8AL3G7h002657: from=<apache@mywebsitedomain.co.uk>, size=10783, class=0, nrcpts=1, msgid=<015be58bc4d8990a25ba7895538ea4db@mywebsitedomain.co.uk>, proto=ESMTP, daemon=MTA, relay=mywebsitedomain.co.uk [127.0.0.1]
Sep 10 22:03:16 mail sendmail[2656]: u8AL3G7U002656: to=info@mywebsitedomain.co.uk, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=40690, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u8AL3G7h002657 Message accepted for delivery)
Sep 10 22:03:16 mail sendmail[2658]: u8AL3G7h002657: to=root, ctladdr=<apache@mywebsitedomain.co.uk> (48/48), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=40996, dsn=2.0.0, stat=Sent
Sep 10 22:03:16 mail sendmail[2660]: u8AL3GQp002660: from=apache, size=10914, class=0, nrcpts=1, msgid=<d148a9c441d201d8a24c64c517050ede@mywebsitedomain.co.uk>, relay=apache@localhost
Sep 10 22:03:16 mail sendmail[2661]: u8AL3GB4002661: from=<apache@mywebsitedomain.co.uk>, size=11007, class=0, nrcpts=1, msgid=<d148a9c441d201d8a24c64c517050ede@mywebsitedomain.co.uk>, proto=ESMTP, daemon=MTA, relay=mywebsitedomain.co.uk [127.0.0.1]
Sep 10 22:03:16 mail sendmail[2660]: u8AL3GQp002660: to=mypersonalemail@googlemail.com, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=40914, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u8AL3GB4002661 Message accepted for delivery)
Sep 10 22:03:16 mail sendmail[2663]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Sep 10 22:03:17 mail sendmail[2663]: u8AL3GB4002661: to=<mypersonalemail@googlemail.com>, ctladdr=<apache@mywebsitedomain.co.uk> (48/48), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=131007, relay=gmail-smtp-in.l.google.com. [64.233.166.26], dsn=2.0.0, stat=Sent (OK 1473541397 f23si8646501wmh.115 - gsmtp)
The email is successfully received on my personal Google email address, but the other order confirmation isn't received on the business email side (which is hosted by Google Apps).
I can see that in the email source (using a spam tester website).
The following looks wrong:
envelope-from=apache@mywebsitedomain.co.uk;
Return-Path: apache@mywebsitedomain.co.uk
Could the above be the reason I am not receiving emails or am I missing the plot here?
Edit
I must also add, the website has not had its DNS record updated yet to point to the new server. I am currently testing using a hosts file and have updated the SPF record to allow the new server to send emails by using the include ip4 markup.