Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 31712
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: dsg [...] abraxas.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.

Subject: Re: [rt.cpan.org #31712] Issue with Mail::Message->build and Windows
Date: Wed, 19 Dec 2007 19:53:57 +0100
To: Daniel Schättgen via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Daniel Schättgen via RT (bug-Mail-Box@rt.cpan.org) [071219 16:44]: Show quoted text
> 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. > > Under Unix, everything is fine. > When i tested my script under windows I discovered, that all binaries > getting destroyed.
Most people have given-up on Windows... Anyway... yes probably a bug. Could you try this in lib/Mail/Message/Body.pm : sub write(@) { my ($self, %args) = @_; my $filename = $args{filename}; die "No filename for write() body" unless defined $filename; - open OUT, '>', $filename or return; + open OUT, '>:raw', $filename or return; $self->print(\*OUT); close OUT or return undef; $self; } Show quoted text
> $mail->body->eol(‘LF’); > ERROR: Package Mail::Message::Body::Multipart does not implement > Mail::Message::Body::_data_from_lines.
That's a sloppy error message! -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: AW: [rt.cpan.org #31712] Issue with Mail::Message->build and Windows
Date: Thu, 20 Dec 2007 09:44:19 +0100
To: <bug-Mail-Box [...] rt.cpan.org>
From: Daniel Schättgen <dsg [...] abraxas.de>
Hello, Your Solution fixed the Problem and works in Windows and Unix! Thank you very much ! Regards, Daniel Show quoted text
-----Ursprüngliche Nachricht----- Von: Mark Overmeer via RT [mailto:bug-Mail-Box@rt.cpan.org] Gesendet: Mittwoch, 19. Dezember 2007 19:55 An: dsg@abraxas.de Betreff: Re: [rt.cpan.org #31712] Issue with Mail::Message->build and Windows <URL: http://rt.cpan.org/Ticket/Display.html?id=31712 > * Daniel Schättgen via RT (bug-Mail-Box@rt.cpan.org) [071219 16:44]:
> 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. > > Under Unix, everything is fine. > When i tested my script under windows I discovered, that all binaries > getting destroyed.
Most people have given-up on Windows... Anyway... yes probably a bug. Could you try this in lib/Mail/Message/Body.pm : sub write(@) { my ($self, %args) = @_; my $filename = $args{filename}; die "No filename for write() body" unless defined $filename; - open OUT, '>', $filename or return; + open OUT, '>:raw', $filename or return; $self->print(\*OUT); close OUT or return undef; $self; }
> $mail->body->eol(‘LF’); > ERROR: Package Mail::Message::Body::Multipart does not implement > Mail::Message::Body::_data_from_lines.
That's a sloppy error message! -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
will be fixed in 2.080