Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

BinGOs (7246)

BinGOs
  (email not shown publicly)
http://gumbynet.org.uk/

System administrator, part-time Perl hacker, full-time POE [perl.org] evangelist. One day he will be made to pay for his crimes.

He has some modules on CPAN [cpan.org]. They may or may not be useful

Journal of BinGOs (7246)

Friday March 30, 2007
10:40 AM

CPAN Testing woes

[ #32845 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.