1 # Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
2 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
13 my $f = Email::Filter->new(data => $s->as_string);
15 delete $ENV{ORIGINAL_RECIPIENT};
17 ok(PublicInbox->recipient_specified($f),
18 "ORIGINAL_RECIPIENT unset is OK");
20 $ENV{ORIGINAL_RECIPIENT} = 'foo@example.com';
21 ok(!PublicInbox->recipient_specified($f),
22 "wrong ORIGINAL_RECIPIENT rejected");
24 $ENV{ORIGINAL_RECIPIENT} = 'b@example.com';
25 ok(PublicInbox->recipient_specified($f),
26 "ORIGINAL_RECIPIENT in To: is OK");
28 $ENV{ORIGINAL_RECIPIENT} = 'c@example.com';
29 ok(PublicInbox->recipient_specified($f),
30 "ORIGINAL_RECIPIENT in Cc: is OK");
34 do_checks(Email::Simple->create(
36 From => 'a@example.com',
37 To => 'b@example.com',
38 Cc => 'c@example.com',
39 'Content-Type' => 'text/plain',
40 Subject => 'this is a subject',
42 body => "hello world\n",
47 do_checks(Email::Simple->create(
49 From => 'a@example.com',
50 To => 'b+plus@example.com',
51 Cc => 'John Doe <c@example.com>',
52 'Content-Type' => 'text/plain',
53 Subject => 'this is a subject',
55 body => "hello world\n",