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/10/04 23:41:17 UTC

svn commit: rev 53750 - spamassassin/trunk/lib/Mail/SpamAssassin

Author: felicity
Date: Mon Oct  4 14:41:16 2004
New Revision: 53750

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
Log:
bug 3866: allow a null rewrite_header to disable a previous setting

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	Mon Oct  4 14:41:16 2004
@@ -549,7 +549,8 @@
 unless C<report_safe> is 0. Otherwise, you may not be able to remove
 the SpamAssassin markup via the normal methods.  Parentheses are not
 permitted in STRING if rewriting the From or To headers. (They will be
-converted to square brackets.)
+converted to square brackets.)  A null value for C<STRING> will remove
+any existing rewrite for the specified header.
 
 =cut
 
@@ -562,6 +563,11 @@
 
       # We only deal with From, Subject, and To ...
       if ($hdr =~ /^(?:From|Subject|To)$/) {
+	unless (defined $string && $string =~ /\S/) {
+	  delete $self->{rewrite_header}->{$hdr};
+	  return;
+	}
+
 	if ($hdr ne 'Subject') {
           $string =~ tr/()/[]/;
 	}