You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Alex <my...@gmail.com> on 2015/12/14 19:47:21 UTC

More on T_SPF_PERMERROR

Hi,

I'm seeing quite a few T_SPF_PERMERROR entries in my logs and not sure
if it's a problem, or a misunderstanding, or perhaps I've just started
to notice it more often since I started looking for it...

I'm seeing T_SPF_PERMERROR entries in my logs for sites with valid and
working SPF records, like expedia.com, but when I test the domains
manually, they're okay.

Among the reasons I can think of that would cause this are that
they're currently updating their SPF record, of course. I also suppose
a problem with DNS on my side or theirs could be an issue (but
expedia?).

I was wondering if there were any other conditions under which I would
have a T_SPF_PERMERROR in my logs but querying just a few hours later
produces no error?

What is the reason the rule is T_?

I was also very surprised to see just how many domains had broken SPF
records. walmart, cintas, sodexo, wellsfargo, salesforce... all
currently broken.

Does anyone have a shell script of some kind that takes a domain as an
argument to determine whether their SPF record is operating normally?
I can definitely see a nagios plugin useful for this... Or a python or
perl script.

Thanks,
Alex

Re: More on T_SPF_PERMERROR

Posted by Reindl Harald <h....@thelounge.net>.

Am 15.12.2015 um 03:42 schrieb Alex:
> Other domains that fail, such as gmail.com and wellsfargo.com, report
> softfail on kitterman when testing due to a redirect, apparently.
> Would that be enough to cause this rule to legitimately report
> temperror?

no - fail != error

SOFTFAIL: all ~
FAIL all -

you have a DNS problem outside of SA scope


Re: More on T_SPF_PERMERROR

Posted by Joe Quinn <jq...@pccc.com>.
On 12/15/2015 7:19 AM, Martin Gregorie wrote:
> On Mon, 2015-12-14 at 21:42 -0500, Alex wrote:
>> Many times the domain actually has something wrong with SPF, but
>> other times openspf.org/why and kittermans say there's nothing wrong
>> with the domain.
>>
>> Other domains that fail, such as gmail.com and wellsfargo.com, report
>> softfail on kitterman when testing due to a redirect,
>>
> For wellsfargo dmarcian.com/spf-survey follows the redirect link and
> reports errors in that TXT (too many IPs and partial IPs). If
> wellsfargo can make this mistake, so can others.
>
> Could T_SPF_HELO_TEMPERROR be trying to say "I can't parse this
> particular SPF TXT record"?
>
>
> Martin
Syntax errors are permanent errors, as they will never go away on their 
own. I highly recommend reading 
http://www.rfc-editor.org/rfc/rfc7208.txt - it's a fairly easy read and 
important to understand well.

4.6.  Record Evaluation

    The check_host() function parses and interprets the SPF record to
    find a result for the current test.  The syntax of the record is
    validated first, and if there are any syntax errors anywhere in the
    record, check_host() returns immediately with the result "permerror",
    without further interpretation or evaluation.

Re: More on T_SPF_PERMERROR

Posted by Martin Gregorie <ma...@gregorie.org>.
On Mon, 2015-12-14 at 21:42 -0500, Alex wrote:
> Many times the domain actually has something wrong with SPF, but
> other times openspf.org/why and kittermans say there's nothing wrong 
> with the domain.
> 
> Other domains that fail, such as gmail.com and wellsfargo.com, report
> softfail on kitterman when testing due to a redirect,
>
For wellsfargo dmarcian.com/spf-survey follows the redirect link and
reports errors in that TXT (too many IPs and partial IPs). If
wellsfargo can make this mistake, so can others.

Could T_SPF_HELO_TEMPERROR be trying to say "I can't parse this
particular SPF TXT record"?


Martin


Re: More on T_SPF_PERMERROR

Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 14 Dec 2015, at 21:42, Alex wrote:
[...]
>
> I also don't think it's a DNS problem here, as it doesn't happen on
> every message. There are also no other indications of problems with
> DNS.

SPF records tend to push the limits of normal DNS, especially in record 
size, and can bring out edge case flaws in resolvers and firewalls that 
massage DNS which are otherwise hard to see.

> Many times the domain actually has something wrong with SPF, but other
> times openspf.org/why and kittermans say there's nothing wrong with
> the domain.

Try https://dmarcian.com/spf-survey/ as well. It's very good at showing 
the details of SPF problems.

What you MAY be seeing are entirely transient problems. Complex SPF 
setups often come with redirects and includes that cross administrative 
boundaries and a variety of short TTLs. That combination can result in 
an SPF resolution that is "broken" only as a result of cached records 
that are expired a few minutes later and replaced by fresh corrected 
records.

