MCP and sa-update

Desai, Jason jase at sensis.com
Wed Nov 22 16:48:02 GMT 2006


Julian,

I have come across what I think is a bug in MCP.  It appears to pick up
rules from sa-update when doing MCP checks, causing a higher MCP score
and possible false positives.  I have not come across a way to disable
the local state directory in SpamAssassin, but I have found that
changing it to a bogus directory gives the desired result.  I have made
the following change to MCP.pm:

--- MCP.pm.orig 2006-04-12 05:45:37.000000000 -0400
+++ MCP.pm      2006-11-22 11:00:00.000000000 -0500
@@ -88,6 +88,8 @@
     $settings{userstate_dir} = $val if $val ne "";
     $val = MailScanner::Config::Value('mcpspamassassinlocalrulesdir');
     $settings{LOCAL_RULES_DIR} = $val if $val ne "";
+    #  Set the local state directory to a bogus value so it is not used
+    $settings{LOCAL_STATE_DIR} = '/BogusSAStateDir';
     $val =
MailScanner::Config::Value('mcpspamassassindefaultrulesdir');
     $settings{DEF_RULES_DIR} = $val if $val ne "";
     $val = MailScanner::Config::Value('mcpspamassassininstallprefix');

Here is a portion of the debug output (MailScanner --debug --debug-sa)
without the above patch:

[snip]
[21779] dbg: config: using "/opt/MailScanner/etc/mcp" for site rules pre
files
[21779] dbg: config: using "/var/lib/spamassassin/3.001007" for sys
rules pre files
[21779] dbg: config: read file
/var/lib/spamassassin/3.001007/updates_spamassassin_org.pre
[21779] dbg: config: using "/var/lib/spamassassin/3.001007" for default
rules dir
[21779] dbg: config: read file
/var/lib/spamassassin/3.001007/updates_spamassassin_org.cf
[21779] dbg: config: using "/opt/MailScanner/etc/mcp" for site rules dir
[21779] dbg: config: read file /opt/MailScanner/etc/mcp/10_example.cf
[21779] dbg: config: using
"/opt/MailScanner/etc/mcp/mcp.spam.assassin.prefs.conf" for user prefs
file
[snip]

As you can see, MCP is using the sa-update rules.  With the above
changes in place, I get the desired effect:

[snip]
[21662] dbg: config: using "/opt/MailScanner/etc/mcp" for site rules pre
files
[21662] dbg: config: using "/opt/MailScanner/etc/mcp" for sys rules pre
files
[21662] dbg: config: using "/opt/MailScanner/etc/mcp" for default rules
dir
[21662] dbg: config: read file /opt/MailScanner/etc/mcp/10_example.cf
[21662] dbg: config: using "/opt/MailScanner/etc/mcp" for site rules dir
[21662] dbg: config: read file /opt/MailScanner/etc/mcp/10_example.cf
[21662] dbg: config: using
"/opt/MailScanner/etc/mcp/mcp.spam.assassin.prefs.conf" for user prefs
file
[21662] dbg: config: read file
/opt/MailScanner/etc/mcp/mcp.spam.assassin.prefs.conf
[snip]

I know you've been busy lately.  When you get some time, can you please
review the patch, and possibly include it in the next release?  Or maybe
make this a user configurable option (MCP SpamAssassin Local State Dir)?
Or maybe you know of a better solution?

Thanks for looking into this, and thanks for MailScanner!

Jase

-- 
Jason Desai
Network Administrator
Sensis Corporation
jase at sensis.com
http://www.sensis.com
(315) 445-5811
 


More information about the MailScanner mailing list