Re: Re[4]: copyMessage

Mark Overmeer <[email protected]> Sat, 11 Jun 2005 01:42:15 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Organization MARKOV Solutions
Message-ID <[email protected]>
* danny Zak ([email protected]) [050610 22:30]:
> //
> it is due to the ^M at each line in the body ..
> is there a way to get rid of the ^M in the message withour recomposing
> it ?
> 
> like doing
> $in->body =~ s/\015//g;
> i tried this but it not a lvalue  :(
> 
> $mgr->copyMessage($in,$out);

Actually there is no such way.  Maybe there should be some option
in the pop (and Imap) driver which converts messages into 'local
native' line format...

When the body is in Mail::Message::Body::Lines format, you could
probably do 

      my $lines = $msg->body->lines;
      s/\r$// foreach @$lines;

However: this will change the Content-Length, which is stored in
the body object.  Yes, I think Mail::Transport::POP3 needs to be
adapted for a correct fix...
-- 
               MarkOv

------------------------------------------------------------------------
drs Mark A.C.J. Overmeer                                MARKOV Solutions
       [email protected]                          [email protected]
http://Mark.Overmeer.net                   http://solutions.overmeer.net