Documentation/public-inbox-mda.txt | 2 +- public-inbox-mda | 4 ++-- scripts/import_gmane_spool | 6 +++--- t/cgi.t | 4 ++-- t/mda.t | 8 ++++---- t/precheck.t | 8 ++++---- diff --git a/Documentation/public-inbox-mda.txt b/Documentation/public-inbox-mda.txt index 2957093904af88ddd44ab9332fe1691d7f4b0d94..8e33e02f6602a7fbe218fff42b3fb80ba8d9b7ed 100644 --- a/Documentation/public-inbox-mda.txt +++ b/Documentation/public-inbox-mda.txt @@ -11,7 +11,7 @@ Each system user may have their own public-inbox instances # ENVIRONMENT -* RECIPIENT - the recipient email address, from Postfix +* ORIGINAL_RECIPIENT - the original recipient email address, from Postfix * PI_CONFIG - config file. default: ~/.public-inbox/config * PI_EMERGENCY - emergency destination. default: ~/.public-inbox/emergency/ diff --git a/public-inbox-mda b/public-inbox-mda index 504fefd7ee1a042351ea2adb98edaad35f51dc2a..6c446749c28cee37e6e8b8482a8a8c6c2c2d0fe5 100755 --- a/public-inbox-mda +++ b/public-inbox-mda @@ -25,8 +25,8 @@ # this reads the message from stdin my $filter = Email::Filter->new(emergency => $emergency); my $config = PublicInbox::Config->new; -my $recipient = $ENV{RECIPIENT}; -defined $recipient or die "RECIPIENT not defined in ENV\n"; +my $recipient = $ENV{ORIGINAL_RECIPIENT}; +defined $recipient or die "ORIGINAL_RECIPIENT not defined in ENV\n"; my $dst = $config->lookup($recipient); defined $dst or exit(1); my $main_repo = $dst->{mainrepo} or exit(1); diff --git a/scripts/import_gmane_spool b/scripts/import_gmane_spool index e072b810d5c1275c2f3acec6fef0e10942ec4e76..3cda0bf6d7dc8d2c5517347d103849627467012b 100755 --- a/scripts/import_gmane_spool +++ b/scripts/import_gmane_spool @@ -6,10 +6,10 @@ # One-off script to convert an slrnpull news spool from gmane, usage: =begin usage mkdir -p $HOME/.public-inbox MAINREPO=/path/to/your/repo.git - export RECIPIENT='list@example.com' + export ORIGINAL_RECIPIENT='list@example.com' git init --bare $MAINREPO export GIT_CONFIG=$HOME/.public-inbox/config - git config publicinbox.$LISTNAME.address $RECIPIENT + git config publicinbox.$LISTNAME.address $ORIGINAL_RECIPIENT git config publicinbox.$LISTNAME.mainrepo $MAINREPO unset GIT_CONFIG ./import_gmane_spool SLRNPULL_ROOT/news/foo/bar @@ -22,7 +22,7 @@ use PublicInbox::Config; use IPC::Run qw(run); sub usage { "Usage:\n".join("",grep(/\t/, `head -n 24 $0`)) } my $spool = shift @ARGV or die usage(); -defined $ENV{RECIPIENT} or die usage(); +defined $ENV{ORIGINAL_RECIPIENT} or die usage(); my @args = ('public-inbox-mda'); chdir $spool or die "chdir $spool failed: $!\n"; diff --git a/t/cgi.t b/t/cgi.t index b992af311e4fefedd098ffbb5c2af10bda7a226e..f7035228e29534a70ebda7faeedbd99e82b2c6a0 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 @@ my $in = $reply->as_string; { 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 d70288bc785d419039cb0f367f65e071e4e247b1..3357718cd08b67c92f734f22fbd117b3decf944f 100644 --- a/t/mda.t +++ b/t/mda.t @@ -47,7 +47,7 @@ { 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(< To: You @@ -135,7 +135,7 @@ # spam training { 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(<new(< diff --git a/t/precheck.t b/t/precheck.t index 42592bc271fc0448e0ab49d764b544913efa83c2..974d6a3879d2d0440a56f193f588004b41beca5a 100644 --- a/t/precheck.t +++ b/t/precheck.t @@ -13,19 +13,19 @@ 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"); } {