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;
  }
}




------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to