Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9517/Outlook2000

Modified Files:
        msgstore.py 
Log Message:
Add a faked up Received header if the only headers are MS Mail Internet 
Transport
 ones and it doesn't already have one.  This can be tokenized, but, more 
importantly,
 makes it easier to work with the incremental training setup.

Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -d -r1.99 -r1.100
*** msgstore.py 29 Dec 2004 06:22:31 -0000      1.99
--- msgstore.py 6 Apr 2005 03:06:51 -0000       1.100
***************
*** 916,924 ****
          # headers - fake some up.
          if not headers:
!             headers = self._GetFakeHeaders ()
          # Mail delivered via the Exchange Internet Mail MTA may have
          # gibberish at the start of the headers - fix this.
          elif headers.startswith("Microsoft Mail"):
              headers = "X-MS-Mail-Gibberish: " + headers
  
          if not html and not body:
--- 916,933 ----
          # headers - fake some up.
          if not headers:
!             headers = self._GetFakeHeaders()
          # Mail delivered via the Exchange Internet Mail MTA may have
          # gibberish at the start of the headers - fix this.
          elif headers.startswith("Microsoft Mail"):
              headers = "X-MS-Mail-Gibberish: " + headers
+             # This mail typically doesn't have a Received header, which
+             # is a real PITA for running the incremental testing setup.
+             # To make life easier, we add in the fake one that the message
+             # would have got if it had had no headers at all.
+             if headers.find("Received:") == -1:
+                 prop_ids = PR_MESSAGE_DELIVERY_TIME
+                 hr, data = self.mapi_object.GetProps(prop_ids, 0)
+                 value = self._format_received(data[0][1])
+                 headers = "Received: %s\n%s" % (value, headers)
  
          if not html and not body:

_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to