[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:05:20 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit b955dae4878fc074ac433d44dffdff3f681a4bef
Author: aCaB <acab at clamav.net>
Date:   Thu Sep 24 01:16:02 2009 +0200

    Add option ReportHostname

diff --git a/ChangeLog b/ChangeLog
index 272565f..a7b906f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Sep 24 01:14:50 CEST 2009 (acab)
+------------------------------------
+ * clamav-milter: Add option ReportHostname to mangle the host name in X headers
+
 Wed Sep 23 03:19:53 CEST 2009 (acab)
 ------------------------------------
  * libclamav/mpool.c: update frag sizes, small cleanup
diff --git a/clamav-milter/clamav-milter.c b/clamav-milter/clamav-milter.c
index 3e13e7f..d6d80e0 100644
--- a/clamav-milter/clamav-milter.c
+++ b/clamav-milter/clamav-milter.c
@@ -223,14 +223,14 @@ int main(int argc, char **argv) {
     if(strcasecmp(pt, "No")) {
 	char myname[255];
 
-	if(!gethostname(myname, sizeof(myname))) {
+	if(((opt = optget(opts, "ReportHostname"))->enabled && strncpy(myname, opt->strarg, sizeof(myname))) || !gethostname(myname, sizeof(myname))) {
 	    myname[sizeof(myname)-1] = '\0';
 	    snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s at %s", get_version(), myname);
-	    xvirushdr[sizeof(xvirushdr)-1] = '\0';
-	} else {
+	} else
 	    snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s", get_version());
-	    xvirushdr[sizeof(xvirushdr)-1] = '\0';
-	}
+	xvirushdr[sizeof(xvirushdr)-1] = '\0';
+
+	printf("\n%s\n", xvirushdr);
 
 	descr.xxfi_flags |= SMFIF_ADDHDRS;
 
diff --git a/etc/clamav-milter.conf b/etc/clamav-milter.conf
index 1e3de4a..7d3b06c 100644
--- a/etc/clamav-milter.conf
+++ b/etc/clamav-milter.conf
@@ -169,6 +169,11 @@ Example
 # Default: no
 #AddHeader Replace
 
+# When AddHeader is in use, this option allows to arbitrary set the reported
+# hostname. This may be desirable in order to avoid leaking internal names.
+# If unset the real machine name is used.
+# Default: disabled
+#ReportHostname my.mail.server.name
 
 ##
 ## Logging options
diff --git a/shared/optparser.c b/shared/optparser.c
index c9ac8bc..d873b8c 100644
--- a/shared/optparser.c
+++ b/shared/optparser.c
@@ -387,6 +387,8 @@ const struct clam_option clam_options[] = {
 
     { "AddHeader", NULL, 0, TYPE_STRING, "^(No|Replace|Yes|Add)$", -1, "no", 0, OPT_MILTER, "If this option is set to \"Replace\" (or \"Yes\"), an \"X-Virus-Scanned\" and an\n\"X-Virus-Status\" headers will be attached to each processed message, possibly\nreplacing existing headers.\nIf it is set to Add, the X-Virus headers are added possibly on top of the\nexisting ones.\nNote that while \"Replace\" can potentially break DKIM signatures, \"Add\" may\nconfuse procmail and similar filters.", "Replace" },
 
+    { "ReportHostname", NULL, 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "When AddHeader is in use, this option allows to arbitrary set the reported\nhostname. This may be desirable in order to avoid leaking internal names.\nIf unset the real machine name is used.", "my.mail.server.name" },
+
     { "Chroot", NULL, 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Chroot to the specified directory.\nChrooting is performed just after reading the config file and before\ndropping privileges.", "/newroot" },
 
     { "Whitelist", NULL, 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned.  Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be whitelisted.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "/etc/whitelisted_addresses" },

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list