diff options
author | Eric Wong <e@80x24.org> | 2016-05-25 01:44:46 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-05-25 01:49:54 +0000 |
commit | 23a4e44bedabe5b8b651346cabc2a870c5377a30 (patch) | |
tree | e92220e935276cd1a2f466fa4bc6bf1e29fdb8e0 /script | |
parent | 64aea34d06f71828b0bdd6ae177b9bcf22d752b4 (diff) | |
download | public-inbox-23a4e44bedabe5b8b651346cabc2a870c5377a30.tar.gz |
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
Diffstat (limited to 'script')
-rwxr-xr-x | script/public-inbox-learn | 7 | ||||
-rwxr-xr-x | script/public-inbox-mda | 1 |
2 files changed, 4 insertions, 4 deletions
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; |