I'm not sure why this wasn't done in Jun/July 2016 when I was
working on PublicInbox::Address to replace the DoS-vulnerable
Email::Address.
Nowadays, PublicInbox::Address allows using Email::Address::XS
which should be fast and robust.
use strict;
use warnings;
use PublicInbox::MsgTime;
+use PublicInbox::Address;
use constant MAX_SIZE => 1024 * 500; # same as spamc default, should be tunable
use constant MAX_MID_SIZE => 244; # max term size - 1 in Xapian
} @address;
foreach my $line ($simple->header('Cc'), $simple->header('To')) {
- my @addrs = ($line =~ /([^,<\s]+\@[^,>\s]+)/g);
+ my @addrs = PublicInbox::Address::emails($line);
foreach my $addr (@addrs) {
if ($ok{lc(__drop_plus($addr))}) {
return 1;