diff options
author | Eric Wong <e@80x24.org> | 2016-03-03 03:16:58 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-03-03 03:21:27 +0000 |
commit | 3cda6050b7c8f73e7fd86f88efc5cd42d0c13f73 (patch) | |
tree | cb2eb271eb7c24235889da1ef7dbd2b3458351dc /lib/PublicInbox/MDA.pm | |
parent | 2d7d6d91b8894052b8b6088defaf7ea1711eba06 (diff) | |
download | public-inbox-3cda6050b7c8f73e7fd86f88efc5cd42d0c13f73.tar.gz |
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.
Diffstat (limited to 'lib/PublicInbox/MDA.pm')
-rw-r--r-- | lib/PublicInbox/MDA.pm | 3 |
1 files changed, 2 insertions, 1 deletions
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('<m@h>'), $mid) && $mid =~ /\@/; |