From 3cda6050b7c8f73e7fd86f88efc5cd42d0c13f73 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 3 Mar 2016 03:16:58 +0000 Subject: use raw header for Message-ID Message-IDs should not be MIME encoded, but in case they are, use the raw form for compatibility with ssoma and possibly other tools. This prevents a potential problem where a malicious client could confuse our storage layer into indexing incorrect contents. --- lib/PublicInbox/MDA.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/MDA.pm') diff --git a/lib/PublicInbox/MDA.pm b/lib/PublicInbox/MDA.pm index ba5f36b0..003bac65 100644 --- a/lib/PublicInbox/MDA.pm +++ b/lib/PublicInbox/MDA.pm @@ -5,6 +5,7 @@ package PublicInbox::MDA; use strict; use warnings; +use Email::Simple; use Email::Address; use Date::Parse qw(strptime); use constant MAX_SIZE => 1024 * 500; # same as spamc default, should be tunable @@ -21,7 +22,7 @@ sub __drop_plus { # do not allow Bcc, only Cc and To if recipient is set sub precheck { my ($klass, $filter, $address) = @_; - my $simple = $filter->simple; + my Email::Simple $simple = $filter->simple; my $mid = $simple->header("Message-ID"); return 0 if (length($mid) > MAX_MID_SIZE); return 0 unless usable_str(length(''), $mid) && $mid =~ /\@/; -- cgit v1.2.3-24-ge0c7