https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6490

--- Comment #20 from Mark Martinec <[email protected]> 2011-05-09 19:17:13 
UTC ---
>  if ($hdr =~ /^Authentication-Results:.*;\s*SPF=([^;]*)/i) {

RFC 5451 allows whitespace and even a comment around '=':

  methodspec = [CFWS] method [CFWS] "=" [CFWS] result

so at least a \s* should be allowed, so perhaps:

  if ($hdr =~ /^Authentication-Results:.*;\s*SPF\s*=\s*([^;]*)/i) {



> if ($tmphdr =~
>    /^(pass|neutral|(?:hard|soft)?fail|none)(?:\b+smtp\.(\S+)=[^;]+)?/i) {

What is the \b+ supposed to do?
The RFC 5451 requires some separation between methodspec and reasonspec:

      resinfo = [CFWS] ";" methodspec [ CFWS reasonspec ]

the optional reasonspec in the above regexp would never match.

Also the propspec permits CFWS before the '=' :

     propspec = ptype [CFWS] "." [CFWS] property [CFWS] "=" pvalue

so, perhaps the following should do as a quick fix (but does not work
if a comment includes semicolons):

  if ($tmphdr =~
/^(pass|neutral|(?:hard|soft)?fail|none)(?:[^;]*?\bsmtp\.(\S+)\s*=[^;]+)?/i) {

(untested)

-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to