cyphun wrote:
Here is a header from an e-mail that I was testing this afternoon:
Ok, I suspect it's the fact that your mail is using the members.linode.com address in the SMTP envelope (see return-path), and thus, that's the one that the SPF lookup is processing. So your SPF records are not coming into play. As things currently stand, you'd need an SPF record for li89-90.members.linode.com - whose DNS you can't control.
GMail is applying a "best guess" SPF processing, based on the fact that the mail originated from the IP address that a lookup on li89-90.members.linode.com returned. But that's not due to actually finding an SPF record in DNS. Plus, your envelope address domain doesn't match your From: header. (That's not required technically, but nowadays I wouldn't be surprised if that came into the equation, perhaps especially if the SPF part was "guessed").
I think your next step is to test while ensuring that the envelope domain you are using is one that provides an actual SPF record. To be even more bullet proof, I might suggest keeping your envelope domain in sync with the domain used in the From: header on each message, but that may or may not be easy to do with your mail generation.
So for example, try to generate a message with both an envelope and From: header of "no-reply@cyphun.com", or at least get cyphun.com or some other domain you can create an SPF record for into the envelope. Your existing SPF record for cyphun.com permits your Linode's IP address (via the "a" lookup of cyphun.com), and everything should match and SPF pass.
I don't think rDNS was involved in this issue so far, though of course you can adjust your official hostname to whatever you want, at which point you should keep it in sync with rDNS. But for the purposes of mail generation, it's reasonably common for the reverse lookup of the sending server to be some other name than the domain of the email envelope (e.g., a "mail.example.com" host generating mail for "@example.com" users). Of course, changing your hostname is also an easy way to control the envelope, since presumably your current mail generation is going to use "apache@xxxx" where xxxx is whatever you configure your Linode's hostname to be.
-- David