You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/04/27 00:39:37 UTC
svn commit: rev 10293 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Author: felicity
Date: Mon Apr 26 15:39:36 2004
New Revision: 10293
Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
Log:
bug 2292: whitelist_from would have issues when the From header had a comment with an email address in it which was whitelisted. changed to using the get('...:addr') code instead which knows how to ignore comments and the like.
Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/EvalTests.pm Mon Apr 26 15:39:36 2004
@@ -1064,13 +1064,19 @@
if (defined $resent && $resent =~ /\S/) {
@addrs = $self->{main}->find_all_addrs_in_line ($resent);
- } else {
- @addrs = $self->{main}->find_all_addrs_in_line
- ($self->get ('From') . # std
- $self->get ('Envelope-Sender') . # qmail: new-inject(1)
- $self->get ('Resent-Sender') . # procmailrc manpage
- $self->get ('X-Envelope-From') . # procmailrc manpage
- $self->get ('EnvelopeFrom')); # SMTP envelope
+ }
+ else {
+ # bug 2292: Used to use find_all_addrs_in_line() with the same
+ # headers, but the would catch addresses in comments which caused
+ # FNs for things like whitelist_from. Since all of these are From
+ # headers, there should only be 1 address in each anyway, so use the
+ # :addr code...
+ @addrs = grep { defined($_) && length($_) > 0 }
+ ($self->get ('From:addr'), # std
+ $self->get ('Envelope-Sender:addr'), # qmail: new-inject(1)
+ $self->get ('Resent-Sender:addr'), # procmailrc manpage
+ $self->get ('X-Envelope-From:addr'), # procmailrc manpage
+ $self->get ('EnvelopeFrom:addr')); # SMTP envelope
# http://www.cs.tut.fi/~jkorpela/headers.html is useful here
}