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/02/19 03:58:57 UTC

svn commit: rev 6757 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin

Author: felicity
Date: Wed Feb 18 18:58:57 2004
New Revision: 6757

Modified:
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Log:
bug 2414: allow the hostname (_HOSTNAME_) used in reports/header rewriting to be set via a config option since the actual system hostname may not be the hostname most people look for (ie: mail CNAME hostfoo, we should report mail not hostfoo ...)

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm	Wed Feb 18 18:58:57 2004
@@ -197,6 +197,7 @@
   $self->{to_tag} = 'SPAM';
   $self->{report_safe} = 1;
   $self->{report_contact} = 'the administrator of that system';
+  $self->{report_hostname} = '';
   $self->{skip_rbl_checks} = 0;
   $self->{dns_available} = "test";
   $self->{check_mx_attempts} = 2;
@@ -1027,6 +1028,18 @@
 
     if ( $key eq 'report_contact' ) {
       $self->{report_contact} = $value; next;
+    }
+
+=item report_hostname ...hostname to use...
+
+Set what _HOSTNAME_ is replaced with in the above report text.
+By default, this is determined dynamically as whatever the host running
+SpamAssassin calls itself.
+
+=cut
+
+    if ( $key eq 'report_hostname' ) {
+      $self->{report_hostname} = $value; next;
     }
 
 =item unsafe_report ...some text for a report...

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Wed Feb 18 18:58:57 2004
@@ -904,7 +904,10 @@
 
             SUBVERSION => sub { $Mail::SpamAssassin::SUB_VERSION },
 
-            HOSTNAME => sub { Mail::SpamAssassin::Util::fq_hostname(); },
+            HOSTNAME => sub {
+	      $self->{conf}->{report_hostname} ||
+	      Mail::SpamAssassin::Util::fq_hostname();
+	    },
 
             CONTACTADDRESS => sub { $self->{conf}->{report_contact}; },