-# we depend on "report_safe 0" in /etc/spamassassin/*.cf with --headers
-sub do_spamc {
- my ($in, $out) = @_;
- my $rdr = { 0 => fileno($in) };
- my ($fh, $pid) = popen_rd([qw/spamc -E --headers/], undef, $rdr);
- defined $pid or die "failed to popen_rd spamc: $!\n";
- my $r;
- do {
- $r = sysread($fh, $$out, 65536, length($$out));
- } while (defined($r) && $r != 0);
- close $fh or die "close failed: $!\n";
- waitpid($pid, 0);
-
- ($? || $$out eq '') ? 0 : 1;
+if (scalar(@rejects) && scalar(@rejects) == scalar(@$dests)) {
+ $! = 65; # EX_DATAERR 5.6.0 data format error
+ die join("\n", @rejects, '');