From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1BA221FA55 for ; Tue, 25 Aug 2015 09:04:51 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] filter: loosen regexp on type matches Date: Tue, 25 Aug 2015 09:04:50 +0000 Message-Id: <1440493490-24317-1-git-send-email-e@80x24.org> List-Id: 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Filter.pm b/lib/PublicInbox/Filter.pm index 49ba5cb..bcc57c4 100644 --- a/lib/PublicInbox/Filter.pm +++ b/lib/PublicInbox/Filter.pm @@ -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: -- EW