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/base: reject more types by default
@ 2016-06-17 19:09  7% Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2016-06-17 19:09 UTC (permalink / raw)
  To: meta

Try to be descriptive for some of these.
---
 lib/PublicInbox/Filter/Base.pm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/Filter/Base.pm b/lib/PublicInbox/Filter/Base.pm
index 37f1ee7..b2bb146 100644
--- a/lib/PublicInbox/Filter/Base.pm
+++ b/lib/PublicInbox/Filter/Base.pm
@@ -8,11 +8,14 @@ use warnings;
 use PublicInbox::MsgIter;
 use constant MAX_MID_SIZE => 244; # max term size - 1 in Xapian
 
-my $NO_HTML = '*** We only accept plain-text mail, no HTML ***';
+sub No ($) { "*** We only accept plain-text mail, No $_[0] ***" }
+
 our %DEFAULTS = (
-	reject_suffix => [ qw(exe bat cmd com pif scr vbs cpl zip) ],
-	reject_type => [ "text/html:$NO_HTML", "text/xhtml:$NO_HTML",
-		'application/vnd.ms-*:No proprietary data formats' ],
+	reject_suffix => [ qw(exe bat cmd com pif scr vbs cpl zip swf swfl) ],
+	reject_type => [ 'text/html:'.No('HTML'), 'text/xhtml:'.No('HTML'),
+		'application/vnd.*:'.No('vendor-specific formats'),
+		'image/*:'.No('images'), 'video/*:'.No('video'),
+		'audio/*:'.No('audio') ],
 );
 our $INVALID_FN = qr/\0/;
 

^ 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 --
2016-06-17 19:09  7% [PATCH] filter/base: reject more types by default 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).