]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-mda
Merge remote-tracking branch 'origin/inboxdir'
[public-inbox.git] / script / public-inbox-mda
index dea49dc547820616ad88a53d0bd2e39b91ab34f1..584218b54c5a179d9b4adb86e0ef0caabf40f8de 100755 (executable)
@@ -5,7 +5,8 @@
 # Mail delivery agent for public-inbox, run from your MTA upon mail delivery
 use strict;
 use warnings;
-my $usage = 'public-inbox-mda < rfc2822_message';
+my $usage = 'public-inbox-mda [OPTIONS] < rfc2822_message';
+my $precheck = grep(/\A--no-precheck\z/, @ARGV) ? 0 : 1;
 my ($ems, $emm);
 
 sub do_exit {
@@ -55,7 +56,9 @@ $dst->{inboxdir} or do_exit(67);
 $dst = PublicInbox::InboxWritable->new($dst);
 
 # pre-check, MDA has stricter rules than an importer might;
-do_exit(0) unless PublicInbox::MDA->precheck($simple, $dst->{address});
+if ($precheck && !PublicInbox::MDA->precheck($simple, $dst->{address})) {
+       do_exit(0);
+}
 $simple = undef;
 my $spam_ok;
 if ($spamc) {