Subject: | Need Option to Send Mail Without Transfer Encoding |
Reporting bug (conceptual limitation) in Mail::SendEasy v1.2.
This is perl, v5.8.4 built for darwin-2level
[jimk 515]$ uname -a
Darwin Macintosh.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
I was attempting to use Mail::SendEasy to send automated testing reports on modules posted to CPAN to cpan-testers@perl.org. I tried Mail::SendEasy because I was not getting good results out of Test::Reporter or the modules on which it is built, Mail::Mailer and Mail::Send. So I formulated my test report in part manually (system calls on 'make') and in part from Test::Reporter. I then passed the test report off to Mail::SendEasy to send:
my $msg = Mail::SendEasy->new(
smtp => $smtp,
user => $user,
pass => $password,
);
my $status = $msg->send(
from => 'jkeenan_cpan_testing@yahoo.com',
from_title => 'James E Keenan',
to => 'cpan-testers@perl.org',
cc => 'jkeenan@cpan.org',
reply => 'jkeenan@cpan.org',
error => 'jkeenan@cpan.org',
subject => $reporter->subject(),
msg => $reporter->report,
);
At first I thought that I was completely successful. My test reports were correctly displayed when viewed as news (newsreader: Mozilla). When I cc-ed myself on the message, it read correctly thru my mail client (Macintosh Mail). The message was also correctly aggregated by Google: http://tinyurl.com/8ar98 . And when I cc-ed the message to a web mail address such as mail.yahoo.com, it displays there correctly as well.
My happiness, however, was short-lived. The text of the message appeared as garbage when posted to nntp.perl.org's web interface. (See: http://www.nntp.perl.org/group/perl.cpan.testers/258130.) And once it was posted incorrectly there, it was incorrectly aggregated by testers.cpan.org web interface. (See http://testers.cpan.org/author/FDALY.html, where it's simply showing up as "258130 PASS 0 on ()".)
I consulted with Ask Bjorn Hansen, who maintains nntp.perl.org. He responded by saying that that site does not support "Quoted-Printable" encoded e-mails. He followed up by saying that I need to post in "Regular mails without Transfer Encoding."
My guess is that the offending code is the following set of lines from Mail/SendEasy.pm:
if ( defined $mail{msg} ) {
$mail{msg} =~ s/\r\n?/\n/gs ;
if ( $mail{msg} !~ /\n\n$/s) { $mail{msg} =~ s/\n?$/\n\n/s ;}
my %part = (
'Content-Type' => 'text/plain; charset=ISO-8859-1' ,
'Content-Transfer-Encoding' => 'quoted-printable' ,
'content' => &_encode_qp( $mail{msg} ) ,
);
push(@{$mail{MIME}{part}} , \%part ) ;
}
if ( defined $mail{html} ) {
$mail{msg} =~ s/\r\n?/\n/gs ;
my %part = (
'Content-Type' => 'text/html; charset=ISO-8859-1' ,
'Content-Transfer-Encoding' => 'quoted-printable' ,
'content' => &_encode_qp( $mail{html} ) ,
);
push(@{$mail{MIME}{part}} , \%part ) ;
}
The mail format is hard-coded into the module. This is not very flexible design. Would it be possible to revise this so that the user of Mail::SendEasy could have the option of dispatching regular mail without transfer encoding? That would really make me want to use Mail::Send Easy more.
Thank you very much.
Jim Keenan