about summary refs log tree commit homepage
path: root/script/public-inbox-mda
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-11 09:04:58 +0000
committerEric Wong <e@80x24.org>2023-11-11 21:20:44 +0000
commit9e178030413ba697b8e07b87238bcc58de21b4dd (patch)
tree6636f97c40d5211345d091494c725d1cf0df7656 /script/public-inbox-mda
parentd002f24a9648d1499a16ed4dec84f05c0f849740 (diff)
downloadpublic-inbox-9e178030413ba697b8e07b87238bcc58de21b4dd.tar.gz
-mda now honors `--help' properly and invocations missing
ORIGINAL_RECIPIENT now fail with EX_NOUSER.

Helped-by: Leah Neukirchen <leah@vuxu.org>
Link: https://public-inbox.org/meta/87msvlguqu.fsf@vuxu.org/
Diffstat (limited to 'script/public-inbox-mda')
-rwxr-xr-xscript/public-inbox-mda7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/public-inbox-mda b/script/public-inbox-mda
index 04fd8aad..b2e0908d 100755
--- a/script/public-inbox-mda
+++ b/script/public-inbox-mda
@@ -20,6 +20,10 @@ use PublicInbox::Import;
 local $PublicInbox::Import::DROP_UNIQUE_UNSUB; # does this need a CLI switch?
 GetOptions('precheck!' => \$precheck, 'help|h' => \$show_help) or
         do { print STDERR $help; exit 1 };
+if ($show_help) {
+        print $help;
+        exit;
+}
 
 my $do_exit = sub {
         my ($code) = shift;
@@ -59,7 +63,8 @@ if (defined $recipient) {
 if (!scalar(@$dests)) {
         $dests = PublicInbox::MDA->inboxes_for_list_id($cfg, $eml);
         if (!scalar(@$dests) && !defined($recipient)) {
-                die "ORIGINAL_RECIPIENT not defined in ENV\n";
+                warn "ORIGINAL_RECIPIENT not defined in ENV\n";
+                $do_exit->(67); # EX_NOUSER
         }
         scalar(@$dests) or $do_exit->(67); # EX_NOUSER 5.1.1 user unknown
 }