Re: IMAP4 Message Head Incomplete?

Mark Overmeer <[email protected]> Wed, 25 May 2005 11:36:44 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Organization MARKOV Solutions
Message-ID <[email protected]>
* Raul Dias ([email protected]) [050525 09:25]:
> When moving a message from a MBOX folder to a IMAP4 folder, 
> using something like:
> $mbox_folder->message(0)->moveTo($imap_folder);
> 
> I get this error:
>   Method clone() is not defined for a Mail::Box::IMAP4::Head.
> 
> However, when I do a copyTo() instead, it works.
> AFAIU, moveTo should be the same as copyTo plus a call to delete(),
> right?

No, not entirely.  The copy could decide to make a deep copy of the
whole message: there is a need for a second instance.  The move can
reside to only a re-administration.  Like cp and mv on UNIX: cp is
slow and mv is fast.

I see that the autoloading in IMAP4::Head is missing.  This means that I
need some time to send you a (probably large) fix.  Hopefully today.

> I also noted that IMAP4 is one of the few folder type that have a ::Head
> package.  Other folders (like POP3, MBox) do not.

That is because the IMAP protocol can provide some of the header lines
via a separate path.  They are kept in that ::Head object.  In my first
investigation, I suspect it should be derived from
Mail::Message::Head::Subset, not Mail::Message::Head.  It's quite some
time since I last had a look at this code...

> If try $imap_folder->message(0)->print it will fail because there is 
> no $imap_message->head->print method defined.
> So is it incomplete?!?

Probably.  As you can see in de manpage, it says: 'under development'
for Mail::Box::IMAP4.  Mainly because I didn't get enough feedback on
the code.  That doesn't mean that I do not intend to make it to work
perfectly, but I cannot do that alone for folder types which require
external servers... mbox/maildir/mh are much easier to get right.
So I hope you can help me to get a step ahead.
-- 
               MarkOv

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