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 2009/08/26 11:40:05 UTC

svn commit: r807941 - /spamassassin/trunk/lib/Mail/SpamAssassin.pm

Author: mmartinec
Date: Wed Aug 26 09:40:04 2009
New Revision: 807941

URL: http://svn.apache.org/viewvc?rev=807941&view=rev
Log:
enable timing implicitly if _TIMING_ is used in add_header templates,
so that the following works:  add_header all Timing _TIMING_
even when debugging is off

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin.pm?rev=807941&r1=807940&r2=807941&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin.pm Wed Aug 26 09:40:04 2009
@@ -1728,6 +1728,14 @@
     $self->{conf}->trim_rules($self->{only_these_rules});
   }
 
+  if (!$self->{timer_enabled}) {
+    # enable timing implicitly if _TIMING_ is used in add_header templates
+    foreach my $hf_ref (@{$self->{conf}->{'headers_ham'}},
+                        @{$self->{conf}->{'headers_spam'}}) {
+      if ($hf_ref->[1] =~ /_TIMING_/) { $self->timer_enable(); last }
+    }
+  }
+
   # TODO -- open DNS cache etc. if necessary
 }