You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2011/01/26 14:41:35 UTC

svn commit: r1063713 - in /spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm Conf/Parser.pm

Author: mmartinec
Date: Wed Jan 26 13:41:35 2011
New Revision: 1063713

URL: http://svn.apache.org/viewvc?rev=1063713&view=rev
Log:
Bug 6540: lowercase address in unwhitelist_*, documentation clarification

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?rev=1063713&r1=1063712&r2=1063713&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Wed Jan 26 13:41:35 2011
@@ -295,11 +295,12 @@ whitelisting methods, or C<whitelist_fro
 
 Whitelist and blacklist addresses are now file-glob-style patterns, so
 C<fr...@somewhere.com>, C<*...@isp.com>, or C<*.domain.net> will all work.
-Specifically, C<*> and C<?> are allowed, but all other metacharacters are not.
-Regular expressions are not used for security reasons.
+Specifically, C<*> and C<?> are allowed, but all other metacharacters
+are not. Regular expressions are not used for security reasons.
+Matching is case-insensitive.
 
 Multiple addresses per line, separated by spaces, is OK.  Multiple
-C<whitelist_from> lines is also OK.
+C<whitelist_from> lines are also OK.
 
 The headers checked for whitelist addresses are as follows: if C<Resent-From>
 is set, use that; otherwise check all addresses taken from the following
@@ -330,8 +331,9 @@ e.g.
 Used to override a default whitelist_from entry, so for example a distribution
 whitelist_from can be overridden in a local.cf file, or an individual user can
 override a whitelist_from entry in their own C<user_prefs> file.
-The specified email address has to match exactly the address previously
-used in a whitelist_from line.
+The specified email address has to match exactly (although case-insensitively)
+the address previously used in a whitelist_from line, which implies that a
+wildcard only matches literally the same wildcard (not 'any' address).
 
 e.g.
 
@@ -352,7 +354,7 @@ e.g.
 Works similarly to whitelist_from, except that in addition to matching
 a sender address, a relay's rDNS name must match too for the whitelisting
 rule to fire. The first parameter is an address to whitelist, and the
-second is a string to match the relay's rDNS.
+second is a string to match the relay's rDNS. Matching is case-insensitive.
 
 This string is matched against the reverse DNS lookup used during the handover
 from the internet to your internal network's mail exchangers.  It can
@@ -424,11 +426,12 @@ C<whitelist_allows_relay> prevents that.
 
 Whitelist and blacklist addresses are now file-glob-style patterns, so
 C<fr...@somewhere.com>, C<*...@isp.com>, or C<*.domain.net> will all work.
-Specifically, C<*> and C<?> are allowed, but all other metacharacters are not.
-Regular expressions are not used for security reasons.
+Specifically, C<*> and C<?> are allowed, but all other metacharacters
+are not. Regular expressions are not used for security reasons.
+Matching is case-insensitive.
 
 Multiple addresses per line, separated by spaces, is OK.  Multiple
-C<whitelist_allows_relays> lines is also OK.
+C<whitelist_allows_relays> lines are also OK.
 
 The specified email address does not have to match exactly the address
 previously used in a whitelist_from_rcvd line as it is compared to the

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm?rev=1063713&r1=1063712&r2=1063713&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm Wed Jan 26 13:41:35 2011
@@ -1342,6 +1342,7 @@ sub add_to_addrlist_rcvd {
   my ($self, $listname, $addr, $domain) = @_;
   my $conf = $self->{conf};
 
+  $domain = lc $domain;
   $addr = lc $addr;
   if ($conf->{$listname}->{$addr}) {
     push @{$conf->{$listname}->{$addr}{domain}}, $domain;
@@ -1362,7 +1363,7 @@ sub remove_from_addrlist {
   my $conf = $self->{conf};
 
   foreach my $addr (@addrs) {
-    delete($conf->{$singlelist}->{$addr});
+    delete($conf->{$singlelist}->{lc $addr});
   }
 }
 
@@ -1371,7 +1372,7 @@ sub remove_from_addrlist_rcvd {
   my $conf = $self->{conf};
 
   foreach my $addr (@addrs) {
-    delete($conf->{$listname}->{$addr});
+    delete($conf->{$listname}->{lc $addr});
   }
 }