Another source of persistent SPF errors is demonstrated in the 
cintas.com record. They've outsourced various aspects of their email ops 
to 3 different providers and put 4 includes of provider SPF records in 
their base record, one of which then re-includes one of the top-level 
includes. The result is the need to do 15 resolutions to expand that 
record: so it is out of spec and SHOULD return a PERMERROR. With that 
degree of outsourcing I doubt that there's anyone at Cintas who can even 
understand what a SPF record is, so the problem is almost certain to be 
persistent. That sort of problem is widespread in large organizations. 
If the last person who understood SPF makes the mistake of including 
outlook.com instead of (or in addition to) spf.protection.outlook.com on 
their way out the door, they effectively sabotage the ability to add 
another include for other purposes.

> Other domains that fail, such as gmail.com and wellsfargo.com, report
> softfail on kitterman when testing due to a redirect, apparently.
> Would that be enough to cause this rule to legitimately report
> temperror?

No. Softfail is a specifically defined non-error SPF result, caused by a 
"~all" default ("tail") component of the record. It is NOT an error, it 
is a chosen result.

> Is there any way to easily retest the mails that have failed? I
> suppose it's more difficult to test for T_SPF_HELO_TEMPERROR, but
> every one of those seem to be legitimate failures anyway.

If you don't have a time machine and don't capture all of your DNS 
traffic, it is not possible to retest perfectly or know why either 
flavor of error occurred (although TEMPERROR is almost always the result 
of DNS timeouts.) However, there is the somewhat lame 'spfquery' script 
that is includes in the perl Mail::SPF module (which is what does SPF 
checking for SA) so you can always check locally rather than relying on 
a test on a distant website using different DNS servers.

Re: More on T_SPF_PERMERROR

Posted by Alex <my...@gmail.com>.
Hi,

> I like http://www.openspf.org/Why for looking at SPF issues by hand. It's a
> test rule at the moment because there's no clear reason for it to have a
> significant score, and it's not entirely clear if it's a useful indicator
> for meta rules either. I mainly wrote it just as a diagnostic "yes, SA did
> check SPF and this is why it didn't FAIL or PASS".
>
> Given the issue is intermittent, looking at DNS is a good place to start.
> You might also try enabling debug output. Expedia's SPF looks correct on my
> end as well.

Have you received much feedback on this rule, considering it's a test rule?

Can you explain more about how it actually works? How do I enable
debug output? Do I modify SPF.pm directly?

I also don't think it's a DNS problem here, as it doesn't happen on
every message. There are also no other indications of problems with
DNS.

Many times the domain actually has something wrong with SPF, but other
times openspf.org/why and kittermans say there's nothing wrong with
the domain.

Other domains that fail, such as gmail.com and wellsfargo.com, report
softfail on kitterman when testing due to a redirect, apparently.
Would that be enough to cause this rule to legitimately report
temperror?

Is there any way to easily retest the mails that have failed? I
suppose it's more difficult to test for T_SPF_HELO_TEMPERROR, but
every one of those seem to be legitimate failures anyway.

Thanks,
Alex

Re: More on T_SPF_PERMERROR

Posted by Joe Quinn <jq...@pccc.com>.
On 12/14/2015 1:47 PM, Alex wrote:
> Hi,
>
> I'm seeing quite a few T_SPF_PERMERROR entries in my logs and not sure
> if it's a problem, or a misunderstanding, or perhaps I've just started
> to notice it more often since I started looking for it...
>
> I'm seeing T_SPF_PERMERROR entries in my logs for sites with valid and
> working SPF records, like expedia.com, but when I test the domains
> manually, they're okay.
>
> Among the reasons I can think of that would cause this are that
> they're currently updating their SPF record, of course. I also suppose
> a problem with DNS on my side or theirs could be an issue (but
> expedia?).
>
> I was wondering if there were any other conditions under which I would
> have a T_SPF_PERMERROR in my logs but querying just a few hours later
> produces no error?
>
> What is the reason the rule is T_?
>
> I was also very surprised to see just how many domains had broken SPF
> records. walmart, cintas, sodexo, wellsfargo, salesforce... all
> currently broken.
>
> Does anyone have a shell script of some kind that takes a domain as an
> argument to determine whether their SPF record is operating normally?
> I can definitely see a nagios plugin useful for this... Or a python or
> perl script.
>
> Thanks,
> Alex
I like http://www.openspf.org/Why for looking at SPF issues by hand. 
It's a test rule at the moment because there's no clear reason for it to 
have a significant score, and it's not entirely clear if it's a useful 
indicator for meta rules either. I mainly wrote it just as a diagnostic 
"yes, SA did check SPF and this is why it didn't FAIL or PASS".

Given the issue is intermittent, looking at DNS is a good place to 
start. You might also try enabling debug output. Expedia's SPF looks 
correct on my end as well.