user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] filter: loosen regexp on type matches
@ 2015-08-25  9:04  7% Eric Wong
  0 siblings, 0 replies; 1+ results
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	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-08-25  9:04  7% [PATCH] filter: loosen regexp on type matches Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).