[Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.56,1.57

Mark Hammond mhammond at users.sourceforge.net
Sun Jul 27 17:46:50 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv17439

Modified Files:
	msgstore.py 
Log Message:
* Add IsReceiveFolder()
* Add support for the test suite (which started failing as our testcase
  test message was "unsent", and therefore SpamBayes ignored it!
* Move some orphaned comments from addin


Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** msgstore.py	25 Jul 2003 06:40:28 -0000	1.56
--- msgstore.py	27 Jul 2003 23:46:48 -0000	1.57
***************
*** 10,13 ****
--- 10,15 ----
      True, False = 1, 0
  
+ # Nod to our automated test suite - we *do* want these messages filtered!
+ test_suite_running = False
  
  # Abstract definition - can be moved out when we have more than one sub-class <wink>
***************
*** 482,485 ****
--- 484,493 ----
                      yield msg
  
+     def IsReceiveFolder(self, msg_class = "IPM.Note"):
+         # Is this folder the nominated "receive folder" for its store?
+         mapi_store = self.msgstore._GetMessageStore(self.id[0])
+         eid, ret_class = mapi_store.GetReceiveFolder(msg_class, 0)
+         return mapi_store.CompareEntryIDs(eid, self.id[1])
+ 
  class MAPIMsgStoreMsg(MsgStoreMsg):
      # All the properties we must initialize a message with.
***************
*** 552,557 ****
          # * Non-mail items
          # * Messages that have never been sent (ie, user-composed)
          return self.msgclass.lower().startswith("ipm.note") and \
!                not self.is_unsent
  
      def _GetPotentiallyLargeStringProp(self, prop_id, row):
--- 560,579 ----
          # * Non-mail items
          # * Messages that have never been sent (ie, user-composed)
+         
+         # Note:  While we handle messages that have never been sent,
+         # we dont handle messages that were sent and moved from the
+         # Sent Items folder. It would be good not to train on them,
+         # since they are simply not received email.  An article on
+         # the web said the distinction can't be made with 100%
+         # certainty, but that a good heuristic is to believe that a
+         # msg has been received iff at least one of these properties
+         # has a sensible value:
+         #     PR_RECEIVED_BY_EMAIL_ADDRESS
+         #     PR_RECEIVED_BY_NAME
+         #     PR_RECEIVED_BY_ENTRYID
+         #     PR_TRANSPORT_MESSAGE_HEADERS
+ 
          return self.msgclass.lower().startswith("ipm.note") and \
!                (not self.is_unsent or test_suite_running)
  
      def _GetPotentiallyLargeStringProp(self, prop_id, row):





More information about the Spambayes-checkins mailing list