|
SA Bugzilla – Full Text Bug Listing |
Summary: | IP address of NaSMail user should not be subjected to rules | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | Stephane Chazelas <stephane+sa> |
Component: | Rules | Assignee: | SpamAssassin Developer Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | antispam, iain, Joerg.Dieter.Friedrich, kmcgrail, nomis80, stephane+sa |
Priority: | P5 | ||
Version: | 3.3.1 | ||
Target Milestone: | Undefined | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Stephane Chazelas
2012-04-02 12:15:16 UTC
please submit example received headers or a patch suitable for t/rcvd_parser.t regards, KAM Hi Kevin, here's one example: from 67.85.219.192 (NaSMail authenticated user john.doe) by webmail.example.com with HTTP; Fri, 30 Mar 2012 12:39:58 +0100 (BST) (In reply to comment #2) > Hi Kevin, > > here's one example: > > from 67.85.219.192 (NaSMail authenticated user john.doe) by webmail.example.com > with HTTP; Fri, 30 Mar 2012 12:39:58 +0100 (BST) I prefer real-world examples not sanitized/fake versions. However, the change is small so I've added the rcvd test case and the small regex for NaSMail. The patch below appears to be for 3.3.X but I've made the change only on trunk. Index: lib/Mail/SpamAssassin/Message/Metadata/Received.pm =================================================================== --- lib/Mail/SpamAssassin/Message/Metadata/Received.pm (revision 1308568) +++ lib/Mail/SpamAssassin/Message/Metadata/Received.pm (working copy) @@ -446,7 +446,8 @@ # from 142.169.110.122 (SquirrelMail authenticated user synapse) by # mail.nomis80.org with HTTP; Sat, 3 Apr 2004 10:33:43 -0500 (EST) - if (/ \(SquirrelMail authenticated user /) { + # 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/) { $ip = $1; $by = $2; goto enough; Index: t/rcvd_parser.t =================================================================== --- t/rcvd_parser.t (revision 1308568) +++ t/rcvd_parser.t (working copy) @@ -18,7 +18,7 @@ use lib '.'; use lib 't'; use SATest; sa_t_init("rcvd_parser"); -use Test; BEGIN { plan tests => 142 }; +use Test; BEGIN { plan tests => 143 }; use strict; # format is: @@ -459,8 +459,12 @@ '[ ip=153.90.199.141 rdns= helo= by=web1.cs.montana.edu ident= envfrom= id= auth= msa=0 ]', '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)' => - '[ ip=143.166.226.16 rdns= helo= by=www.penguintowne.org ident= envfrom= id= auth=Sendmail msa=0 ]' + '[ ip=143.166.226.16 rdns= helo= by=www.penguintowne.org ident= envfrom= id= auth=Sendmail msa=0 ]', + #ADDED PER Bug 6783 + 'from 67.85.219.192 (NaSMail authenticated user john.doe) by webmail.example.com with HTTP; Fri, 30 Mar 2012 12:39:58 +0100 (BST)' => + '[ ip=67.85.219.192 rdns= helo= by=webmail.example.com ident= envfrom= id= auth= msa=0 ]' + ); my $sa = create_saobj(); svn commit -m 'Bug 6783 for NaSMail Received Header' Sending lib/Mail/SpamAssassin/Message/Metadata/Received.pm Sending t/rcvd_parser.t Transmitting file data .. Committed revision 1308610. |