]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MDA.pm
config: support "inboxdir" in addition to "mainrepo"
[public-inbox.git] / lib / PublicInbox / MDA.pm
index 0f583e65a6a2fb3473f4873fe766d42f523a0eb0..9cafda13997f68229d8f6f4f0b1dc34ce4bc3b93 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (C) 2013-2015 all contributors <meta@public-inbox.org>
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2013-2019 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;
@@ -64,7 +64,7 @@ sub alias_specified {
        } @address;
 
        foreach my $line ($simple->header('Cc'), $simple->header('To')) {
-               my @addrs = ($line =~ /([^<\s]+\@[^>\s]+)/g);
+               my @addrs = ($line =~ /([^,<\s]+\@[^,>\s]+)/g);
                foreach my $addr (@addrs) {
                        if ($ok{lc(__drop_plus($addr))}) {
                                return 1;
@@ -78,10 +78,9 @@ sub set_list_headers {
        my ($class, $simple, $dst) = @_;
        unless (defined $simple->header('List-Id')) {
                my $pa = $dst->{-primary_address};
-               $simple->header_set("List-Id", "<$pa>"); # RFC2919
+               $pa =~ tr/@/./; # RFC2919
+               $simple->header_set("List-Id", "<$pa>");
        }
-
-       $simple->header_set($_) foreach @BAD_HEADERS;
 }
 
 1;