Properly recurse into multipart/sign:ed email parts
authorCédric Villemain <cedric@2ndquadrant.com>
Sat, 17 Aug 2013 16:08:06 +0000 (18:08 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sat, 17 Aug 2013 16:08:06 +0000 (18:08 +0200)
Previously we'd only recurse into multipart/mixed, but this would
miss PGP-signed attachments sent by some MUAs.

loader/lib/parser.py

index 5ecc396d2b38eecd7af39bb7f50a55775f20f7ec..90b441a5da5785d7c2cce411dc7c5cf2352865f6 100644 (file)
@@ -261,7 +261,8 @@ class ArchivesParser(object):
                return None
 
        def recursive_get_attachments(self, container):
-               if container.get_content_type() == 'multipart/mixed':
+               # We start recursion in the "multipart" container if any
+               if container.get_content_type() == 'multipart/mixed' or container.get_content_type() == 'multipart/signed':
                        # Multipart - worth scanning into
                        if not container.is_multipart():
                                # Wow, this is broken. It's multipart/mixed, but doesn't