On Tue, Jul 22, 2003 at 05:47:53PM -0400, Matt Kettler wrote:
> At 09:42 PM 7/22/2003 +0200, Cahya Wirawan wrote:
> 
> >I got many spams where "From:" and "To:" are the same, but the
> >rule FROM_AND_TO_SAME didn't catch it, I use spamassassin 2.55.
> >here is the header:
> >
> >From: "jenny hewit" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> 
> I suspect the addition of the quoted "jenny hewit" threw it off, but 
> looking at the code comments it should theoreticaly catch that.
> 
> I'm not enough of a perl regex wizzard to understand some of what's going 
> on in here, but this is the relevant code:
> 
> # From and To have same address, but are not exactly the same and
> # neither contains intermediate spaces.
> sub check_for_from_to_same {
>   my ($self) = @_;
> 
>   my $hdr_from = $self->get('From');
>   my $hdr_to = $self->get('To');
>   return 0 if (!length($hdr_from) || !length($hdr_to) ||
>                $hdr_from eq $hdr_to);
> 
>   my $addr_from = $self->get('From:addr');
>   my $addr_to = $self->get('To:addr');
>   # BUG: From:addr and To:addr sometimes contain whitespace
>   $addr_from =~ s/\s+//g;
>   $addr_to =~ s/\s+//g;
>   return 0 if (!length($addr_from) || !length($addr_to) ||
>                $addr_from ne $addr_to);
> 
>   if ($hdr_from =~ /^\s*\S+\s*$/ && $hdr_to =~ /^\s*\S+\s*$/) {
>     return 1;
>   }
> }
> 

I think it is because white space in "jenny hewit" <[EMAIL PROTECTED]>.
if it is: "jennyhewit"<[EMAIL PROTECTED]> , it will match.
Look on the last code: 
  if ($hdr_from =~ /^\s*\S+\s*$/ && $hdr_to =~ /^\s*\S+\s*$/){return 1;}
it doesn't allow space in the From or To header. But I don't know why it 
should be like that, I don't really understand the logic. and why both From 
and To should not be exact the same to match this rule.

cahya



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to