[Spambayes-checkins] spambayes/Outlook2000 msgstore.py, 1.61, 1.61.2.1

Mark Hammond mhammond at users.sourceforge.net
Thu Aug 7 20:54:36 EDT 2003


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

Modified Files:
      Tag: outlook-dialog-branch
	msgstore.py 
Log Message:
Fix [ 782709 ] not match between actual score and what's shown in outlook
on the Outlook dialog branch.


Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.61
retrieving revision 1.61.2.1
diff -C2 -d -r1.61 -r1.61.2.1
*** msgstore.py	31 Jul 2003 12:30:00 -0000	1.61
--- msgstore.py	8 Aug 2003 02:54:34 -0000	1.61.2.1
***************
*** 348,352 ****
          return "".join(chunks)
      except pythoncom.com_error, d:
!         print "Error getting property from stream", d
          return ""
  
--- 348,353 ----
          return "".join(chunks)
      except pythoncom.com_error, d:
!         print "Error getting property", mapiutil.GetPropTagName(prop_id), \
!               "from stream:", d
          return ""
  
***************
*** 507,510 ****
--- 508,518 ----
  
          # prop_row is a single mapi property row, with fields as above.
+         # NOTE: We can't trust these properties for "large" values
+         # (ie, strings, PT_BINARY, objects etc.), as they sometimes come
+         # from the IMAPITable (which has a 255 limit on property values)
+         # and sometimes from the object itself (which has no restriction).
+         # This limitation is documented by MAPI.
+         # Thus, we don't trust "PR_TRANSPORT_MESSAGE_HEADERS_A" more than
+         # to ask "does the property exist?"
          tag, eid = prop_row[0] # ID
          tag, store_eid = prop_row[1]
***************
*** 520,533 ****
          self.msgclass = msgclass
          self.subject = subject
!         if PROP_TYPE(headers_tag)==PT_STRING8:
!             self.headers = headers
!             has_headers = True
!         else:
!             # headers probably too big for simple property fetch - this is
!             # the case if we got back MAPI_E_NOT_ENOUGH_MEMORY
!             # (but don't bother fetching the header yet)
!             has_headers = PROP_TYPE(headers_tag)==PT_ERROR and \
!                           headers==mapi.MAPI_E_NOT_ENOUGH_MEMORY
!             self.headers = None
          # Search key is the only reliable thing after a move/copy operation
          # only problem is that it can potentially be changed - however, the
--- 528,532 ----
          self.msgclass = msgclass
          self.subject = subject
!         has_headers = PROP_TYPE(headers_tag)==PT_STRING8
          # Search key is the only reliable thing after a move/copy operation
          # only problem is that it can potentially be changed - however, the
***************
*** 601,617 ****
  
          self._EnsureObject()
-         if self.headers is None: # they were too large when created!
-             prop_ids = (PR_TRANSPORT_MESSAGE_HEADERS_A,)
-             hr, data = self.mapi_object.GetProps(prop_ids,0)
-             self.headers = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0])
-         headers = self.headers
- 
          prop_ids = (PR_BODY_A,
                      MYPR_BODY_HTML_A,
!                     PR_HASATTACH)
          hr, data = self.mapi_object.GetProps(prop_ids,0)
          body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0])
          html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1])
          has_attach = data[2][1]
  
          # Some Outlooks deliver a strange notion of headers, including
--- 600,612 ----
  
          self._EnsureObject()
          prop_ids = (PR_BODY_A,
                      MYPR_BODY_HTML_A,
!                     PR_HASATTACH,
!                     PR_TRANSPORT_MESSAGE_HEADERS_A)
          hr, data = self.mapi_object.GetProps(prop_ids,0)
          body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0])
          html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1])
          has_attach = data[2][1]
+         headers = self._GetPotentiallyLargeStringProp(prop_ids[3], data[3])
  
          # Some Outlooks deliver a strange notion of headers, including





More information about the Spambayes-checkins mailing list