my $dedupe = $lei->{dedupe} // die 'BUG: {dedupe} missing';
$dedupe->prepare_dedupe;
my @cmd = qw(curl -XPOST -sSf);
+ $opt->{torsocks} = 'false' if $opt->{'no-torsocks'};
my $tor = $opt->{torsocks} //= 'auto';
if ($tor eq 'auto' && substr($uri->host, -6) eq '.onion' &&
(($lei->{env}->{LD_PRELOAD}//'') !~ /torsocks/)) {
}
my $verbose = $opt->{verbose};
push @cmd, '-v' if $verbose;
+ for my $o ($lei->curl_opt) {
+ $o =~ s/\|[a-z0-9]\b//i; # remove single char short option
+ if ($o =~ s/=[is]@\z//) {
+ my $ary = $opt->{$o} or next;
+ push @cmd, map { ("--$o", $_) } @$ary;
+ } elsif ($o =~ s/=[is]\z//) {
+ my $val = $opt->{$o} // next;
+ push @cmd, "--$o", $val;
+ } elsif ($opt->{$o}) {
+ push @cmd, "--$o";
+ }
+ }
push @cmd, $uri->as_string;
$lei->err("# @cmd") if $verbose;
$? = 0;
}
$lei->{ovv}->ovv_end($lei);
if ($has_l2m) { # close() calls LeiToMail reap_compress
- close(delete($lei->{1})) if $lei->{1};
+ if (my $out = delete $lei->{old_1}) {
+ if (my $mbout = $lei->{1}) {
+ close($mbout) or return $lei->fail(<<"");
+Error closing $lei->{ovv}->{dst}: $!
+
+ }
+ $lei->{1} = $out;
+ }
$lei->start_mua;
}
$lei->dclose;