You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/09/25 20:35:15 UTC

svn commit: r579344 - /spamassassin/trunk/masses/mass-check

Author: jm
Date: Tue Sep 25 11:35:14 2007
New Revision: 579344

URL: http://svn.apache.org/viewvc?rev=579344&view=rev
Log:
added --run_post_scan option, to run a command before starting the 'run' stage of mass-checking

Modified:
    spamassassin/trunk/masses/mass-check

Modified: spamassassin/trunk/masses/mass-check
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/mass-check?rev=579344&r1=579343&r2=579344&view=diff
==============================================================================
--- spamassassin/trunk/masses/mass-check (original)
+++ spamassassin/trunk/masses/mass-check Tue Sep 25 11:35:14 2007
@@ -32,13 +32,10 @@
   -p=dir        set user-prefs directory
   -f=file       read list of targets from <file>
   -j=jobs       specify the number of processes to run simultaneously
-  --net         turn on network checks!
+  --net         turn on network checks
   --mid         report Message-ID from each message
-  --debug=LIST  report debugging information (default is all facilities, LIST
+  --debug[=LIST] report debugging information (default is all facilities, LIST
                 is a comma-separated list of facilities)
-  --progress    show progress updates during check
-  --noisy       show noisier progress updates during check
-  --showdots    print a dot for each scanned message
   --rewrite=OUT save rewritten message to OUT (default is /tmp/out)
   --rules=RE    Only test rules matching the given regexp RE
   --restart=N   restart all of the children after processing N messages
@@ -47,16 +44,23 @@
                 (default = extract all SpamAssassin-encapsulated mails)
   --lint        check rules for syntax before running
   --cf='config line'  Additional line of configuration
+  --run_post_scan='command'  Run the named command after the 'scan' stage,
+                before starting the 'run' stage
+
+  verbosity options
+  --progress    show progress updates during check
+  --noisy       show noisier progress updates during check
+  --showdots    print a dot for each scanned message
 
   client/server mode options
-  --server host:port
+  --server=host:port
                 use server mode, running on the given hostname and port
-  --client host:port
+  --client=host:port
   		use client mode, connecting to the given hostname and port
-  --cs_max N
+  --cs_max=N
   		at most, only ever request (client)/give out (server) a
 		maximum of N messages (defaults to 1000)
-  --cs_timeout N
+  --cs_timeout=N
   		in client mode, try to connect to the server every N seconds
 		defaults to 120
 		in server mode, timeout messages after N seconds
@@ -131,7 +135,7 @@
 	    $total_messages $statusevery $opt_cachedir $opt_scanprob
 	    $opt_client $opt_cs_max $opt_cs_timeout $opt_cs_paths_only
 	    $opt_server %postdata %real $svn_revision
-            $opt_cs_ssl
+            $opt_cs_ssl $opt_run_post_scan
 	    $tmpfd %reuse %orig_conf %reuse_conf $reuse_rules_loaded_p);
 
 use FindBin;
@@ -179,7 +183,7 @@
 GetOptions("c=s", "p=s", "f=s", "j=i", "n", "o", "all", "bayes", "debug:s",
 	   "hamlog=s", "head=i", "loghits", "mh", "mid", "ms", "net",
 	   "progress!", "rewrite:s", "showdots", "spamlog=s", "tail=i",
-	   "rules=s", "restart=i", "loguris",
+	   "rules=s", "restart=i", "loguris", "run_post_scan=s",
 	   "deencap=s", "logmem", "learn=i", "reuse", "lint", "cache",
            "cachedir=s", "noisy", "scanprob=f",
 	   "server=s", "cs_max=i", "cs_timeout=i",
@@ -431,6 +435,8 @@
 ###########################################################################
 ## RUN MODE
 
+run_post_scan();
+
 if ($opt_client) {
   client_mode();
 }
@@ -2080,3 +2086,14 @@
 sub min {
   return ($_[0] < $_[1] ? $_[0] : $_[1]);
 }
+
+############################################################################
+
+sub run_post_scan {
+  return unless $opt_run_post_scan;
+  system($opt_run_post_scan);
+  if ($? >> 8 != 0) {
+    warn "$opt_run_post_scan failed";
+  }
+}
+