Subject: | Forcing Net::SMTP in Test::Reporter and cpantest |
Richard,
I have found the attached mods to Test::Reporter and cpantest to be useful. The intent is to provide a way to tell Test::Reporter to use Net::SMTP even if Mail::Send is avaialable. The motivation for it, quite frankly, was laziness.
I have a MacOS X system which is behind a NAT router. Surely it was I who installed Mail::Send (unless it's part of the core now, which seems unlikely), but I don't remember doing so. MacOS X has just enough of Postfix installed to try to send mail, but not enough to do anything useful, and I'm too lazy to try to sort out a working configuration for sending mail on a system I have no intent to use as a mail server. It was much easier to put the relevant two lines of code in Reporter.pm (not counting the POD), and three in cpantest to make use of them (not counting the "usage" lines).
The attached tarball contains diff -u files for the relevant pieces/parts. I have taken the liberty to modify the version number, but that does NOT mean I assert the right to version your code - I was just trying to distinguish the modified code from the original from which I worked.
What the diff files do is to give Test::Reporter an 'smtp' attribute. If this attribute is true, Net::SMTP is used to send mail, even if Mail::Send is installed. The cpantest script gets a corresponding -smtp option, with machinery to use it to set the smtp attribute of the Test::Reporter object. I dithered over the name of both attribute and method (the alternate being 'force_smtp'), but finally settled on the shorter one for my own use. I figured that if you accepted the change you would rename things if you thought it good, and in the meantime I would type less.
Here's the canonical system information.
Distribution: Test-Reporter-1.27
Perl version: v5.8.6
OS vendor/version: Darwin Wyants-White-iMac.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc
Thank you very much,
Tom Wyant
Message body not shown because it is not plain text.