SPF block on return-path mail

email

We make use of a unique return-path email on all email sent to track bounce backs and give feedback, but recently we're getting issues where the SPF record fails because people are allowed to send through their own domains and SMTP servers and then obviously our SPF records are not set up to allow those IP's.

So basically the from email is not used by the other mail server to check for SPF but the return-path mail, is there any way to set up my SPF record so the mails where the return-path is set to our domain can go through but people can't just spoof the domain?

Here is one of the bounce backs:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

info@ultimaterx.co.za
host mx11.mailzone.co.za [41.138.92.77]

SMTP error from remote mail server after end of data:

550 197.242.144.98 is not allowed to send mail from itensityonline.co.za. Please see http://www.openspf.net/Why?scope=mfrom;identity=803622.bounce@itensityonline.co.za;ip=197.242.144.98

But like I said the return path is from that domain but not the from address.

Best Answer

... the from email is not used by the other mail server to check for SPF but the return-path mail...

SPF only checks the sender address given in the SMTP envelope, i.e. what you call "Return-Path". SPF does not care about the contents of the mail itself including the mail header. This also means that SPF does not care about the 'From' header and thus does not deal with a spoofed 'From' header.

Thus the SMTP envelope mail from ('return-path') must match your SPF policy. Allowing your users to use any mail server they want is exactly what SPF tries to prevent because in this case there is no longer a way to distinguish "your users" from "anybody else".

Thus if you want to use SPF for your domain you should either have a wide open (and probably useless) policy which includes all the mail servers used by your users or make your users use your mail server (with authorization). The last option is much better because then you can use a tight SPF policy and this is what most providers do.

Related Topic