]> Sergey Matveev's repositories - public-inbox.git/commitdiff
filter/base: reject more types by default
authorEric Wong <e@80x24.org>
Fri, 17 Jun 2016 17:47:59 +0000 (17:47 +0000)
committerEric Wong <e@80x24.org>
Fri, 17 Jun 2016 19:03:02 +0000 (19:03 +0000)
Try to be descriptive for some of these.

lib/PublicInbox/Filter/Base.pm

index 37f1ee7e59ea76d0211f82c42206a6268b792842..b2bb14620667f5ae65ef6ee5d3c527271795b3a4 100644 (file)
@@ -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/;