about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 20:17:20 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 20:17:49 +0000
commit34bc77692cb57a13dda5b8e7ea1c43fbccfec0af (patch)
treeb49394d5a6dcc1bc6f43d1c56fbe660ffb815135 /script
parente5c2e2588d7ad2243afeabad67b3c951c5b66643 (diff)
downloadpublic-inbox-34bc77692cb57a13dda5b8e7ea1c43fbccfec0af.tar.gz
I mainly focus on -watch for mirroring busy mailing lists, but
using -mda should remain an option.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-mda14
1 files changed, 12 insertions, 2 deletions
diff --git a/script/public-inbox-mda b/script/public-inbox-mda
index f1eaf629..766d58a6 100755
--- a/script/public-inbox-mda
+++ b/script/public-inbox-mda
@@ -78,8 +78,18 @@ if (ref($ret) && $ret->isa('Email::MIME')) { # filter altered message
 } # else { accept
 
 PublicInbox::MDA->set_list_headers($mime, $dst);
-my $git = PublicInbox::Git->new($main_repo);
-my $im = PublicInbox::Import->new($git, $dst->{name}, $recipient);
+my $v = $dst->{version} || 1;
+my $im;
+if ($v == 2) {
+        require PublicInbox::V2Writable;
+        $im = PublicInbox::V2Writable->new($dst);
+        $im->{parallel} = 0; # pointless to be parallel for a single message
+} elsif ($v == 1) {
+        my $git = $dst->git;
+        $im = PublicInbox::Import->new($git, $dst->{name}, $recipient, $dst);
+} else {
+        die "Unsupported inbox version: $v\n";
+}
 if (defined $im->add($mime)) {
         $emm = $emm->abort;
 } else {