jkeenan1 has asked for the wisdom of the Perl Monks concerning the following question:

I am evidently missing something with respect to using Test::Reporter for the purpose of sending test reports to cpan-testers@perl-org.

As reported in a thread I began yesterday (Getting Modules Hot Off the Keyboard), I decided to hack up a script which enables me to download a new version of a module as soon as it appears on http://www.cpan.org, test it and send a test report off to perl.cpan.testers. Since this is something I (as yet) only want to do occasionally, I don't need the full-fledged automated testing apparatus; I just need a hack that gets the job done.

The program I wrote can be found at Re^2: Getting Modules Hot Off the Keyboard. For the purpose of this posting, let's focus just on this part:

my $reporter = Test::Reporter->new( grade => $grade, distribution => $localdir, from => 'Jim Keenan (testing@yahoo.com)', comments => $comment, ); if ($opts{s}) { print "Sending mail ...\n"; $reporter->send() || croak $reporter->errstr(); } else { print $reporter->subject(), "\n"; print $reporter->from(), "\n"; print "\nREPORT:\n\n"; print $reporter->report, "\n"; print $reporter->grade(), "\n"; print "No mail sent\n"; }

The use of getopts() enables me to do a dry run of the test and see what the report will look like.

When I first tried sending test reports this morning, I was getting an error message that read something like this (working from memory):

Test::Reporter could not send the message.

After studying the Test::Reporter docs, I had a hunch that installing Mail::Send would lead to better results. It did. I no longer got the error message, and my script made it through to the Finished line.

There was just one problem: My mail was not arriving at its destination. Several hours later, the four test reports I sent out had failed to appear on any of the interfaces (mail, news or web) to cpan-testers.

Now, since this is the first time I have ever written a program which sends mail, I'm really in the dark. I looked at the docs for Test::Reporter, Mail::Send and Mail::Mailer. I looked at QandASection: mail and news. I did SuperSearches and googled for Test::Reporter. Nothing self-evidently helpful turned up.

I also took a look at /var/log/mail.log. But since I know so little about mail, I'm going to include the tail here in the hope that someone can give me a clue.

Oct 9 14:18:50 localhost postfix/qmgr[4121]: A9D2D1BE8D1: from=<jimk@ +Macintosh.local>, size=5678, nrcpt=1 (queue active) Oct 9 14:18:50 localhost postfix/qmgr[4121]: C5ADB1BE8C7: from=<jimk@ +Macintosh.local>, size=2377, nrcpt=1 (queue active) Oct 9 14:18:53 localhost postfix/smtp[4392]: 86A811BE845: to=<cpan-te +sters@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=18391 +, status=deferred (host mx.develooper.com[63.251.223.176] said: 450 C +ould not resolve Macintosh.local (in reply to MAIL FROM command)) Oct 9 14:18:53 localhost postfix/smtp[4391]: 6A3691BE8DD: to=<cpan-te +sters@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=6317, + status=deferred (host mx.develooper.com[63.251.223.176] said: 450 Co +uld not resolve Macintosh.local (in reply to MAIL FROM command)) Oct 9 14:18:53 localhost postfix/smtp[4390]: 2B6511BE839: to=<cpan-te +sters@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=18512 +, status=deferred (host mx.develooper.com[63.251.223.176] said: 450 C +ould not resolve Macintosh.local (in reply to MAIL FROM command)) Oct 9 14:18:53 localhost postfix/smtp[4389]: 27FFE1BE850: to=<cpan-te +sters@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=18090 +, status=deferred (host mx.develooper.com[63.251.223.176] said: 450 C +ould not resolve Macintosh.local (in reply to MAIL FROM command)) Oct 9 14:18:53 localhost postfix/smtp[4393]: A9D2D1BE8D1: to=<cpan-te +sters@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=6813, + status=deferred (host mx.develooper.com[63.251.223.176] said: 450 Co +uld not resolve Macintosh.local (in reply to MAIL FROM command)) Oct 9 14:18:56 localhost postfix/smtp[4392]: C5ADB1BE8C7: to=<cpan-te +sters@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=6851, + status=deferred (host mx.develooper.com[63.251.223.176] said: 450 Co +uld not resolve Macintosh.local (in reply to MAIL FROM command))

Can anyone give me a diagnostic hint (and point me in the direction of mail for dummies)? Thanks in advance.

Jim Keenan

UPDATE: Also googled archives of comp.lang.perl.misc and c.l.p.modules for Test::Reporter. Nada.

Replies are listed 'Best First'.
Re: Mail Sent with Test::Reporter Not Getting Delivered
by randyk (Parson) on Oct 10, 2005 at 03:44 UTC
    From the mail log, it looks like messages like
    Oct 9 14:18:53 localhost postfix/smtp[4393]: A9D2D1BE8D1: to=<cpan-testers@perl.org>, relay=mx.develooper.com[63.251.223.176], delay=6813, status=deferred (host mx.develooper.com[63.251.223.176] said: 450 Could not resolve Macintosh.local (in reply to MAIL FROM command))
    is the problem - mx.develooper.com needs to be able to resolve the machine name specified in your FROM header. I'm not that familiar with Macintosh, but is your host name specified as Macintosh.local? If so, if you have a permanent IP address, try changing your host name to that associated with the address.
      I'm on DSL, so (I think) that means I do not have a permanent IP address.

      OTOH, I have manually posted to this and other perl.org lists many times. It should be said, however, that I'm usually posting to the news interface rather than sending mail.

      I subscribed to cpan-testers@perl.org yesterday with my Macintosh Mail program. This was done prior to my sending the undelivered mail in the hope that registering would ease the way.

      So I would guess that Test::Reporter (or, perhaps, Mail::Send underneath it) is sending out the mail with Macintosh.local as the host name. Is there a workaround?

      Thank you very much.

        A similar issue was discussed on the Cpanplus-devel list; one suggestion raised there was to install Net::Domain to attempt to get the domainname. You might try installing that, if it's not already present. Another option, as described in Test::Reporter::Mail::Util, is to set the MAILDOMAIN environment variable.

        All this assumes though that your domainname is valid (ie, is associated with a real IP address). If you don't have a permanent IP address, your ISP will probably have an SMTP server that you can use for outgoing email; you could try using mail_send_args of Test::Reporter to specify the smtp server to pass to Mail::Mailer.