minor tweak to make the last patch actually land...
[attachcheck] / attachcheck
index 5580a32ca68a9d835f7c72d6641041499006da90..19159e456b692c37944fc37af05bbaca6598bb8c 100755 (executable)
@@ -34,11 +34,11 @@ 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'\battach(ed|ment|ing)?\b',
+                       r'\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 ]
+attachment_regexes = [ r'(?im)(^|^[^\n>].*)' + x for x in attachment_regexes ]
 
 ### No Edit Below This Line
 ###########################################
@@ -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
 

Benjamin Mako Hill || Want to submit a patch?