[Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.59,1.60
Mark Hammond
mhammond at users.sourceforge.net
Tue Jul 29 21:20:16 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv11124
Modified Files:
msgstore.py
Log Message:
We *do* need to check PR_TRANSPORT_HEADERS to determine if a message is
filterable. So we do.
Don't bother "demand fetching" the subject.
Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** msgstore.py 29 Jul 2003 11:08:47 -0000 1.59
--- msgstore.py 30 Jul 2003 03:20:13 -0000 1.60
***************
*** 498,501 ****
--- 498,503 ----
PR_MESSAGE_CLASS_A, # 'IPM.Note' etc
PR_RECEIVED_BY_ENTRYID, # who received it
+ PR_SUBJECT_A,
+ PR_TRANSPORT_MESSAGE_HEADERS_A,
)
***************
*** 511,519 ****
tag, msgclass = prop_row[4]
recby_tag, recby = prop_row[5]
self.id = store_eid, eid
self.folder_id = store_eid, parent_eid
self.msgclass = msgclass
! self.subject = None
# Search key is the only reliable thing after a move/copy operation
# only problem is that it can potentially be changed - however, the
--- 513,533 ----
tag, msgclass = prop_row[4]
recby_tag, recby = prop_row[5]
+ tag, subject = prop_row[6]
+ headers_tag, headers = prop_row[7]
self.id = store_eid, eid
self.folder_id = store_eid, parent_eid
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
***************
*** 530,537 ****
# RECEIVED_BY_ENTRYID PR_TRANSPORT_MESSAGE_HEADERS
# But MarkH can't find it, and believes and tests that
! # PR_RECEIVED_BY_ENTRYID is all we need.
! # This also means we don't need to check the 'unsent' flag - unsent
! # messages never have the PR_RECEIVED_ properties either.
! self.was_received = PROP_TYPE(recby_tag) == PT_BINARY
self.dirty = False
--- 544,551 ----
# RECEIVED_BY_ENTRYID PR_TRANSPORT_MESSAGE_HEADERS
# But MarkH can't find it, and believes and tests that
! # PR_RECEIVED_BY_ENTRYID is all we need (but has since discovered a
! # couple of messages without any PR_RECEIVED_BY properties - but *with*
! # PR_TRANSPORT_MESSAGE_HEADERS - *sigh*)
! self.was_received = PROP_TYPE(recby_tag) == PT_BINARY or has_headers
self.dirty = False
***************
*** 558,563 ****
def GetSubject(self):
- if self.subject is None:
- self.subject = self.GetField(PR_SUBJECT_A,)
return self.subject
--- 572,575 ----
***************
*** 589,601 ****
self._EnsureObject()
! prop_ids = (PR_TRANSPORT_MESSAGE_HEADERS_A,
! PR_BODY_A,
MYPR_BODY_HTML_A,
PR_HASATTACH)
hr, data = self.mapi_object.GetProps(prop_ids,0)
! headers = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0])
! body = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1])
! html = self._GetPotentiallyLargeStringProp(prop_ids[2], data[2])
! has_attach = data[3][1]
# Some Outlooks deliver a strange notion of headers, including
--- 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
More information about the Spambayes-checkins
mailing list