about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-26 00:35:02 +0000
committerEric Wong <e@80x24.org>2016-07-26 00:35:02 +0000
commitb34a7f6a284493c28fb5cf5a96e278fde0725ce2 (patch)
treef82743fecc3276520f42091b7bd1c5796f51d7b2
parent10e38b3b0fdad7e2881f0571f9b2717df2151f7a (diff)
downloadpublic-inbox-b34a7f6a284493c28fb5cf5a96e278fde0725ce2.tar.gz
This is common when multiple participants are in a thread.
-rw-r--r--lib/PublicInbox/MDA.pm2
-rw-r--r--t/precheck.t17
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/PublicInbox/MDA.pm b/lib/PublicInbox/MDA.pm
index 0f583e65..bcf5358b 100644
--- a/lib/PublicInbox/MDA.pm
+++ b/lib/PublicInbox/MDA.pm
@@ -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;
diff --git a/t/precheck.t b/t/precheck.t
index 6c353d8d..0c3ce1c4 100644
--- a/t/precheck.t
+++ b/t/precheck.t
@@ -27,6 +27,23 @@ sub do_checks {
 }
 
 {
+        my $s = Email::Simple->create(
+                header => [
+                        From => 'abc@example.com',
+                        To => 'abc@example.com',
+                        Cc => 'c@example.com, another-list@example.com',
+                        'Content-Type' => 'text/plain',
+                        Subject => 'list is fine',
+                        'Message-ID' => '<MID@host>',
+                        Date => 'Wed, 09 Apr 2014 01:28:34 +0000',
+                ],
+                body => "hello world\n",
+        );
+        my $addr = [ 'c@example.com', 'd@example.com' ];
+        ok(PublicInbox::MDA->precheck($s, $addr), 'Cc list is OK');
+}
+
+{
         do_checks(Email::Simple->create(
                 header => [
                         From => 'a@example.com',