about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-04-20 23:27:46 +0000
committerEric Wong <e@80x24.org>2014-04-20 23:27:46 +0000
commit1c910ebd5d088b68fd1cec41285ad62641673845 (patch)
tree83bf0ec7dbd5488cb4138ac7c9b619fbb60cd5ba /t
parent66a26a8c44100fe4be59d82f3600a5c14495d49d (diff)
downloadpublic-inbox-1c910ebd5d088b68fd1cec41285ad62641673845.tar.gz
It should be common for a single users to be subscribed to multiple
addresses/lists, so we must use the address before alias expansion.

This partially reverts commit b949afc9edf89dd494cac6255c78b124d58e11a5
Diffstat (limited to 't')
-rw-r--r--t/cgi.t4
-rw-r--r--t/mda.t8
-rw-r--r--t/precheck.t8
3 files changed, 10 insertions, 10 deletions
diff --git a/t/cgi.t b/t/cgi.t
index b992af31..f7035228 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -43,7 +43,7 @@ my $failbox = "$home/fail.mbox";
 local $ENV{PI_EMERGENCY} = $failbox;
 {
         local $ENV{HOME} = $home;
-        local $ENV{RECIPIENT} = $addr;
+        local $ENV{ORIGINAL_RECIPIENT} = $addr;
 
         # ensure successful message delivery
         {
@@ -145,7 +145,7 @@ EOF
 
         {
                 local $ENV{HOME} = $home;
-                local $ENV{RECIPIENT} = $addr;
+                local $ENV{ORIGINAL_RECIPIENT} = $addr;
                 run_with_env({PATH => $main_path}, [$mda], \$in);
         }
         local $ENV{GIT_DIR} = $maindir;
diff --git a/t/mda.t b/t/mda.t
index d70288bc..3357718c 100644
--- a/t/mda.t
+++ b/t/mda.t
@@ -47,7 +47,7 @@ my $failbox = "$home/fail.mbox";
         my $good_rev;
         local $ENV{PI_EMERGENCY} = $failbox;
         local $ENV{HOME} = $home;
-        local $ENV{RECIPIENT} = $addr;
+        local $ENV{ORIGINAL_RECIPIENT} = $addr;
         my $simple = Email::Simple->new(<<EOF);
 From: Me <me\@example.com>
 To: You <you\@example.com>
@@ -135,7 +135,7 @@ Date: deadbeef
 {
         local $ENV{PI_EMERGENCY} = $failbox;
         local $ENV{HOME} = $home;
-        local $ENV{RECIPIENT} = $addr;
+        local $ENV{ORIGINAL_RECIPIENT} = $addr;
         local $ENV{PATH} = $main_path;
         my $mid = 'spam-train@example.com';
         my $simple = Email::Simple->new(<<EOF);
@@ -169,7 +169,7 @@ EOF
 {
         local $ENV{PI_EMERGENCY} = $failbox;
         local $ENV{HOME} = $home;
-        local $ENV{RECIPIENT} = $addr;
+        local $ENV{ORIGINAL_RECIPIENT} = $addr;
         local $ENV{PATH} = $main_path;
         my $mid = 'ham-train@example.com';
         my $simple = Email::Simple->new(<<EOF);
@@ -199,7 +199,7 @@ EOF
         my $faildir= "$home/faildir/";
         local $ENV{PI_EMERGENCY} = $faildir;
         local $ENV{HOME} = $home;
-        local $ENV{RECIPIENT} = $addr;
+        local $ENV{ORIGINAL_RECIPIENT} = $addr;
         local $ENV{PATH} = $fail_path;
         my $in = <<EOF;
 From: Faildir <faildir\@example.com>
diff --git a/t/precheck.t b/t/precheck.t
index 42592bc2..974d6a38 100644
--- a/t/precheck.t
+++ b/t/precheck.t
@@ -13,19 +13,19 @@ sub do_checks {
         my $f = Email::Filter->new(data => $s->as_string);
 
         ok(PublicInbox::MDA->precheck($f, undef),
-                "RECIPIENT unset is OK");
+                "ORIGINAL_RECIPIENT unset is OK");
 
         my $recipient = 'foo@example.com';
         ok(!PublicInbox::MDA->precheck($f, $recipient),
-                "wrong RECIPIENT rejected");
+                "wrong ORIGINAL_RECIPIENT rejected");
 
         $recipient = 'b@example.com';
         ok(PublicInbox::MDA->precheck($f, $recipient),
-                "RECIPIENT in To: is OK");
+                "ORIGINAL_RECIPIENT in To: is OK");
 
         $recipient = 'c@example.com';
         ok(PublicInbox::MDA->precheck($f, $recipient),
-                "RECIPIENT in Cc: is OK");
+                "ORIGINAL_RECIPIENT in Cc: is OK");
 }
 
 {