X-Git-Url: https://projects.mako.cc/source/attachcheck/blobdiff_plain/b6434634799c3c5ddce74997a2f5705ec9011c52..ec0cb0c5badb29607e954015809a739bcfa4beec:/attachcheck diff --git a/attachcheck b/attachcheck index 5580a32..86f110a 100755 --- a/attachcheck +++ b/attachcheck @@ -34,8 +34,8 @@ ignored_types = ( "applica/pgp-signat", "application/pgp-signature" ) # list of regular expressions which we will view as being indicative # of an attachment -attachment_regexes = [ r'\battach(ed|ment|ing)?\b(?im)', - r'\balleg(o|at[oaie]|ando)(?im)' ] +attachment_regexes = [ r'(?im)\battach(ed|ment|ing)?\b', + r'(?im)\balleg(o|at[oaie]|ando)' ] # ignore quoted text (which might refer to attachments in previous emails) attachment_regexes = [ r'(^|^[^\n>].*)' + x for x in attachment_regexes ] @@ -109,8 +109,8 @@ for part in message.walk(): attachment_expected = True # check to see if this mime-type is something we can ignore - elif ( re.match( r'message/(?m)', part.get_content_type() ) or - re.match( r'multipart/(?m)', part.get_content_type() ) or + elif ( re.match( r'(?m)message/', part.get_content_type() ) or + re.match( r'(?m)multipart/', part.get_content_type() ) or part.get_content_type() in ignored_types ): continue