verify sigs. in emails with nested multipart mime
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Thu, 8 Oct 2015 00:10:23 +0000 (20:10 -0400)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 7 Dec 2015 18:30:16 +0000 (13:30 -0500)
sometimes a multipart mime message is part of another multipart mime
message which contains a signature of one of its subparts.

edward

diff --git a/edward b/edward
index e2d3db0be8ebf4af8e0a5b605fcf3b247fa3e661..71cde47f1a5498bb4d28406df5df6683dd1ddc5f 100755 (executable)
--- a/edward
+++ b/edward
@@ -369,7 +369,7 @@ def parse_mime(msg_struct):
         an instance of EddyMsg, potentially a recursive one.
     """
 
-    eddymsg_obj = EddyMsg()
+    eddymsg_obj = get_subpart_data(msg_struct)
 
     if msg_struct.is_multipart() == True:
         payloads = msg_struct.get_payload()
@@ -377,9 +377,6 @@ def parse_mime(msg_struct):
         eddymsg_obj.multipart = True
         eddymsg_obj.subparts = list(map(parse_mime, payloads))
 
-    else:
-        eddymsg_obj = get_subpart_data(msg_struct)
-
     return eddymsg_obj