So, I woke up the other morning to find that the mail exchanger for cpan-testers@perl.org was rejecting my lovingly generated CPAN smoke reports, with 552 No ID? No Mail.
I use CPAN::YACSmoke, which uses CPANPLUS, which is using Test::Reporter, which by default uses Net::SMTP. And Net::SMTP doesn't generate a Message-ID header. Oh noes.
A quick code addition to POE::Component::Server::SimpleSMTP and use of the following script:
use strict;
use warnings;
use Data::Dumper;
use POE qw(Component::Server::SimpleSMTP Component::Client::DNS);
use Getopt::Long;
my ($address,$hostname);
GetOptions ( 'address' => \$address, 'hostname' => \$hostname );
die "You must specify an address and hostname\n" unless $address and $hostname;
my $named = POE::Component::Client::DNS->spawn();
POE::Session->create(
package_states => [
'main' => [ qw(_start _default smtpd_send_failed) ],
],
);
$poe_kernel->run();
exit 0;
sub _start {
$_[HEAP]->{smptd} = POE::Component::Server::SimpleSMTP->spawn(
address => $address,
hostname => $hostname,
resolver => $named,
);
return;
}
sub smtpd_send_failed {
my ($uid,$error) = @_[ARG0..ARG1];
print "$uid\n";
print Dumper($error);
return;
}
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
return 0 unless $event =~ /^smtpd/;
my @output = ( "$event: " );
foreach my $arg ( @$args ) {
if ( ref($arg) eq 'ARRAY' ) {
push( @output, "[" . join(" ,", @$arg ) . "]" );
} else {
push ( @output, "'$arg'" );
}
}
print STDOUT join ' ', @output, "\n";
return 0;
}
and using the CPANPLUS' cpantest_mx option to specify a mail exchanger to route mail through, I got CPAN test reports flowing again.
Could have done without all the hassle mind.
Re:I noticed this too
BinGOs on 2007-03-31T11:52:16
Nice one.