-my $cfg = $config->lookup($recipient);
-defined $cfg or exit(1);
-use Data::Dumper; print STDERR Dumper($cfg);
+my $ibx = $config->lookup($recipient);
+my $git = $ibx->git;
+my $im;
+if ($ibx->version == 2) {
+ require PublicInbox::V2Writable;
+ $im = PublicInbox::V2Writable->new($ibx);
+ $im->{parallel} = 0; # pointless to be parallel for a single message
+} else {
+ $im = PublicInbox::Import->new($git, $ibx->{name},
+ $ibx->{-primary_address});
+}
+
+$ibx->{filter} ||= 'PublicInbox::Filter::Gmane';
+my $filter = $ibx->filter;
+
+sub key {
+ "publicinbox.$ibx->{name}.importslrnspoolstate";
+}