summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/fields.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-01-07 11:34:08 -0400
committerKali Kaneko <kali@leap.se>2014-01-08 20:53:47 -0400
commit4ba5d5b405e3c6a6bc997df2073ffc8ea3fa75a9 (patch)
tree7519ccd4dec15240cc8a89ff34fdc61ee7236141 /src/leap/mail/imap/fields.py
parenta203337d155a6e7186980ef175642adc91d472fe (diff)
Second stage of the new year's storage rewrite.
* documents of only three types: * flags * headers * content * add algorithm for walking the parsed message tree. * treat special cases like a multipart with a single part. * modify add_msg to use the walk routine * modify twisted interfaces to use the new storage schema. * tests for different multipart cases * fix multipart detection typo in the fetch This is a merge proposal for the 0.5.0-rc3. known bugs ---------- Some things are still know not to work well at this point (some cases of multipart messages do not display the bodies). IMAP server also is left in a bad internal state after a logout/login.
Diffstat (limited to 'src/leap/mail/imap/fields.py')
-rw-r--r--src/leap/mail/imap/fields.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/leap/mail/imap/fields.py b/src/leap/mail/imap/fields.py
index bc536fe..2545adf 100644
--- a/src/leap/mail/imap/fields.py
+++ b/src/leap/mail/imap/fields.py
@@ -43,17 +43,17 @@ class WithMsgFields(object):
# headers
HEADERS_KEY = "headers"
- NUM_PARTS_KEY = "numparts"
- PARTS_MAP_KEY = "partmap"
DATE_KEY = "date"
SUBJECT_KEY = "subject"
-
- # attachment
- PART_NUMBER_KEY = "part"
- RAW_KEY = "raw"
+ # XXX DELETE-ME
+ #NUM_PARTS_KEY = "numparts" # not needed?!
+ PARTS_MAP_KEY = "part_map"
+ BODY_KEY = "body" # link to phash of body
# content
- BODY_KEY = "body"
+ LINKED_FROM_KEY = "lkf"
+ RAW_KEY = "raw"
+ CTYPE_KEY = "ctype"
# Mailbox specific keys
CLOSED_KEY = "closed"
@@ -65,11 +65,13 @@ class WithMsgFields(object):
# Document Type, for indexing
TYPE_KEY = "type"
TYPE_MBOX_VAL = "mbox"
- TYPE_MESSAGE_VAL = "msg"
TYPE_FLAGS_VAL = "flags"
TYPE_HEADERS_VAL = "head"
- TYPE_ATTACHMENT_VAL = "attach"
- # should add also a headers val
+ TYPE_CONTENT_VAL = "cnt"
+
+ # XXX DEPRECATE
+ #TYPE_MESSAGE_VAL = "msg"
+ #TYPE_ATTACHMENT_VAL = "attach"
INBOX_VAL = "inbox"
@@ -109,7 +111,6 @@ class WithMsgFields(object):
MBOX_VAL = TYPE_MBOX_VAL
CHASH_VAL = CONTENT_HASH_KEY
PHASH_VAL = PAYLOAD_HASH_KEY
- PART_VAL = PART_NUMBER_KEY
INDEXES = {
# generic
@@ -122,8 +123,7 @@ class WithMsgFields(object):
# content, headers doc
TYPE_C_HASH_IDX: [KTYPE, CHASH_VAL],
- # attachment docs
- TYPE_C_HASH_PART_IDX: [KTYPE, CHASH_VAL, PART_VAL],
+
# attachment payload dedup
TYPE_P_HASH_IDX: [KTYPE, PHASH_VAL],