From 23a4e44bedabe5b8b651346cabc2a870c5377a30 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 May 2016 01:44:46 +0000 Subject: remove Email::Address dependency git has stricter requirements for ident names (no '<>') which Email::Address allows. Even in 1.908, Email::Address also has an incomplete fix for CVE-2015-7686 with a DoS-able regexp for comments. Since we don't care for or need all the RFC compliance of Email::Address, avoiding it entirely may be preferable. Email::Address will still be installed as a requirement for Email::MIME, but it is only used by the Email::MIME::header_str_set which we do not use --- script/public-inbox-learn | 7 ++++--- script/public-inbox-mda | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'script') diff --git a/script/public-inbox-learn b/script/public-inbox-learn index 1c051ec1..c79f2479 100755 --- a/script/public-inbox-learn +++ b/script/public-inbox-learn @@ -11,7 +11,7 @@ use PublicInbox::Config; use PublicInbox::Git; use PublicInbox::Import; use Email::MIME; -use Email::Address; +use PublicInbox::Address; use IPC::Run qw/run/; my $train = shift or die "usage: $usage\n"; if ($train !~ /\A(?:ham|spam)\z/) { @@ -29,8 +29,9 @@ my $mime = Email::MIME->new(eval { # get all recipients my %dests; foreach my $h (qw(Cc To)) { - foreach my $recipient (Email::Address->parse($mime->header($h))) { - $dests{lc($recipient->address)} = 1; + my $val = $mime->header($h) or next; + foreach my $email (PublicInbox::Address::emails($val)) { + $dests{lc($email)} = 1; } } diff --git a/script/public-inbox-mda b/script/public-inbox-mda index b606c59a..6ac0e8c4 100755 --- a/script/public-inbox-mda +++ b/script/public-inbox-mda @@ -9,7 +9,6 @@ my $usage = 'public-inbox-mda < rfc2822_message'; use Email::Filter; use Email::MIME; -use Email::Address; use File::Path::Expand qw/expand_filename/; use IPC::Run qw(run); use PublicInbox::MDA; -- cgit v1.2.3-24-ge0c7