]> Sergey Matveev's repositories - public-inbox.git/commitdiff
filter: loosen regexp on type matches
authorEric Wong <e@80x24.org>
Tue, 25 Aug 2015 09:04:50 +0000 (09:04 +0000)
committerEric Wong <e@80x24.org>
Tue, 25 Aug 2015 09:06:02 +0000 (09:06 +0000)
part_type still contains the filename, unfortunately, so
PGP signatures were truly stripped.  Oh well, nobody cares
to verify PGP signatures anyways.

lib/PublicInbox/Filter.pm

index 49ba5cb2df452ea72a8991dbfbeabf5fad997745..bcc57c4527602d74e000f5edd670807c93d90307 100644 (file)
@@ -144,7 +144,7 @@ sub strip_multipart {
 
                        push @keep, $part;
                } elsif ($part_type eq '' ||
-                        $part_type =~ m!\Aapplication/octet-stream\z!i) {
+                        $part_type =~ m!\bapplication/octet-stream\b!i) {
                        # unfortunately, some mailers don't set correct types,
                        # let messages of unknown type through but do not
                        # change the sender-specified type
@@ -153,7 +153,7 @@ sub strip_multipart {
                        } else {
                                $rejected++;
                        }
-               } elsif ($part_type =~ m!\Aapplication/pgp-signature\z!i) {
+               } elsif ($part_type =~ m!\bapplication/pgp-signature\b!i) {
                        # PGP signatures are not huge, we may keep them.
                        # They can only be valid if it's the last element,
                        # so we keep them iff the message is unmodified: