[Spambayes-checkins] spambayes/Outlook2000 addin.py,1.30,1.31 msgstore.py,1.24,1.25

Tim Peters tim_one@users.sourceforge.net
Tue Nov 12 22:56:26 2002


Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory usw-pr-cvs1:/tmp/cvs-serv21157/Outlook2000

Modified Files:
	addin.py msgstore.py 
Log Message:
Removed the strip_mime_headers business.  I'm not sure whether it ever
helped, but at this point it was definitely happening too late to do
any good.


Index: addin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** addin.py	12 Nov 2002 04:52:12 -0000	1.30
--- addin.py	12 Nov 2002 22:56:24 -0000	1.31
***************
*** 244,248 ****
      push("<h2>Message Stream:</h2><br>")
      push("<PRE>\n")
!     msg = msgstore_message.GetEmailPackageObject(strip_mime_headers=False)
      push(escape(msg.as_string(), True))
      push("</PRE>\n")
--- 244,248 ----
      push("<h2>Message Stream:</h2><br>")
      push("<PRE>\n")
!     msg = msgstore_message.GetEmailPackageObject()
      push(escape(msg.as_string(), True))
      push("</PRE>\n")

Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** msgstore.py	10 Nov 2002 19:59:59 -0000	1.24
--- msgstore.py	12 Nov 2002 22:56:24 -0000	1.25
***************
*** 49,53 ****
      def __init__(self):
          self.unread = False
!     def GetEmailPackageObject(self, strip_mime_headers=True):
          # Return a "read-only" Python email package object
          # "read-only" in that changes will never be reflected to the real store.
--- 49,53 ----
      def __init__(self):
          self.unread = False
!     def GetEmailPackageObject(self):
          # Return a "read-only" Python email package object
          # "read-only" in that changes will never be reflected to the real store.
***************
*** 420,424 ****
              self.mapi_object = self.msgstore._OpenEntry(self.id)
  
!     def GetEmailPackageObject(self, strip_mime_headers=True):
          import email
          # XXX If this was originally a MIME msg, we're hosed at this point --
--- 420,424 ----
              self.mapi_object = self.msgstore._OpenEntry(self.id)
  
!     def GetEmailPackageObject(self):
          import email
          # XXX If this was originally a MIME msg, we're hosed at this point --
***************
*** 433,451 ****
              print "FAILED to create email.message from: ", `text`
              raise
- 
-         if strip_mime_headers:
-             # If we're going to pass this to a scoring function, the MIME
-             # headers must be stripped, else the email pkg will run off
-             # looking for MIME boundaries that don't exist.  The charset
-             # info from the original MIME armor is also lost, and we don't
-             # want the email pkg to try decoding the msg a second time
-             # (assuming Outlook is in fact already decoding text originally
-             # in base64 and quoted-printable).
-             # We want to retain the MIME headers if we're just displaying
-             # the msg stream.
-             if msg.has_key('content-type'):
-                 del msg['content-type']
-             if msg.has_key('content-transfer-encoding'):
-                 del msg['content-transfer-encoding']
          return msg
  
--- 433,436 ----





More information about the Spambayes-checkins mailing list