Subject: | Mailer/testfile.pm should write the sender address into the fake header |
testfile.pm currently writes a header like this:
test 1 Fri Dec 2 15:00:34 2005
to: me@here
The to: information is what is being used as "rcpt to" information in the SMTP envelope for other mailing methods. For debugging purposes, it should write what is being used as "mail from" SMTP envelope information as well. I'm thinking of putting what Mail::Util::mailaddress() returns here. This would be of particular help when trying to find out what the SMTP method does by temporarily switching to testfile -- SMTP uses mailaddress() at all times.
--- testfile.pm.orig 2004-03-10 16:52:15.000000000 +0100
+++ testfile.pm.patched 2005-12-02 15:18:41.295039400 +0100
@@ -1,6 +1,7 @@
package Mail::Mailer::testfile;
use vars qw(@ISA $VERSION %config);
+use Mail::Util qw(mailaddress);
require Mail::Mailer::rfc822;
@ISA = qw(Mail::Mailer::rfc822);
$VERSION = '0.02';
@@ -15,7 +16,8 @@
my($self, $exe, $args, $to) = @_;
open F,'>>', $Mail::Mailer::testfile::config{outfile};
print F "\n===\ntest ", ++$num, " ",
- (scalar localtime), "\nto: " . join(' ',@{$to}) . "\n\n";
+ (scalar localtime), "\nfrom: " .
+ mailaddress() . "\nto: " . join(' ',@{$to}) . "\n\n";
close F;
untie(*$self) if tied *$self;
tie *$self, 'Mail::Mailer::testfile::pipe', $self;