I'm sure variations on this question have been asked and I apologize if this is a duplicate, but I just can't seem to find something that works in my situation without breaking something else.
I'm using my VPS as a webserver and I need contact forms on websites to send mail through the server. I installed sendmail and, largely, it works. However, the mail was failing a lot of SPF tests. I added SPF entries to each domain, but when I inspected the mail headers I noticed a lot of:
ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 126.96.36.199 is neither permitted nor denied by best guess record for domain of email@example.com) firstname.lastname@example.org Return-Path: <email@example.com>
At first, I simply changed the hostname of the box (and added entries in
/etc/hostsas well) to my primary FQDN. I did this because I used
include:foo.com in my SPF entries.
This had some side effects, so I undid the changes and went back to a local box name.
I read and implemented a change in this question by editing
sendmail.mc to append
I then tried to submit a contact form from my own website (located on the same primary domain) and got an error from Contact Form 7. I tried a client site (same server, different FQDN) and it worked. So I removed that custom entry and rebuilt the sendmail.mc file.
What is the right way to have sendmail create mail headers from a FQDN without upsetting something else? Should I just have tried the sendmail.mc thing again but created a
I'm very confused - I just want my mail headers to stop having local domains in them so that SPF doesn't have to best guess and will pass the mail as valid where I've got SPF records in place that specifically allow both the sending IP and domain (like I already do).
Here is my
/etc/hosts file right now:
127.0.0.1 localhost localhost.localdomain 127.0.0.1 example.com mail.example.com 127.0.1.1 myboxname.localdomain myboxname # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
And the output of
sendmail -bt -d0.1 root is:
Version 8.15.2 Compiled with: DNSMAP IPV6_FULL LDAPMAP LDAP_REFERRALS LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS PIPELINING SASLv2 SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUG ============ SYSTEM IDENTITY (after readcf) ============ (short domain name) $w = myboxname (canonical domain name) $j = mail.example.com (subdomain name) $m = localdomain (node name) $k = myboxname ========================================================