Re: Getting a message's current score and status using only the sfid?

Paolo <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <20090228140131.GM8801@localhost>
On Sat, Feb 28, 2009 at 12:55:49AM +0000, Lloyd Zusman wrote:
...
> > with --*_only, they're not supposed to lookup the msg from cache using 
> > sfid - which might be an interesting feature, indeed.
> 
> Well, OK. I was hoping I could do this solely with the sfid, but seeing
> as how this feature is not (yet! ... hint, hint) implemented, for now I

yup, try to patch latest mail{reaver,lib}.crm with attached patches, see
what you get - warning, just a POC (might even work), untested code, use
at your own risk!

And, pls report success/failure, tks :)


-- 
paolo

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

_______________________________________________
Crm114-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crm114-general
mailreaver+stats_from_cache.crm.diff (text/plain, 1.8 KB)
--- mailreaver.crm	Tue Sep 30 22:27:51 2008
+++ mailreaver.crm	Sat Feb 28 14:43:46 2009
@@ -41,6 +41,9 @@
 #	stats_only	- output ONLY the status.  Nothing else.  
 #			Since this means there's no output of the 
 #                       CacheIDs, we don't store the text for later training.
+#	stats_from_cache - like stats_only, but you provide just a sfid as
+#			  input and mailreaver will fetch and classify the 
+#			  corresponding text from cache, if avail.
 #       report_only     - output ONLY the headers that would have 
 #                       been added, not the entire text.
 #	outbound	- this is an "outbound" message and hence can
@@ -202,7 +205,7 @@
 #        If nothing else requires it, we use the current input as the 
 #        text to be operated upon.
 {
-    isolate (:spam: :good: :cache: :dontstore: :stats_only: ) 
+    isolate (:spam: :good: :cache: :dontstore: :stats_only: :stats_from_cache:)
     isolate (:outbound: :undo: :verbose:)
     isolate (:in_text:)  /:*:_dw:/ 
     #   now find the command, and set the cmdline insert point.
@@ -247,6 +250,12 @@
 	    alter (:stats_only:) /SET/
 	}
 	{
+	    #      Command to run stats_from_cache, which implies dont store.
+	    isolate (:stats_from_cache:) <default> //
+	    match [:cmds:] /stats_from_cache/
+	    alter (:stats_only:) /SET/
+	}
+	{
 	    #      Command to run outbound mode
 	    isolate (:outbound:) <default> //
 	    match [:cmds:] /outbound/
@@ -366,6 +375,13 @@
 #####################################################################
 #####################################################################
 
+{
+    match [:stats_from_cache:] /SET/
+    call /:reavercache_fetch:/ [:cacheid:]
+    match [:in_text:] /^CacheErr404:/
+    output /:*:in_text:\n/
+    exit /0/
+}
 
 #
 #       We still need to cope with the following possibilities:
maillib+stats_from_cache.crm.diff (text/plain, 590 B)
--- maillib.crm	Tue Apr  1 19:42:44 2008
+++ maillib.crm	Sat Feb 28 14:52:46 2009
@@ -487,6 +487,22 @@
 return
 
 #
+#      Fetch some text from the cache; 
+#      side effect:
+#
+:reavercache_fetch:  (:cacheid:)
+{
+   match [:text_cache:] /./   # can't get from cache if no reavercache desired
+   isolate (:long_cacheid:) /:*:text_cache:\/texts\/:*:cacheid:/
+   {
+      input [:*:long_cacheid: 0 :*:decision_length:] (:in_text:)
+      trap /./
+      alter (:in_text:) /CacheErr404: couldn't find\n:*:long_cacheid:/
+   }
+}
+return
+
+#
 #     And the mother of all traps...
 #
 #
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.