Loading...

dev@spamassassin.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

[Bug 6549] Squirrelmail headers should be parsed bugzilla-daemon Fri Apr 06 08:01:11 2012

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

--- Comment #8 from Adam Katz <[EMAIL PROTECTED]> 2012-04-06 15:08:56 UTC ---
(In reply to comment #7)
> Following up on this, is this the change you are asking for?
> 
> Index: lib/Mail/SpamAssassin/Message/Metadata/Received.pm
> ===================================================================
> --- lib/Mail/SpamAssassin/Message/Metadata/Received.pm  (revision 1308610)
> +++ lib/Mail/SpamAssassin/Message/Metadata/Received.pm  (working copy)
> @@ -449,7 +449,7 @@
>      # Expanded to NaSMail Bug 6783
>      if (/ \((?:SquirrelMail|NaSMail) authenticated user /) {
>        #REVERTING bug 3236 and implementing re: bug 6549
> -      if (/(${IP_ADDRESS}).{10,80}by (\S+) with HTTP/) {
> +      if (/(${IP_ADDRESS}) .{10,80}by (\S+) with HTTP/) {
>          $ip = $1; $by = $2; goto enough;
>        }
>      }

Not quite; you didn't allow for brackets or parens.  How about this:

-      if (/(${IP_ADDRESS}).{10,80}by (\S+) with HTTP/) {
+      if (/(${IP_ADDRESS})\b(?![.-]).{10,80}by (\S+) with HTTP/) {

That should prevent 1.2.3.4.example.com and 1.2.3.4-dyn.example.com but still
allow [1.2.3.4] and (1.2.3.4)    (No other nonword characters are legal in
domains or IPv4.)

> If so, that change causes this failure which frankly baffles me a bit but
> appears to have to do with a reverse lookup.  Any thoughts?
> 
> # Failed test 65 in t/rcvd_parser.t at line 497 fail #63
> not ok 65
> expected: [ ip=143.166.226.16 rdns= helo= by=www.penguintowne.org ident=
> envfrom= id= auth=Sendmail msa=0 ]
> got     : [ ip=143.166.226.16 rdns= helo=ausisaps301-dmz.aus.amer.dell.com
> by=www.penguintowne.org ident= envfrom= id= auth=Sendmail msa=0 ]
> hdr sample: 
> -------------------------------------------------------------------
> from ausisaps301-dmz.aus.amer.dell.com ([143.166.226.16]) (SquirrelMail
> authenticated user hoolis); by www.penguintowne.org with HTTP; Mon, 22 Mar
> 2004 12:54:13 -0600 (CST)
> ------------------------------------------------------------------------------

Presumably, it got parsed by another portion of the code; your edit requires a
space after the IP but that sample has a square bracket.

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