Over the past hour, I've been digging into SPF, skimming through RFC-4408, and going over another tutorial.
I own my own domain, with postfix installed on the server behind that domain. Apart from my normal address, I want to also be able to send e-mails using GMail using my own e-mail address as sender.
I do receive quite a lot of bounce-back-spam where spammers have used my e-mail address as "From" line :( From what I understand, SPF is used to check whether a given SMTP server is allowed to send mails with certain sender domain names. Which would help with said bounce-back.
So clearly, If I want to be able to send mails via gmail, I have to allow gmail to send in my name via the SPF record.
Following their help, I added the following TXT record:
v=spf1 include:_spf.google.com ~all
They specifically advise against using -all
as fallthrough rule.
Given that ~all
is a "soft fail" which still accepts all messages, what's the point of enabling SPF at all?
I tried to send some mails from an external host and they were accepted with the only difference being that my mail-server assumes that there was no SPF record.
Excerpt from the logs when sending via GMail:
May 8 15:15:58 h2150855 policyd-spf[6184]: None; identity=helo; client-ip=300.300.300.300; helo=mail-lf0-f52.google.com; envelope-from=mygmailaddress@gmail.com; receiver=mypersonaladdress@example.com
May 8 15:15:58 h2150855 policyd-spf[6184]: Pass; identity=mailfrom; client-ip=300.300.300.300; helo=mail-lf0-f52.google.com; envelope-from=mygmailaddress@gmail.com; receiver=mypersonaladdress@example.com
... and sending via a third-party server:
May 8 15:19:17 h2150855 policyd-spf[6554]: None; identity=helo; client-ip=301.300.300.300; helo=theserver.example.com; envelope-from=exhuma@theserver.example.com; receiver=mypersonaladdress@example.com
May 8 15:19:17 h2150855 policyd-spf[6554]: None; identity=mailfrom; client-ip=301.300.300.300; helo=theserver.example.com; envelope-from=exhuma@theserver.example.com; receiver=mypersonaladdress@example.com
The only difference I can see is that the postfix SPF plugin marks the gmail message explicitly as Pass
, while the other is marked as None
.
I am now at the point where I think that adding SPF did not really do anything to my mail-setup and am considering removing it again.