]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MDA.pm
wwwstream: link to cgit URLs for coderepo
[public-inbox.git] / lib / PublicInbox / MDA.pm
index ef5e7dfa1f271bb339e6da860871660515a5e4a0..fa4a2ad85929a01b3f680e7b4ca278654b98b8f0 100644 (file)
@@ -1,12 +1,12 @@
-# Copyright (C) 2013-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2013-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # For the -mda script (mail delivery agent)
 package PublicInbox::MDA;
 use strict;
 use warnings;
-use Email::Simple;
 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
 
@@ -63,7 +63,7 @@ sub alias_specified {
        } @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;