Subject: | Issue with Mail::Message->build and Windows |
Date: | Wed, 19 Dec 2007 17:43:49 +0100 |
To: | <bug-Mail-Box [...] rt.cpan.org> |
From: | Daniel Schättgen <dsg [...] abraxas.de> |
Hello,
I try to write a little script in Perl, that sends all files in a folder to
a specific email-address and receive emails from a pop3 account and save the
attachments in a folder.
This script should be run under Unix and Windows.
Under Unix, everything is fine.
When i tested my script under windows I discovered, that all binaries
getting destroyed.
Even this few lines results in a broken binary:
use Mail::Box::Manager;
use strict;
my $mail = Mail::Message->build
( From => '',
To => '',
data => '',
Subject => '',
files => ['c:/temp/out/datei.zip']
);
$mail->body->part(1)->decoded->write(filename => 'c:/temp/out/mail.zip');
When i looked at the binaries, I found these difference:
Original file:
50 4B 03 04 0A 00 00 00 00 00 13 85 92 37 65 93
37 7B 07 00 00 00 07 00 00 00 09 00 00 00 44 61
74 65 69 2E 74 78 74 62 6C 61 62 6C 75 62 50 4B
01 02 14 00 0A 00 00 00 00 00 13 85 92 37 65 93
37 7B 07 00 00 00 07 00 00 00 09 00 00 00 00 00
00 00 00 00 20 00 00 00 00 00 00 00 44 61 74 65
69 2E 74 78 74 50 4B 05 06 00 00 00 00 01 00 01
00 37 00 00 00 2E 00 00 00 00 00
New File:
50 4B 03 04 0D 0A 00 00 00 00 00 13 85 92 37 65
93 37 7B 07 00 00 00 07 00 00 00 09 00 00 00 44
61 74 65 69 2E 74 78 74 62 6C 61 62 6C 75 62 50
4B 01 02 14 00 0D 0A 00 00 00 00 00 13 85 92 37
65 93 37 7B 07 00 00 00 07 00 00 00 09 00 00 00
00 00 00 00 00 00 20 00 00 00 00 00 00 00 44 61
74 65 69 2E 74 78 74 50 4B 05 06 00 00 00 00 01
00 01 00 37 00 00 00 2E 00 00 00 00 00
The Value 0A is replaced by 0D 0A (is that a LF/CR Problem)?
I tried
$mail->body->eol(LF);
but this results in
ERROR: Package Mail::Message::Body::Multipart does not implement
Mail::Message::Body::_data_from_lines.
Please warn the author, this shouldn't happen. at
C:/Perl/lib/Mail/Reporter.pm line 200
Mail::Reporter::notImplemented('Mail::Message::Body::Multipart=HASH(0x1d5964
c)') called at C:/Perl/lib/Mail/Message/Body.pm line 55
Mail::Message::Body::_data_from_lines('Mail::Message::Body::Multipart=HASH(0
x1d5964c)','ARRAY(0x1bfd88c)') called at C:/Perl/lib/Mail/Message/Body.pm
line 85
Mail::Message::Body::init('Mail::Message::Body::Multipart=HASH(0x1d5964c)','
HASH(0x1daa3b8)') called at C:/Perl/lib/Mail/Message/Body/Multipart.pm line
28
Mail::Message::Body::Multipart::init('Mail::Message::Body::Multipart=HASH(0x
1d5964c)','HASH(0x1daa3b8)') called at C:/Perl/lib/Mail/Reporter.pm line 27
Mail::Reporter::new('Mail::Message::Body::Multipart','based_on','Mail::Messa
ge::Body::Multipart=HASH(0x1da5468)','eol','LF','data','ARRAY(0x1bfd88c)')
called at C:/Perl/lib/Mail/Message/Body.pm line 40
Mail::Message::Body::new('Mail::Message::Body::Multipart','based_on','Mail::
Message::Body::Multipart=HASH(0x1da5468)','eol','LF','data','ARRAY(0x1bfd88c
)') called at C:/Perl/lib/Mail/Message/Body.pm line 196
Mail::Message::Body::eol('Mail::Message::Body::Multipart=HASH(0x1da5468)','L
F') called at C:/Dokumente und Einstellungen/dsg/wsPerl/CapMail/mail.pl line
10
I hope you can give me a clue how to work around this issue.
Thank You very much !
Daniel Schättgen
Perl-Version:
This is perl, v5.8.3 built for MSWin32-x86-multi-thread
MailBox-Version:
2.079
abraxas Software-Entwicklungsgesellschaft mbH
Altenkesselerstr. 17 66115 Saarbrücken
Tel 0681 9762 140 Fax 0681 9762 255
HRB: 9540, Saarbrücken GF: Dr. Stefan Mittelbach
<blocked::http://www.abraxas.de/> http://www.abraxas.de
<mailto:daniel.schaettgen@abraxas.deaniel.schaettge>
daniel.schaettgen@abraxas.de
Message body is not shown because it is too large.