Re: Mail::Box::IMAP updates

Mark Overmeer <[email protected]> Mon, 20 Dec 2004 10:04:46 +0100
Newsgroups gmane.comp.lang.perl.modules.mail-box
Organization MARKOV Solutions
Message-ID <[email protected]>
* Tom Allison ([email protected]) [041220 03:03]:
> But this is where I'm at with using Mail::Box::IMAP4
> 
> I can create a folder using something like
> $client = new Mail::IMAPClient(...)
> $imap Mail::Box::IMAP4->new(imap_client=>$client
> 			    , folder => 'INBOX');
> print join ("\n", $imap->messageIds);
> $imap->close
> This throws the error:
> Not an ARRAY reference at /usr/share/perl5/Mail/Transport/IMAP4.pm line 268
> This seems to be related to my $imap->close statement and it fairly 
> consistent.  I guess this is just a comment for Mark Overmeer.

    foreach  my $s (values %flags2labels)
 -  {   $labels->{$_->[0]} = not $_->[1] unless exists $labels->{$_->[0]};
 +  {   $labels->{$s->[0]} = not $s->[1] unless exists $labels->{$s->[0]};
    }

The IMAP client is the less tested of all folder types.  Probably no-one
is using it because there is no support for encryption yet.  I have seen
how IMAPTalk does it (it's quite simple to implement) but lack the time
to get it in.

The IMAP client is far from perfect, I am sure.  Maybe you can help me
getting it a level higher.

> A question that I have with this is how do I turn up the debugging for 
> the $imap object identified above?  I was able to debug the 
> Mail::Box::Manager's IMAP interface, but I can't seem to duplicate that 
> here.

For almost all MailBox classes, you can add 'log' and 'trace' options.
'log' will store the info inside the object (log => 'NONE' disables that)
and 'trace' reports it on the screen.  trace => 'DEBUG'

> Also, is there a mailing list for HTML::FromMail?

No... I have only one report of some other than me using it, so that
would be overkill.

> What I'm really after is trying to use the Mail::Box architecture to 
> build an IMAP webclient that runs with HTML::Mason.

Interesting

> I have looked into the various methods of Mail 
> to HTML and quite frankly they all give me a headache.  MIME is 
> fantastically ugly.

Email looks so simple... that's why there are so many implementations
on CPAN.  But handling all the nasty things of RFCs is quite complicated.
With $head->get('From') you get the usual implementation: fast and sloppy.
With $head->study('From') you get the full implementation
(Mail::Message::Field::Full): slower but compliant.  Handles all kinds
of encoding and decoding.
-- 
               MarkOv

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