unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] filter: loosen regexp on type matches
@ 2015-08-25  9:04 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-08-25  9:04 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-25  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25  9:04 [PATCH] filter: loosen regexp on type matches Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).