From 460539c51b431b6d16c45ecd8216ab1e0471d106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Wed, 22 Jan 2014 18:42:12 -0300 Subject: Properly parse apple mail --- src/leap/mail/walk.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/leap') diff --git a/src/leap/mail/walk.py b/src/leap/mail/walk.py index dd3b745..27d672c 100644 --- a/src/leap/mail/walk.py +++ b/src/leap/mail/walk.py @@ -143,6 +143,15 @@ def walk_msg_tree(parts, body_phash=None): pv = list(get_parts_vector(parts)) wv = getwv(pv) + if all(x == 1 for x in pv): + # special case in the rightmost element + main_pmap = parts[0]['part_map'] + last_part = max(main_pmap.keys()) + main_pmap[last_part]['part_map'] = {} + for partind in range(len(pv) - 1): + print partind+1, len(parts) + main_pmap[last_part]['part_map'][partind] = parts[partind+1] + outer = parts[0] outer.pop('headers') if not "part_map" in outer: -- cgit v1.2.3