News for hackers. Stuff that matters.
Re:What's an SPF Record? by XCSme on Tuesday February 09, 2021 @07:01PM (#26084227)
> But SPF alone doesn’t completely solve spam, we also need DKIM, and to a lesser extent DMARC. More on those later!

I recently wrote a short article on those, a tldr for setting up basic email authentication and anti-spam: https://www.usertrack.net/blog/stop-others-use-your-domain-e...

Re:What's an SPF Record? by superkuh on Tuesday February 09, 2021 @09:36PM (#26085171)
What you describe, adding the DNS TXT record for DKIM, is just the icing on the cake. It's way more work and complex at postfix (+rspamd to sign or whatever) level. Suggesting that you can just,

>Hostgator -> cPanel -> Email Authentication

...is ignoring 99% of the complexity and long term maintainance that DKIM implies.

And why bother? It's not like the mega-corp walled gardens care if you have the perfect mailserver implementation. They'll mark you as spam or blacklist you anyway, because they can, because it's easier, because it's a job someone's doing for profit and you don't effect that.

No. An SPF record is enough for determining if mail is legitimately from it's real mailserver. DKIM is cargo cult nonsense for most cases. A sacrifice to the google/microsoft/apple gods to hopefully earn their favor, but one that is almost always ignored anway.

Re:What's an SPF Record? by XCSme on Wednesday February 10, 2021 @06:24AM (#26087864)
I agree, mail deliverability is really hard.

In my case, the mailserver is only used to use a custom email address and forward the email, so deliverability was not an issue but other people using my domain name to send phishing emails. By making the fixes mentioned in the article the phishing attacks were stopped.

Re:What's an SPF Record? by superasn on Tuesday February 09, 2021 @11:34PM (#26085778)
That's a good writeup! Aren't DKIM and SPF supposedly doing the same thing of authenticating the email domain? If not, what's the difference?
Re:What's an SPF Record? by marcbradshaw on Wednesday February 10, 2021 @01:14AM (#26086153)
SPF asserts that a given IP address is authorized to send mail from a particular envelope sender domain (the user typically does not see this domain) An email with a user visible From address of [email protected] can have passing SPF from evil.com

DKIM asserts that the message contents have been sent by a particular domain (or domains), that domain does not necessarily relate to either the envelope sender domain, or the domain the user sees in the From address. Again, an email from [email protected] can have a perfectly valid DKIM signature from phisher.com

DMARC is a policy layer over the top of these, which ties the domain the user actually sees in the From address back to those used in SPF and DKIM. This is where the [email protected] email starts getting blocked. Neither the SPF nor DKIM of the email are "aligned with" whitehouse.gov, and we can start to do something about the spoofing.

Re:What's an SPF Record? by superasn on Thursday February 11, 2021 @09:14AM (#26101674)
Thanks for the explanation marcbradshaw / volundr . It really cleared things up for me.
Re:What's an SPF Record? by Volundr on Wednesday February 10, 2021 @01:10AM (#26086140)
It's simplest terms, SPF allows you to prove (and equally importantly disprove) that a piece of mail comes from your domain based on IP address (there are a variety of mechanisms, but in the end it all boils down to IP). Basically SPF spells out specifically which hosts are allowed to send mail from your domain.

DKIM allows you to prove a message originates from your domain via a cryptographic signature. So any mailserver with the private key can send messages from your domain, it's not limited to a predetermined subset.

In different situations one can be more useful than the other. It's also recommended to implement both, as one or the other might fail for various reasons.

It's also worth noting you really should implement DMARC as well, which lets you spell out a policy for what recipients should do if SPF and DMARC fail, including if they should notify you and how.

Re:What's an SPF Record? by Moru on Wednesday February 10, 2021 @02:32AM (#26086501)
Just please set up DMARC so it allows forwarding a mail... Have had this problem a number of times lately, companies sending mail to us that just vanish in thin air without any explanation. Turns out an alias adress is forwarding their mail to whoever is supposed to handle their mail at the moment and this is not allowed due to how they set up DMARC. The mail server just drops the mail without warning.
Re:What's an SPF Record? by Volundr on Thursday February 11, 2021 @11:50PM (#26110842)
If forwarding is failing DMARC, that's on your system, not the senders. There is nothing the sender can do to help the situation.

Basically DMARC needs either DKIM OR SPF to pass to consider a message passing. Being no SPF record will ever include (forwarders aren't allowed to originate messages from the domain) that means DKIM has to pass.

DKIM works by signing the message body and selected headers with a private key, while the public key is published to DNS. This allows a receiver to fetch the public key from DNS and validate it was really sent by the sender. It should be clear at this point that you'll be able to forward a DKIM signed message as much as you want as long as you don't modify the message when sending. If on the other hand your forwarder modifies the headers (including subject) or the body DKIM will fail.

In other words, if your going to use a forwarder, make sure that forwarder will forward the message as is. You can add headers, but don't remove or modify any existing headers and don't modify the message itself.

Re:What's an SPF Record? by beermonster on Wednesday February 10, 2021 @07:06AM (#26088136)
O2's billing emails, and a well known bank have broken DKIM signatures as they are improperly forwarded.

No chance of getting through to their tech support, especially since these types of email are usually from a no-reply@ address and the people manning the phones are not the mail server admins anyway.

Re:What's an SPF Record? by yread on Wednesday February 10, 2021 @09:23AM (#26089481)
try emailing postmaster@
Re:What's an SPF Record? by beermonster on Thursday February 11, 2021 @02:28PM (#26105977)
No joy there either, sadly.