r839 - in packages/libmail-box-perl/branches/upstream/current: . lib/Mail lib/Mail/Box lib/Mail/Box/Dbx lib/Mail/Box/Dir lib/Mail/Box/File lib/Mail/Box/IMAP4 lib/Mail/Box/Locker lib/Mail/Box/MH lib/Mail/Box/Maildir lib/Mail/Box/Manage lib/Mail/Box/Mbox lib/Mail/Box/Message lib/Mail/Box/Net lib/Mail/Box/POP3 lib/Mail/Box/Parser lib/Mail/Box/Search lib/Mail/Box/Thread lib/Mail/Box/Tie lib/Mail/Message lib/Mail/Message/Body lib/Mail/Message/Construct lib/Mail/Message/Convert lib/Mail/Message/Field lib/Mail/Message/Head lib/Mail/Message/Replace lib/Mail/Message/TransferEnc lib/Mail/Message/Wrapper lib/Mail/Server lib/Mail/Server/IMAP4 lib/Mail/Transport scripts tests tests/10reporter tests/11field tests/13body tests/14fieldu tests/40mbox tests/44imap tests/52manager tests/60imap

Gunnar Wolf gwolf at costa.debian.org
Sun Jul 17 08:08:59 UTC 2005


Author: gwolf
Date: 2005-03-30 17:42:04 +0000 (Wed, 30 Mar 2005)
New Revision: 839

Added:
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pod
   packages/libmail-box-perl/branches/upstream/current/tests/10reporter/20reports.t
   packages/libmail-box-perl/branches/upstream/current/tests/10reporter/30callback.t
   packages/libmail-box-perl/branches/upstream/current/tests/11field/40wrap.t
   packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/31struct.t
   packages/libmail-box-perl/branches/upstream/current/tests/44imap/30flags.t
   packages/libmail-box-perl/branches/upstream/current/tests/52manager/20user.t
   packages/libmail-box-perl/branches/upstream/current/tests/52manager/30collect.t
   packages/libmail-box-perl/branches/upstream/current/tests/60imap/
   packages/libmail-box-perl/branches/upstream/current/tests/60imap/10fetch.t
   packages/libmail-box-perl/branches/upstream/current/tests/60imap/20list.t
   packages/libmail-box-perl/branches/upstream/current/tests/60imap/Definition.pm
Removed:
   packages/libmail-box-perl/branches/upstream/current/tests/10report/
Modified:
   packages/libmail-box-perl/branches/upstream/current/ChangeLog
   packages/libmail-box-perl/branches/upstream/current/MANIFEST
   packages/libmail-box-perl/branches/upstream/current/META.yml
   packages/libmail-box-perl/branches/upstream/current/Makefile.PL
   packages/libmail-box-perl/branches/upstream/current/TODO.v2
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Cookbook.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Index.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Overview.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pod
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pm
   packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pod
   packages/libmail-box-perl/branches/upstream/current/scripts/mailbox2html
   packages/libmail-box-perl/branches/upstream/current/test.pl
   packages/libmail-box-perl/branches/upstream/current/tests/10reporter/10errors.t
   packages/libmail-box-perl/branches/upstream/current/tests/10reporter/Definition.pm
   packages/libmail-box-perl/branches/upstream/current/tests/11field/20fast.t
   packages/libmail-box-perl/branches/upstream/current/tests/13body/40multip.t
   packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/10full.t
   packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/30unstr.t
   packages/libmail-box-perl/branches/upstream/current/tests/40mbox/50create.t
   packages/libmail-box-perl/branches/upstream/current/tests/52manager/10open.t
   packages/libmail-box-perl/branches/upstream/current/tests/Tools.pm
Log:
Load /tmp/tmp.p8rNJv/libmail-box-perl-2.060 into
packages/libmail-box-perl/branches/upstream/current.


Modified: packages/libmail-box-perl/branches/upstream/current/ChangeLog
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/ChangeLog	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/ChangeLog	2005-03-30 17:42:04 UTC (rev 839)
@@ -7,12 +7,344 @@
       usually limited to areas which are under development.  Mail::Box
       is a huge module, so there is always a lot of activity.
 
-wat als appendMessage faalt?
-filehandle als bron folder?
-MH index in append mode niet lezen.
-gebruik Return-Path voor reply()
-flock() op flock(): zelfde process op AIX en Solaris
+version 2.060: Tue Mar 15 22:02:34 CET 2005
 
+	Fixes:
+
+	- Mail::Transport::IMAP4 crash on getFlags(). Reported by [Tom Allison]
+
+	- Mail::Transport::IMAP4 authenticate now uses server's
+	  reported capabilities.  On the path paved by [Tom Allison]
+
+	- Mail::Message::Field::toDate() now works around %z interpretation
+	  as textual time-zones when there are blanks in the name.
+	  [aa26 at mail.ru]
+
+	- Pod updage for Mail::Box::Dbx [Ralf Valerien]
+
+	- open('|-') does a fork, so a failure should result in an exit,
+	  not a return.  Found a few times in Mail::Transport::*, and
+	  discovered by [Slaven Rezic]
+
+	- $msg->send didn't pass the options correctly to the sending
+	  object. Reported by [Franck Richard].
+
+	- Mail::Transport::POP3 did only try APOP in AUTO mode. Found
+	  by [Markus Spann].
+
+	- Mail::Box::Manager::decodeFolderURL leaves the foldername
+	  starting with a slash.  That slash should be removed when
+	  the URL starts with a protocol ne 'file'. [Tom Allison]
+
+	- scripts/mailbox2html used setLabel(), which got replaced by
+	  label() a long time ago. Reported by [Alain Veylit]
+
+	- Mail::Message::Field::Attribute used Mail::Reporter without
+	  having it as base class.  Rewritten to have it that way.
+	  Reported by [Russell Mosemann]
+
+	- Removed the two uses of $& in reg-exps, which slows-down all
+	  regexp matches in older Perl versions.  Patch supplied by
+	  [jgmyers]
+
+	Improvements:
+
+	- Documented Mail::Box::Manager::open(authenticate) as
+	  suggested by [Tom Allison]
+
+	- $msg->bounce() without arguments now croaks. [Slaven Rezic]
+
+version 2.059: Tue Nov 30 19:50:42 CET 2004
+
+	Interface changes:
+
+	- Mail::Transport::IMAP4::flagsToLabels expects new first argument
+	  'REPLACE', 'SET', or 'CLEAR'.
+
+	Fixes:
+
+	- Installer didn't ask for optional Time::Hires
+
+	- [Anthony D. Urso] fixed an endless loop in study() for
+	  fields ending on blanks.
+
+	- [Russell Mosemann] found a different problem, in about
+	  the same line as the previous fix.
+
+	- Fixed memory leak in administration of messages in folder.
+
+	Improvements:
+
+	- $msg->printStructure is less strict on the format of the
+	  indentation: any white-space in it is sufficient.
+
+	- $msg->printStructure(undef) will return the structure as
+	  string.
+
+	- new method Mail::Server::IMAP4::Fetch::printStructure()
+	  for debugging purposes.
+
+version 2.058: Wed Sep 22 14:44:32 CEST 2004
+
+	Interface changes:
+
+	- [Andy Maas] rewrote Mail::Box::FastScalar, to boost performance.
+	  various bodyAsList() methods now prduce ref-arrays.  Shouldn't
+	  affect user programs. Requires Mail::Box::Parser::C v3.006
+
+	Fixes:
+
+	- [Jason Woodward ] had to wait much too long to get his
+	  twin-POP open problem solved.  Now, only one POP connection
+	  will be opened.  This may speed-up other programs as well.
+
+	- [Mike Mimic] foudn that the new INIT block in Mail::Reporter
+	  did not work well with his web-application.  Changed it into
+	  BEGIN.
+
+	- [Mail Minic] Mail::Transport::Exim did not handle strings
+	  as from address correctly.
+
+	- [Anonymous via RT] Use ExtUtils::MakeMaker::prompt() instead
+	  of own ask() in Makefile.PL, so MailBox can be installed with
+	  CPANPLUS.
+
+	- [aa29] $head->isMultipart did not return boolean in list
+	  context.
+
+	- [DH] removed INIT block from Mail::Reporter, which complains
+	  in Apache.
+
+	- [aa29] Mail::Box::MH->new failed because of initiation order
+
+	- pop3 folders do not need (have) a name, but Mail::Box::Manager::open
+	  required one.  Accidentally, sometimes that worked, because $ENV{MAIL}
+	  was used as default, however, that could cause various problems.
+
+	- {Tom Allison] found-out that imap was not autoloaded my the
+	  Mail::Box::Manager.
+
+	Improvements:
+
+	- warning message "Folder does not exist, ..." avoided when
+	  folder is opened for deletion.
+
+	- added Mail::Box::Identity::open()
+
+	- added Mail::Box::nrMessages() for simplification
+
+	- [Alessandro Zummo] showed me that docs about
+	     "why $head->delete($field) doesn't aways work" were needed.
+	  It's a nasty reference counting problem.
+
+version 2.057: Thu Aug 26 14:31:34 CEST 2004
+
+	Interface change:
+
+	- Moved the new Mail::Box::IMAP4::Fetch to Mail::Server::IMAP4::Fetch,
+	  which is a more logical name: part of a full server implementation.
+
+	- Moved the unusable module Mail::Box::Search::IMAP4 over to
+	  Mail::Server::IMAP4::Search... but still not implemented ;-)
+
+	- You have to add (share => 0) to $msg->moveTo if the source message
+	  can get undeleted in your program (for instance in a user
+	  application).
+
+	- Mail::Reporter->report(...) will return strings without \n. Sporadic
+	  locations where log() was called with trailing \n are removed.
+
+	- Opening a folder which is already open is considered an error (was
+	  warning) by the manager.
+
+	Fixes:
+
+	- [Jan Martin Mathiassen] add IO::File to Mail::Box::Dir::Message
+
+	- [Torsten Luettgert] found that field labels like '-' where not
+	  beautified correctly with wellformedName.
+
+	- Changed '.' from most preferred folder directory for the manager
+	  into the least preferred.
+
+	- $field->setWrapLength only worked for "fast" fields.  Tests in
+	  tests/11field/40wrap.t
+
+	- [Mike Mimic] showed that constructing unstructured "full" fields
+	  was broken.
+
+	- Mail::Box::POP3::delete() will not take any action.  Deleting all
+	  contained messages was not consequent.
+
+	Improvements:
+
+	- [David A Golden] demonstrated the need for $head->wrap(<size>)
+
+	- $folder->coerce($message) will only call MSGTYPE->coerce($message)
+	  when not a MSGTYPE yet.
+
+	- Mail::Box::Message::coerce() could be removed: no-op.
+
+	- Reimplemented folder->delete(), which is not reading the messages
+	  before deletion, but bluntly removes the folder in the most
+	  Efficient way. You probably want the new option 'recursive'.
+
+	- Mail::Box::new(access) now has mode 'd', which speeds up removal
+	  of folders.  Used by $folder->delete().
+
+	- Mail::Box::IMAP4 now supports deletion of a folder (untested)
+
+	- $folder->copyTo/moveTo and $msg->copyTo can have option 'share'
+	  which tries to use hardlinks i.s.o. clone() to put a message in
+	  a different folder.  Only available for some M<Mail::Box::Dir>
+	  folders.
+
+	- Mail::Message::clone() now accepts shallow_head and shallow_body
+	  arguments which avoid deep-cloning.
+
+	- Added references to the Netzwert folder type, which got implemented,
+	  but not released as GPL (yet?)
+
+	- Increased the status of the IMAP folder client from alpha to beta.
+
+	- New methods
+             Mail::Box::Manager::folderdir()
+	     Mail::Box::Manager::defaultFolderType()
+
+	- New methods
+	     Mail::Box::topFolderWithMessages()
+
+	- Moved tests/44imap/40fetch.t to tests/60imap/10fetch.t
+
+	- Mail::Box::nameOfSubFolder() now can be used as class method.
+
+	- New, specialized folder manager
+	     Mail::Box::Manage::User   manager with user knowledge
+	  tests in tests/52manager/20user.t
+	  explanation added to Mail::Box::Manager, about the two kinds
+	  of managers.
+
+	- New classes to administer folders, even when not opened
+	     Mail::Box::Identity       info about (possibly unopened) folder
+	     Mail::Box::Collection     info about groups of folders
+	  tests in tests/52manager/30collect.t
+
+	- New classes to implement parts of an IMAP4 server
+	     Mail::Server              place-holder
+	     Mail::Server::IMAP4       place-holder
+	     Mail::Server::IMAP4::List
+	  tests in tests/60imap/20list.t
+
+	- Split tests/10report/10errors.t into
+	  tests/10reporter/10errors.t and tests/10reporter/20reports.t
+
+	- Mail::Reporter::defaultTrace can now set a callback to catch
+	  each log/trace message.  Tests in tests/10reporter/30callback.t
+
+	- [chris] Mail::Message::Field::wellformedName() will upper-case
+	  *-ID as part in the fieldname.
+
+	- [M M] tried to user MBMbox->create and expected it to open the
+	  folder at the same time.  Documentation problem: moved the
+	  method from "constructors" to "internal".  Did the same for
+	  "foundIn".
+
+	- Produce an error if people try to build Mail::Box::*
+	  messages directly.
+
+	- Many improvements on User::Identity module.  MailBox requires
+	  version UI 0.90 now.
+
+version 2.056: Sat Jul 31 13:28:29 CEST 2004
+
+	Interface change:
+
+	- [Wiggins d Anconia] explained that combining MailBox with forks
+	  may cause non-unique message-ids to be created.  To solve this,
+	  the $head->messageIdPrefix() had to be rewritten.  MessageIDs will
+	  look differently now.  [No problems expected for existing programs]
+
+	Fixes:
+
+	- [Jeff Squyres] silenced warnings by guessTimestamp() and
+	  recvstamp() when no Date nor Received fields are present.
+
+	- [August] Mail::Box->new(lock_wait) option not correctly passed
+	  to Locker object.
+
+	- [Mime Mimic] noticed that a message reply used "sender", not
+          "From" addresses when no "Reply-To" field is present. This is
+          not according RFC2822.  Sender should never be used.
+
+	- [Jason Woodward] found a $_ localization error in POP3, which
+	  could result in "Can't call method "xxx" without a package or
+	  object reference" errors.
+
+	- [Carlos Perez] SpamAssasin's message wrapper method get_header()
+	  should return all field bodies with a certain name in list context.
+
+	- [Jason Woodward] $msg->shortString was broken.
+
+	- [Todd Richmond] discovered that un-quoted attribute values
+	  consumed the semi-colon separator in Mail::Message::Field.
+
+	- Content-Transfer-Encoding and Content-Disposition fields were
+	  ignored when specified with Mail::Message->build().  Now they
+	  will be applied to the create body AFTER the body is constructed
+	  based on default rules.
+
+	- [Todd Richmond] discovered that Base64 decoding should not be
+	  done on per line basis, because some lines may not have mod4
+	  number of characters (especially in virusses).  The RFC is not
+	  clear about it, so... Mail::Message::TransferEnc::Base64 is
+	  changed (again)
+
+	Improvements:
+
+	- [Rich Caller] suggested to change blanks in ill-formated
+	  message-ids into blanks.  Apparently, some applications are
+	  doing that.
+
+	- Mail::Message::Field::Unstructured now supportss character-set
+	  encodings, by request of [Mike Mimic]
+
+	- [Mike Mimic] made an unexpected abuse of $head->build().  It is
+	  now supported that ready field objects can be passed.  A warning
+	  is produced when you accidentally pass  field_name => $field_object
+	  (which should be: field_name => field_content  or simply
+	  $field_object.
+
+	- [Mike Mimic] Some link errors in the front HTML documentation page.
+
+	- Added $head->printSelected(FILE, patterns) as simple way to
+	  produce field subsets.
+
+	- Added support for label 'passed', which means that the message
+	  was used for forward/bounce/resend.
+
+	- Added Maildir message flag P='passed' (uncommon)
+
+	- Changed flag handling implementation in Mail::Transport::IMAP4.
+	  Tests are in tests/44imap/30flags.t
+
+	- $body->dispositionFilename can be used without directory name.
+
+	- Attachments auto-discompose as 'inline' for texts and `attachement'
+	  for binaries.
+
+	- Added Mail::Box::IMAP4::Fetch with tests in tests/44imap/40fetch.t
+	  which provides body/bodystructure/envelope syntax conversions.
+
+	- New $field->attributes (to list fields of all attributes) for
+	  Mail::Message::Field.
+
+	- Added description of differences between MIME::Entity::build()
+	  and Mail::Message::build().
+
+	- Mail::Message::Field::Structured can now be used for general
+	  structured fields with attributes, like Content-Type and
+	  Content-Description.
+
 version 2.055: Sun May 16 15:41:59 CEST 2004
 
 	Fixes:
@@ -128,6 +460,10 @@
 	- Mail::Transport::Exim takes exim4 binary with preference over
 	  usual exim MTA, on request by [Mike Mimic]
 
+	- [Mitar] Mail::Transport::Sendmail starts sendmail with -ti, not
+	  -it, which helps exim... either the default sendmail as the
+	  specialized Mail::Transport::Exim module will work now with exim.
+
 version 2.053: Thu Dec  4 00:13:50 CET 2003
 
 	Fixes:

Modified: packages/libmail-box-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/MANIFEST	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/MANIFEST	2005-03-30 17:42:04 UTC (rev 839)
@@ -21,6 +21,8 @@
 lib/Mail/Box-Overview.pod
 lib/Mail/Box.pm
 lib/Mail/Box.pod
+lib/Mail/Box/Collection.pm
+lib/Mail/Box/Collection.pod
 lib/Mail/Box/Dbx.pm
 lib/Mail/Box/Dbx.pod
 lib/Mail/Box/Dbx/Message.pm
@@ -41,6 +43,8 @@
 lib/Mail/Box/IMAP4/Head.pod
 lib/Mail/Box/IMAP4/Message.pm
 lib/Mail/Box/IMAP4/Message.pod
+lib/Mail/Box/Identity.pm
+lib/Mail/Box/Identity.pod
 lib/Mail/Box/Locker.pm
 lib/Mail/Box/Locker.pod
 lib/Mail/Box/Locker/DotLock.pm
@@ -65,6 +69,8 @@
 lib/Mail/Box/Maildir.pod
 lib/Mail/Box/Maildir/Message.pm
 lib/Mail/Box/Maildir/Message.pod
+lib/Mail/Box/Manage/User.pm
+lib/Mail/Box/Manage/User.pod
 lib/Mail/Box/Manager.pm
 lib/Mail/Box/Manager.pod
 lib/Mail/Box/Mbox.pm
@@ -91,8 +97,6 @@
 lib/Mail/Box/Search.pod
 lib/Mail/Box/Search/Grep.pm
 lib/Mail/Box/Search/Grep.pod
-lib/Mail/Box/Search/IMAP.pm
-lib/Mail/Box/Search/IMAP.pod
 lib/Mail/Box/Search/SpamAssassin.pm
 lib/Mail/Box/Search/SpamAssassin.pod
 lib/Mail/Box/Thread/Manager.pm
@@ -220,6 +224,16 @@
 lib/Mail/Message/Wrapper/SpamAssassin.pod
 lib/Mail/Reporter.pm
 lib/Mail/Reporter.pod
+lib/Mail/Server.pm
+lib/Mail/Server.pod
+lib/Mail/Server/IMAP4.pm
+lib/Mail/Server/IMAP4.pod
+lib/Mail/Server/IMAP4/Fetch.pm
+lib/Mail/Server/IMAP4/Fetch.pod
+lib/Mail/Server/IMAP4/List.pm
+lib/Mail/Server/IMAP4/List.pod
+lib/Mail/Server/IMAP4/Search.pm
+lib/Mail/Server/IMAP4/Search.pod
 lib/Mail/Transport.pm
 lib/Mail/Transport.pod
 lib/Mail/Transport/Exim.pm
@@ -246,11 +260,14 @@
 test.pl
 tests/01platform/10crlf.t
 tests/01platform/Definition.pm
-tests/10report/10errors.t
-tests/10report/Definition.pm
+tests/10reporter/10errors.t
+tests/10reporter/20reports.t
+tests/10reporter/30callback.t
+tests/10reporter/Definition.pm
 tests/11field/10cfws.t
 tests/11field/20fast.t
 tests/11field/30flex.t
+tests/11field/40wrap.t
 tests/11field/Definition.pm
 tests/12head/10create.t
 tests/12head/30partial.t
@@ -263,6 +280,7 @@
 tests/14fieldu/10full.t
 tests/14fieldu/20attr.t
 tests/14fieldu/30unstr.t
+tests/14fieldu/31struct.t
 tests/14fieldu/40parse.t
 tests/14fieldu/50userid.t
 tests/14fieldu/51addr.t
@@ -322,6 +340,7 @@
 tests/43pop3/server
 tests/44imap/10read.t
 tests/44imap/20write.t
+tests/44imap/30flags.t
 tests/44imap/Definition.pm
 tests/45dbx/10read.t
 tests/45dbx/Definition.pm
@@ -341,6 +360,8 @@
 tests/51folder/Definition.pm
 tests/52manager/10open.t
 tests/52manager/11urlopen.t
+tests/52manager/20user.t
+tests/52manager/30collect.t
 tests/52manager/Definition.pm
 tests/53threads/10single.t
 tests/53threads/Definition.pm
@@ -352,6 +373,9 @@
 tests/55locking/40posix.t
 tests/55locking/90multi.t
 tests/55locking/Definition.pm
+tests/60imap/10fetch.t
+tests/60imap/20list.t
+tests/60imap/Definition.pm
 tests/80msgconv/10mailint.t
 tests/80msgconv/20mimeent.t
 tests/80msgconv/Definition.pm

Modified: packages/libmail-box-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/META.yml	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/META.yml	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,13 +1,14 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Mail-Box
-version:      2.055
+version:      2.060
 version_from: lib/Mail/Box.pm
 installdirs:  site
 requires:
     Date::Parse:                   0
     Digest::HMAC_MD5:              0
     Errno:                         0
+    File::Remove:                  0.2
     File::Spec:                    0.7
     IO::Scalar:                    0
     Mail::Address:                 0
@@ -20,7 +21,7 @@
     Test::More:                    0.47
     Time::Zone:                    0
     URI:                           1.23
-    User::Identity:                0.07
+    User::Identity:                0.9
 
 distribution_type: module
 generated_by: ExtUtils::MakeMaker version 6.17

Modified: packages/libmail-box-perl/branches/upstream/current/Makefile.PL
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/Makefile.PL	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/Makefile.PL	2005-03-30 17:42:04 UTC (rev 839)
@@ -29,7 +29,7 @@
 
 my @optional =
 ( 
-  [ Mail::Box::Parser::C => '3.001'
+  [ Mail::Box::Parser::C => '3.006'
   , reason => <<'REASON', warning => <<'WARN' ]
 Speeds-up reading mail folders, though most time is consumed by
 Perl's administration of the processed data.
@@ -81,6 +81,11 @@
      if you want smart html conversions.
 REASON
 
+, [ Time::HiRes => '1.51', reason => <<'REASON' ]
+     When installed, unique message-ids will be created using gettimeofday.
+     Otherwise, generated message-ids will not be thread/fork safe.
+REASON
+
 , [ HTML::FormatText => '2.01', distr => 'HTML::Format', reason => <<'REASON' ]
 Plug-in which converts HTML to Postscript or plain text.
 REASON
@@ -89,6 +94,7 @@
 my %prereq =
  ( Date::Parse    => 0.0
  , File::Spec     => 0.7
+ , File::Remove   => 0.20
  , Errno          => 0.0
  , Scalar::Util   => 1.13
  , Object::Realize::Later => 0.14
@@ -101,7 +107,7 @@
  , URI            => 1.23
  , IO::Scalar     => 0.0
  , Digest::HMAC_MD5 => 0.0
- , User::Identity => 0.07
+ , User::Identity => 0.90
  , Time::Zone     => 0.0
  );
 
@@ -111,32 +117,6 @@
     $has_readkey = not length $@;
 }
 
-sub ask($$)
-{   my ($text, $default) = @_;
-    print "---> $text [$default] ";
-    my $key;
-
-    if(! -t STDIN) { $key = $default }
-    elsif($has_readkey)
-    {   Term::ReadKey->import;
-        ReadMode(3);   # cbreak mode
-        $key = ReadKey(0) until defined($key);
-        ReadMode(1);
-
-        $key = $default if $key =~ m/\n/;
-        print "$key\n";
-    }
-    else
-    {   # No Term::ReadKey
-        flush STDOUT;
-        my $line = <STDIN>;
-        $line    =~ m/(\S)/;
-        $key     = $1 || $default;
-    }
-
-    $key;
-}
-
 my $default_install_answer = $ENV{INSTALL_MAILBOX_OPTIONALS}
     || (-t STDIN ? 'y' : 'n');
 
@@ -227,7 +207,7 @@
     }
     
     my $install  = $default_install_answer;
-    my $key = ask "Do you want to install $module? yes/no/all", $install;
+    my $key = prompt "Do you want to install $module? yes/no/all", $install;
 
     if($key eq 'a')
     {   $default_install_answer = 'a';
@@ -245,7 +225,7 @@
     print "     Added $distr version $version to the requirements\n";
 }
 
-my $tests = ask "Do you want to run the (large set of) tests? yes/no", "yes";
+my $tests = prompt "Do you want to run the (large set of) tests? yes/no", "yes";
 if($tests =~ m/n/i)
 {   open F, ">", "skiptests";
     close F;

Modified: packages/libmail-box-perl/branches/upstream/current/TODO.v2
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/TODO.v2	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/TODO.v2	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,13 +1,23 @@
 
 This file lists the things to do
 
-Obligatory:
+Question marks:
 
+  what if appendMessage fails
+
+  flock() stacked on flock() by same process on AIX and Solaris
+
+Optional:
+
+  References/mozilla-flags
+
+  filehandle as folder source
+
+  no read for MH index in append mode niet lezen.
+
   Processing folders with non-platform-native line separators.
   appendMessage opens folder, but not needed.
 
-Optional:
-
   fix_header_errors option for Mail::Box::Parser::C
 
   Body::* _data_from_*() may use $. in some cases.  This would speed-up

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,66 @@
+use strict;
+use warnings;
+
+package Mail::Box::Collection;
+use vars '$VERSION';
+$VERSION = '2.060';
+use base qw/User::Identity::Collection Mail::Reporter/;
+
+use Mail::Box::Identity;
+
+use Scalar::Util    qw/weaken/;
+
+
+sub new(@)
+{   my $class = shift;
+    unshift  @_,'name' if @_ % 2;
+    $class->Mail::Reporter::new(@_);
+}
+                                                                                
+sub init($)
+{   my ($self, $args) = @_;
+    $args->{item_type} ||= 'Mail::Box::Identity';
+
+    $self->Mail::Reporter::init($args);
+    $self->User::Identity::Collection::init($args);
+                                                                                
+    weaken($self->{MBC_manager})
+       if $self->{MBC_manager}  = delete $args->{manager};
+    
+    $self->{MBC_ftype}    = delete $args->{folder_type};
+    $self;
+}
+
+sub type() { 'folders' }
+
+#------------------------------------------
+
+
+sub manager()
+{   my $self = shift;
+    return $self->{MBC_manager}
+        if defined $self->{MBC_manager};
+
+    my $parent = $self->parent;
+    defined $parent ? $self->parent->manager : undef;
+}
+
+#------------------------------------------
+
+
+sub folderType()
+{   my $self = shift;
+    return($self->{MBC_ftype} = shift) if @_;
+    return $self->{MBC_ftype} if exists $self->{MBC_ftype};
+
+    if(my $parent = $self->parent)
+    {   return $self->{MBC_ftype} = $parent->folderType;
+    }
+
+    undef;
+}
+
+#------------------------------------------
+
+1;
+

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Collection.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,454 @@
+
+=head1 NAME
+
+Mail::Box::Collection - a collection of subfolders
+
+
+=head1 INHERITANCE
+
+ Mail::Box::Collection
+   is a User::Identity::Collection
+   is a User::Identity::Item
+
+ Mail::Box::Collection
+   is a Mail::Reporter
+
+
+=head1 SYNOPSIS
+
+
+
+=head1 DESCRIPTION
+
+The L<Mail::Box::Collection|Mail::Box::Collection> object maintains a set L<Mail::Box::Identity|Mail::Box::Identity>
+objects, each describing a the location of a single mailbox (folder).  The
+collection is used by the L<Mail::Box::Manage::User|Mail::Box::Manage::User> object to administer
+the folders of a single user, even if those folders are closed.
+
+
+=head1 OVERLOADED
+
+
+overload: B<@{}>
+
+=over 4
+
+See L<User::Identity::Collection/"OVERLOADED">
+
+=back
+
+overload: B<stringification>
+
+=over 4
+
+See L<User::Identity::Collection/"OVERLOADED">
+
+=back
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Box::Collection-E<gt>B<new>([NAME], OPTIONS)
+
+=over 4
+
+ Option       Defined in       Default                                   
+ description  L<User::Identity::Item>  undef                                     
+ folder_type                   <from parent>                             
+ item_type    L<User::Identity::Collection>  L<Mail::Box::Identity|Mail::Box::Identity>
+ log          L<Mail::Reporter>  C<'WARNINGS'>                             
+ manager                       <from parent>                             
+ name         L<User::Identity::Item>  C<'folders'>                              
+ parent       L<User::Identity::Item>  C<undef>                                  
+ roles        L<User::Identity::Collection>  undef                                     
+ trace        L<Mail::Reporter>  C<'WARNINGS'>                             
+
+. description STRING
+
+. folder_type CLASS
+
+. item_type CLASS
+
+. log LEVEL
+
+. manager OBJECT
+
+=over 4
+
+An L<Mail::Box::Manager|Mail::Box::Manager> OBJECT (could be a L<Mail::Box::Manage::User|Mail::Box::Manage::User>).
+
+=back
+
+. name STRING
+
+. parent OBJECT
+
+. roles ROLE|ARRAY
+
+. trace LEVEL
+
+=back
+
+=head2 Error handling
+
+
+$obj-E<gt>B<AUTOLOAD>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<addReport>(OBJECT)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+Mail::Box::Collection-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<errors>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<log>([LEVEL [,STRINGS]])
+
+Mail::Box::Collection-E<gt>B<log>([LEVEL [,STRINGS]])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logPriority>(LEVEL)
+
+Mail::Box::Collection-E<gt>B<logPriority>(LEVEL)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logSettings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<notImplemented>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<report>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<reportAll>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<trace>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<warnings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+=head2 Cleanup
+
+
+$obj-E<gt>B<DESTROY>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+$obj-E<gt>B<inGlobalDestruction>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+=head2 Attributes
+
+
+$obj-E<gt>B<description>
+
+=over 4
+
+See L<User::Identity::Item/"Attributes">
+
+=back
+
+$obj-E<gt>B<folderType>([FOLDERCLASS])
+
+=over 4
+
+Returns the type of folder (on this location).  When specified, then
+FOLDERCLASS must be a L<Mail::Box|Mail::Box> extension.
+
+=back
+
+$obj-E<gt>B<itemType>
+
+=over 4
+
+See L<User::Identity::Collection/"Attributes">
+
+=back
+
+$obj-E<gt>B<manager>
+
+=over 4
+
+The L<Mail::Box::Manager|Mail::Box::Manager> (usually a L<Mail::Box::Manage::User|Mail::Box::Manage::User> object),
+which is handling the opening of folders.
+
+=back
+
+$obj-E<gt>B<name>([NEWNAME])
+
+=over 4
+
+See L<User::Identity::Item/"Attributes">
+
+=back
+
+$obj-E<gt>B<roles>
+
+=over 4
+
+See L<User::Identity::Collection/"Attributes">
+
+=back
+
+=head2 Collections
+
+
+$obj-E<gt>B<add>(COLLECTION, ROLE)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<addCollection>(OBJECT | ([TYPE], OPTIONS))
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<collection>(NAME)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<parent>([PARENT])
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<removeCollection>(OBJECT|NAME)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<type>
+
+Mail::Box::Collection-E<gt>B<type>
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<user>
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+=head2 Maintaining roles
+
+
+$obj-E<gt>B<addRole>(ROLE| ( [NAME],OPTIONS ) | ARRAY-OF-OPTIONS)
+
+=over 4
+
+See L<User::Identity::Collection/"Maintaining roles">
+
+=back
+
+$obj-E<gt>B<removeRole>(ROLE|NAME)
+
+=over 4
+
+See L<User::Identity::Collection/"Maintaining roles">
+
+=back
+
+$obj-E<gt>B<renameRole>(ROLE|OLDNAME, NEWNAME)
+
+=over 4
+
+See L<User::Identity::Collection/"Maintaining roles">
+
+=back
+
+$obj-E<gt>B<sorted>
+
+=over 4
+
+See L<User::Identity::Collection/"Maintaining roles">
+
+=back
+
+=head2 Searching
+
+
+$obj-E<gt>B<find>(NAME|CODE|undef)
+
+=over 4
+
+See L<User::Identity::Collection/"Searching">
+
+=back
+
+
+
+=head1 DIAGNOSTICS
+
+I<Error:> $object is not a collection.
+
+The first argument is an object, but not of a class which extends
+L<User::Identity::Collection|User::Identity::Collection>.
+
+I<Error:> Cannot create a $type to add this to my collection.
+
+Some options are specified to create a $type object, which is native to
+this collection.  However, for some reason this failed.
+
+I<Error:> Cannot load collection module for $type ($class).
+
+Either the specified $type does not exist, or that module named $class returns
+compilation errors.  If the type as specified in the warning is not
+the name of a package, you specified a nickname which was not defined.
+Maybe you forgot the 'require' the package which defines the nickname.
+
+I<Error:> Cannot rename $name into $newname: already exists
+
+
+I<Error:> Cannot rename $name into $newname: doesn't exist
+
+
+I<Error:> Creation of a collection via $class failed.
+
+The $class did compile, but it was not possible to create an object
+of that class using the options you specified.
+
+I<Error:> Don't know what type of collection you want to add.
+
+If you add a collection, it must either by a collection object or a
+list of options which can be used to create a collection object.  In
+the latter case, the type of collection must be specified.
+
+I<Warning:> No collection $name
+
+The collection with $name does not exist and can not be created.
+
+I<Error:> Package $package does not implement $method.
+
+Fatal error: the specific package (or one of its superclasses) does not
+implement this method where it should. This message means that some other
+related classes do implement this method however the class at hand does
+not.  Probably you should investigate this and probably inform the author
+of the package.
+
+I<Error:> Wrong type of role for $collection: requires a $expect but got a $type
+
+Each $collection groups sets of roles of one specific type ($expect).  You
+cannot add objects of a different $type.
+
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Box::Dbx::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::File::Message';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -30,7 +30,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -38,14 +38,6 @@
 
 =back
 
-Mail::Box::Dbx::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::Dbx::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -144,7 +136,7 @@
 
 =back
 
-Mail::Box::Dbx::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Dbx::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -266,22 +258,54 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<dbxRecord>
+
+=over 4
+
+Returns the Mail::Transport::Dbx::Email record of the message.
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<fromLine>([LINE])
+
+=over 4
+
+See L<Mail::Box::File::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -289,7 +313,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -297,15 +321,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -313,15 +345,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -329,7 +369,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -601,7 +641,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -617,60 +657,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<dbxRecord>
+Mail::Box::Dbx::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-Returns the Mail::Transport::Dbx::Email record of the message.
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<fromLine>([LINE])
-
-=over 4
-
-See L<Mail::Box::File::Message/"The message">
-
-=back
-
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -778,9 +783,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Dbx::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Dbx::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -955,10 +960,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -970,6 +983,14 @@
 I<Error:> Unable to read delayed body.
 
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -993,7 +1014,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Dbx;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::File';
 
 use Mail::Box::Dbx::Message;
@@ -94,10 +94,11 @@
 
 #-------------------------------------------
 
-sub nameOfSubFolder($)
-{   my ($self, $name) = (shift, shift);
-    my $dirname = dirname $self->filename;
-    File::Spec->catfile($dirname, "$name.dbx");
+sub nameOfSubFolder($;$)
+{   my $thing  = shift;
+    my $name   = (shift). '.dbx';
+    my $parent = @_ ? shift : ref $thing ? $thing->filename : undef;
+    defined $parent ?  File::Spec->catfile(dirname($parent), $name) : $name;
 }
 
 #-------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dbx.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -27,8 +27,8 @@
 
 These dbx folders are accessed using Mail::Transport::Dbx which
 is distributed via CPAN as separate package.  This C<MAil::Transport::Dbx>
-module is based on the open source library named C<libdbx>, which can
-be found at L<http://sourceforge.net/project/ol2mbox/>.  The library does
+module is based on the open source library named C<libpst>, which can
+be found at L<http://alioth.debian.org/projects/libpst/>.  The library does
 not support writing of dbx files, and therefore limits the possibilities
 of this package.
 
@@ -67,21 +67,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box::Dbx-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
-Creation is not supported for dbx folders.
-
- Option     Defined in    Default
- folderdir  L<Mail::Box>  undef  
-
-. folderdir DIRECTORY
-
-=back
-
 Mail::Box::Dbx-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -177,7 +162,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -217,7 +202,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -241,24 +226,6 @@
 
 =back
 
-Mail::Box::Dbx-E<gt>B<foundIn>([FOLDERNAME], [OPTIONS])
-
-=over 4
-
-If no FOLDERNAME is specified, then the value of the C<folder> option
-is taken.  A dbx folder is a file which name ends on C<.dbx> (case
-insensitive).
-
- Option     Defined in       Default
- folder                      undef  
- folderdir  L<Mail::Box>     undef  
-
-. folder FOLDERNAME
-
-. folderdir DIRECTORY
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -310,6 +277,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -393,6 +368,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -414,11 +397,11 @@
 large amounts of folder names which do not really exist.  However, checking
 does consume some time.
 
- Option      Defined in       Default      
- check       L<Mail::Box>     <false>      
- folder      L<Mail::Box>     <required>   
- folderdir   L<Mail::Box>     <from folder>
- skip_empty  L<Mail::Box>     <false>      
+ Option      Defined in       Default              
+ check       L<Mail::Box>     <false>              
+ folder      L<Mail::Box>     <from calling object>
+ folderdir   L<Mail::Box>     <from folder>        
+ skip_empty  L<Mail::Box>     <false>              
 
 . check BOOLEAN
 
@@ -430,8 +413,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::Dbx-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -446,7 +431,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -454,10 +439,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::Dbx-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -465,6 +460,21 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box::Dbx-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+Creation is not supported for dbx folders.
+
+ Option     Defined in    Default
+ folderdir  L<Mail::Box>  undef  
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -484,6 +494,24 @@
 
 =back
 
+Mail::Box::Dbx-E<gt>B<foundIn>([FOLDERNAME], [OPTIONS])
+
+=over 4
+
+If no FOLDERNAME is specified, then the value of the C<folder> option
+is taken.  A dbx folder is a file which name ends on C<.dbx> (case
+insensitive).
+
+ Option     Defined in       Default
+ folder                      undef  
+ folderdir  L<Mail::Box>     undef  
+
+. folder FOLDERNAME
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -626,9 +654,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Dbx-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Dbx-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -897,7 +925,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,11 +4,11 @@
 
 package Mail::Box::Dir::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Message';
 
-use Carp;
 use File::Copy qw/move/;
+use IO::File;
 
 
 sub init($)
@@ -58,7 +58,7 @@
 
 sub filename(;$)
 {   my $self = shift;
-    @_ ? $self->{MBDM_filename} = shift : $self->{MBDM_filename};
+    @_ ? ($self->{MBDM_filename} = shift) : $self->{MBDM_filename};
 }
 
 #-------------------------------------------
@@ -204,6 +204,9 @@
          unless move($new, $filename);
 
     $self->modified(0);
+
+    # Do not affect flags for Maildir (and some other) which keep it
+    # in there.  Flags will be processed later.
     $self->Mail::Box::Dir::Message::filename($filename);
 
     $self;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -29,18 +29,27 @@
 There are no objects of type C<Mail::Box::Dir::Message>, only extensions
 are allowed to be created.
 
-At the moment, two of these extended message types are implemented:
+At the moment, three of these extended message types are implemented:
 
 =over 4
 
 =item * L<Mail::Box::MH::Message|Mail::Box::MH::Message>
 
-which represents one message in a L<Mail::Box::MH|Mail::Box::MH> folder.
+which represents one message in a L<Mail::Box::MH|Mail::Box::MH> folder.  MH folders are
+very, very simple.... and hence not sophisticated nor fast.
 
 =item * L<Mail::Box::Maildir::Message|Mail::Box::Maildir::Message>
 
-which represents one message in a L<Mail::Box::Maildir|Mail::Box::Maildir> folder.
+which represents one message in a L<Mail::Box::Maildir|Mail::Box::Maildir> folder.  Flags are
+kept in the message's filename.  It is stateless, so you will never loose
+a message.
 
+=item * Mail::Box::Netzwert::Message
+
+which represents one message in a Mail::Box::Netzwert folder.  As advantage,
+it stores pre-parsed information in the message file.  As disadvantage: the
+code is not GPLed (yet).
+
 =back
 
 
@@ -51,7 +60,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -59,14 +68,6 @@
 
 =back
 
-Mail::Box::Dir::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::Dir::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -148,7 +149,7 @@
 
 =back
 
-Mail::Box::Dir::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Dir::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -270,22 +271,47 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<filename>([FILENAME])
+
+=over 4
+
+Returns the name of the file in which this message is actually stored.  This
+will return C<undef> when the message is not stored in a file.
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -293,7 +319,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -301,15 +327,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -317,15 +351,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -333,7 +375,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -341,7 +383,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -605,7 +647,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -621,53 +663,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<filename>([FILENAME])
+Mail::Box::Dir::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-Returns the name of the file in which this message is actually stored.  This
-will return C<undef> when the message is not stored in a file.
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<create>(FILENAME)
 
 =over 4
@@ -789,9 +803,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Dir::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Dir::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -957,10 +971,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -983,6 +1005,14 @@
 a message is used for the first time here, but has disappeared or is
 unreadible for some other reason.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -1006,7 +1036,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Dir;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use base 'Mail::Box';
 
@@ -32,12 +32,12 @@
 
     my $class            = ref $self;
     my $directory        = $self->{MBD_directory}
-       = $class->folderToDirectory($self->name, $self->folderdir);
+        = $args->{directory} || $self->directory;
 
        if(-d $directory) {;}
     elsif($args->{create} && $class->create($directory, %$args)) {;}
     else
-    {   $self->log(PROGRESS => "$class: No directory $directory.\n");
+    {   $self->log(NOTICE => "No directory $directory for folder of $class");
         return undef;
     }
 
@@ -54,7 +54,7 @@
     # Check if we can write to the folder, if we need to.
 
     if($self->writable && -e $directory && ! -w $directory)
-    {   $self->log(WARNING => "Folder directory $directory is write-protected.\n");
+    {   $self->log(WARNING=> "Folder directory $directory is write-protected.");
         $self->{MB_access} = 'r';
     }
 
@@ -68,14 +68,29 @@
 #-------------------------------------------
 
 
-sub directory() { shift->{MBD_directory} }
+sub directory()
+{   my $self = shift;
 
+    $self->{MBD_directory}
+       ||= $self->folderToDirectory($self->name, $self->folderdir);
+}
+
 #-------------------------------------------
 
+sub nameOfSubFolder($;$)
+{   my ($thing, $name) = (shift, shift);
+    my $parent = @_ ? shift : ref $thing ? $thing->directory : undef;
+    defined $parent ? "$parent/$name" : $name;
+}
 
+#-------------------------------------------
+
+
 sub folderToDirectory($$)
 {   my ($class, $name, $folderdir) = @_;
-    $name =~ /^=(.*)/ ? File::Spec->catfile($folderdir,$1) : $name;
+    my $dir = ( $name =~ m#^=\/?(.*)# ? "$folderdir/$1" : $name);
+    $dir =~ s!/$!!;
+    $dir;
 }
 
 #-------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Dir.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -39,6 +39,12 @@
 files with names which are a combination of a numeric timestamp and some
 status flags.
 
+=item * Mail::Box::Netzwert
+
+This folder type was especially developed for Netzwert AG, optimized to
+run on a cluster of servers with folders on NFS.  The code is not publicly
+available (yet).
+
 =back
 
 
@@ -76,16 +82,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box::Dir-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"Constructors">
-
-=back
-
 Mail::Box::Dir-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -96,6 +92,7 @@
  body_type          L<Mail::Box>     L<Mail::Message::Body::Lines|Mail::Message::Body::Lines>        
  coerce_options     L<Mail::Box>     C<[]>                                                           
  create             L<Mail::Box>     <false>                                                         
+ directory                           <derived from folder name>                                      
  extract            L<Mail::Box>     C<10240>                                                        
  field_type         L<Mail::Box>     undef                                                           
  fix_headers        L<Mail::Box>     <false>                                                         
@@ -128,6 +125,15 @@
 
 . create BOOLEAN
 
+. directory DIRECTORY
+
+=over 4
+
+For rare folder types, the directory name may differ from the folder
+name.
+
+=back
+
 . extract INTEGER | CODE | METHOD | 'LAZY'|'ALWAYS'
 
 . field_type CLASS
@@ -175,7 +181,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -215,7 +221,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -243,14 +249,6 @@
 
 =back
 
-Mail::Box::Dir-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -302,6 +300,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -385,6 +391,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -406,8 +420,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::Dir-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -422,7 +438,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -430,10 +446,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::Dir-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -441,6 +467,16 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box::Dir-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -458,6 +494,14 @@
 
 =back
 
+Mail::Box::Dir-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -580,9 +624,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Dir-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Dir-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -744,6 +788,9 @@
 of two messages with the same id.  The warning emerges when the C<@> is
 missing from the string.
 
+I<Warning:> No directory $name for folder of $class
+
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -777,7 +824,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,6 +1,6 @@
 package Mail::Box::FastScalar;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 
 use strict;
@@ -9,7 +9,8 @@
 
 sub new($) {
     my ($class, $ref) = @_;
-    my $self = { ref => $ref, data => defined($$ref) ? $$ref : '' };
+    $$ref = '' unless defined($$ref);
+    my $self = { ref => $ref, pos => 0 };
 
     bless $self, $class;
     return $self;
@@ -30,82 +31,78 @@
 sub open($) {
     my $self = $_[0];
 
+    ${$_[1]} = '' unless defined(${$_[1]});
     $self->{ref} = $_[1];
-    $self->{data} = ${$self->{ref}};
+    $self->{pos} = 0;
 }
 
 sub close() {
-    my $self = $_[0];
-
-    $self->{data} = '';
-    undef $self->{ref};
+    undef $_[0]->{ref};
 }
 
 sub eof() {
     my $self = $_[0];
 
-    return length($self->{data}) == 0;
+    return $self->{pos} >= length(${$self->{ref}});
 }
 
 sub getc() {
     my $self = $_[0];
 
-    return substr($self->{data}, 0, 1, '');
+    return substr(${$self->{ref}}, $self->{pos}++, 1);
 }
 
 sub print {
-    my $self = shift();
-    my $buf = $#_ ? join('', @_) : $_[0];
+    my $self = shift;
+    my $pos = $self->{pos};
     my $ref = $self->{ref};
-    my $len = length($self->{data});
-
-    if ($len == 0) {
-	$$ref .= $buf;
+    my $len = length($$ref);
+    
+    if ($pos >= $len) {
+	$$ref .= $_ foreach @_;
+	$self->{pos} = length($$ref);
     } else {
-	my $pos = length($$ref) - $len;
-
+	my $buf = $#_ ? join('', @_) : $_[0];
+	
 	$len = length($buf);
 	substr($$ref, $pos, $len) = $buf;
-	$self->{data} = substr($$ref, $pos + $len, -1);
+	$self->{pos} = $pos + $len;
     }
-    return 1;
+    1;
 }
 
 sub read($$;$) {
     my $self = $_[0];
-    my $buf = substr($self->{data}, 0, $_[2], '');
+    my $buf = substr(${$self->{ref}}, $self->{pos}, $_[2]);
+    $self->{pos} += $_[2];
 
     ($_[3] ? substr($_[1], $_[3]) : $_[1]) = $buf;
     return length($buf);
 }
 
 sub sysread($$;$) {
-    return shift->read(@_);
+    return shift()->read(@_);
 }
 
 sub seek($$) {
     my $self = $_[0];
     my $whence = $_[2];
-    my $ref = $self->{ref};
-    my $len = length($$ref);
-    my $pos;
+    my $len = length(${$self->{ref}});
 
     if ($whence == 0) {
-	$pos = $_[1];
+	$self->{pos} = $_[1];
     } elsif ($whence == 1) {
-	$pos = $len - length($self->{data}) + $_[1];
+	$self->{pos} += $_[1];
     } elsif ($whence == 2) {
-	$pos = $len - length($self->{data}) - $_[1];
+	$self->{pos} = $len + $_[1];
     } else {
 	return;
     }
-
-    if ($pos > $len) {
-	$pos = $len;
-    } elsif ($pos < 0) {
-	$pos = 0;
+    if ($self->{pos} > $len) {
+	$self->{pos} = $len;
+    } elsif ($self->{pos} < 0) {
+	$self->{pos} = 0;
     }
-    $self->{data} = substr($$ref, $pos);
     return 1;
 }
 
@@ -122,31 +119,29 @@
 }
 
 sub getpos() {
-    my $self = $_[0];
-
-    return length(${$self->{ref}}) - length($self->{data});
+    return $_[0]->{pos};
 }
 
 sub tell() {
-    my $self = $_[0];
-
-    return length(${$self->{ref}}) - length($self->{data});
+    return $_[0]->{pos};
 }
 
 sub write($$;$) {
     my $self = $_[0];
-    my $buf = substr($_[1], $_[3] || 0, $_[2]);
+    my $pos = $self->{pos};
     my $ref = $self->{ref};
-    my $len = length($self->{data});
+    my $len = length($$ref);
 
-    if ($len == 0) {
-	$$ref .= $buf;
+    if ($pos >= $len) {
+	$$ref .= substr($_[1], $_[3] || 0, $_[2]);
+	$self->{pos} = length($$ref);
+	$len = $self->{pos} -  $len;
     } else {
-	my $pos = length($$ref) - $len;
-
+	my $buf = substr($_[1], $_[3] || 0, $_[2]);
+	
 	$len = length($buf);
 	substr($$ref, $pos, $len) = $buf;
-	$self->{data} = substr($$ref, $pos + $len, -1, '');
+	$self->{pos} = $pos + $len;
     }
     return $len;
 }
@@ -157,33 +152,37 @@
 
 sub getline() {
     my $self = $_[0];
-    my $data = \$self->{data};
+    my $ref = $self->{ref};
+    my $pos = $self->{pos};
 
-    if ((my $idx = index($$data, $/)) == -1 || !defined($/)) {
-	my $r = $$data;
-
-	return unless (length($r) > 0);
-	$$data = '';
-	return $r;
+    if (!defined($/) || (my $idx = index($$ref, $/, $pos)) == -1) {
+	return if ($pos >= length($$ref));
+	$self->{pos} = length($$ref);
+	return substr($$ref, $pos);
     } else {
-	return substr($$data, 0, $idx + 1, '');
+	return substr($$ref, $pos, ($self->{pos} = $idx + length($/)) - $pos);
     }
 }
 
 sub getlines() {
     my $self = $_[0];
-    my $data = $self->{data};
     my @lines;
+    my $ref = $self->{ref};
+    my $pos = $self->{pos};
 
-    $self->{data} = '';
     if (defined($/)) {
 	my $idx;
-
-	while (($idx = index($data, $/)) != -1) {
-	    push(@lines, substr($data, 0, $idx + 1, ''));
+	
+	while (($idx = index($$ref, $/, $pos)) != -1) {
+	    push(@lines, substr($$ref, $pos, ($idx + 1) - $pos));
+	    $pos = $idx + 1;
 	}
     }
-    push(@lines, $data) if (length($data) > 0);
+    my $r = substr($$ref, $pos);
+    if (length($r) > 0) {
+	push(@lines, $r);
+    }
+    $self->{pos} = length($$ref);
     return wantarray() ? @lines : \@lines;
 }
 
@@ -204,3 +203,5 @@
 sub EOF { shift()->eof(@_); }
 
 1;
+
+1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/FastScalar.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -37,7 +37,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::File::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Message';
 
 use POSIX 'SEEK_SET';

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -35,7 +35,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -43,14 +43,6 @@
 
 =back
 
-Mail::Box::File::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::File::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -124,7 +116,7 @@
 
 =back
 
-Mail::Box::File::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::File::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -246,22 +238,52 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<fromLine>([LINE])
+
+=over 4
+
+Many people detest file-style folders because they store messages all in
+one file, where a line starting with C<From > leads the header.  If we
+receive a message from a file-based folder, we store that line.  If we write
+to such a file, but there is no such line stored, then we try to generate
+one.
+
+If LINE is provided, then the starting line is set to this value.
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -269,7 +291,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -277,15 +299,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -293,15 +323,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -309,7 +347,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -589,7 +627,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -605,58 +643,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::File::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<fromLine>([LINE])
-
-=over 4
-
-Many people detest file-style folders because they store messages all in
-one file, where a line starting with C<From > leads the header.  If we
-receive a message from a file-based folder, we store that line.  If we write
-to such a file, but there is no such line stored, then we try to generate
-one.
-
-If LINE is provided, then the starting line is set to this value.
-
-=back
-
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -767,9 +772,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::File::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::File::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -918,10 +923,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -933,6 +946,14 @@
 I<Error:> Unable to read delayed body.
 
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -956,7 +977,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::File;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box';
 
 use Mail::Box::File::Message;
@@ -123,7 +123,7 @@
         $create->close or return;
     }
     else
-    {   $class->log(WARNING => "Cannot create folder file $name: $!\n");
+    {   $class->log(WARNING => "Cannot create folder file $name: $!");
         return;
     }
 
@@ -310,14 +310,22 @@
 
 sub moveAwaySubFolder($$)
 {   my ($self, $dir, $extension) = @_;
-    $self->log("ERROR: Cannot move away sub-folder $dir")
+    $self->log(ERROR => "Cannot move away sub-folder $dir")
        unless move $dir, $dir.$extension;
     $self;
 }
 
 #-------------------------------------------
 
+sub delete(@)
+{   my $self = shift;
+    $self->SUPER::delete(@_);
+    unlink $self->filename;
+}
 
+#-------------------------------------------
+
+
 sub writeMessages($)
 {   my ($self, $args) = @_;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/File.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -61,19 +61,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box::File-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
- Option     Defined in    Default
- folderdir  L<Mail::Box>  undef  
-
-. folderdir DIRECTORY
-
-=back
-
 Mail::Box::File-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -213,7 +200,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -242,6 +229,7 @@
  folder    L<Mail::Box>     <required>
  message   L<Mail::Box>     undef     
  messages  L<Mail::Box>     undef     
+ share     L<Mail::Box>     <false>   
 
 . folder FOLDERNAME
 
@@ -249,6 +237,8 @@
 
 . messages ARRAY-OF-MESSAGES
 
+. share BOOLEAN
+
 =back
 
 $obj-E<gt>B<close>(OPTIONS)
@@ -267,7 +257,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -296,14 +286,6 @@
 
 =back
 
-Mail::Box::File-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -355,6 +337,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -438,6 +428,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -459,8 +457,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::File-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -475,7 +475,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -483,10 +483,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::File-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -494,6 +504,19 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box::File-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+ Option     Defined in    Default
+ folderdir  L<Mail::Box>  undef  
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -514,6 +537,14 @@
 
 =back
 
+Mail::Box::File-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -743,9 +774,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::File-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::File-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -991,7 +1022,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::IMAP4::Head;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head';
 
 use Date::Parse;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Head.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -54,7 +54,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<build>(FIELDS)
+$obj-E<gt>B<build>([PAIR|FIELD]-LIST)
 
 =over 4
 
@@ -272,9 +272,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::IMAP4::Head-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::IMAP4::Head-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -403,7 +403,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Box::IMAP4::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Net::Message';
 
 use Date::Parse 'str2time';
@@ -59,12 +59,13 @@
 	return $labels->{$label}
 	   if exists $labels->{$label} || exists $labels->{seen};
 
-	my %flags = $imap->getFlags($id);
+	my $flags = $imap->getFlags($id);
         if($self->{MBIM_cache_labels})
-	{   @{$labels}{keys %flags} = values %flags;
+	{   # the program may have added own labels
+            @{$labels}{keys %$flags} = values %$flags;
             delete $self->{MBIM_labels_changed};
 	}
-	return $flags{$label};
+	return $flags->{$label};
     }
 
     my @private;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -34,7 +34,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -42,14 +42,6 @@
 
 =back
 
-Mail::Box::IMAP4::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::IMAP4::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -144,7 +136,7 @@
 
 =back
 
-Mail::Box::IMAP4::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::IMAP4::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -266,22 +258,38 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -289,7 +297,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -297,15 +305,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -313,10 +329,18 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
@@ -332,15 +356,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<unique>([STRING|undef])
+
+=over 4
+
+See L<Mail::Box::Net::Message/"The message">
+
+=back
+
 $obj-E<gt>B<write>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -614,7 +646,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -630,52 +662,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::IMAP4::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<unique>([STRING|undef])
-
-=over 4
-
-See L<Mail::Box::Net::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -797,9 +802,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::IMAP4::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::IMAP4::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -948,10 +953,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -966,6 +979,14 @@
 I<Error:> Unable to read delayed head.
 
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -1039,7 +1060,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Box::IMAP4;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Net';
 
 use Mail::Box::IMAP4::Message;
@@ -44,7 +44,7 @@
     my $transport = $args->{transporter} || 'Mail::Transport::IMAP4';
     unless(ref $transport)
     {   eval "require $transport";
-        $self->log(ERROR => "Cannot install transporter $transport:\n$@\n"),
+        $self->log(ERROR => "Cannot install transporter $transport:\n$@"),
            return () if $@;
 
         $transport = $self->createTransporter($transport, %$args)
@@ -103,10 +103,7 @@
 
 #-------------------------------------------
 
-sub nameOfSubfolder($)
-{   my ($self, $name) = @_;
-    $name;
-}
+sub nameOfSubfolder($;$) { $_[1] }
 
 #-------------------------------------------
 
@@ -247,7 +244,16 @@
 
 #-------------------------------------------
 
+sub delete(@)
+{   my $self   = shift;
+    my $transp = $self->transporter;
+    $self->SUPER::delete(@_);   # subfolders
+    $transp->deleteFolder($self->name);
+}
 
+#-------------------------------------------
+
+
 sub writeMessages($@)
 {   my ($self, $args) = @_;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/IMAP4.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -20,24 +20,9 @@
 
 =head1 DESCRIPTION
 
-UNDER DEVELOPMENT!!!! LIMITATIONS:
-
-=over 4
-=item * this implementation is close to NOT TESTED!
-Of course, some testing has been done, but this is far from complete. Please
-contribute with ideas are problem reports.
-
-=item * messages are all treated as separte items
-
-Performance can be improved combining request for multiple subjects. For
-instance, a preloadFields() or a preloadEnvelope() would speed-up most
-
-applications
-=back
-
 Maintain a folder which has its messages stored on a remote server.  The
 communication between the client application and the server is implemented
-using the IMAP4 protocol.
+using the IMAP4 protocol.  See also L<Mail::Server::IMAP4|Mail::Server::IMAP4>.
 
 This class uses L<Mail::Transport::IMAP4|Mail::Transport::IMAP4> to hide the transport of
 information, and focusses solely on the correct handling of messages
@@ -79,16 +64,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDER, OPTIONS)
-
-Mail::Box::IMAP4-E<gt>B<create>(FOLDER, OPTIONS)
-
-=over 4
-
-See L<Mail::Box::Net/"METHODS">
-
-=back
-
 Mail::Box::IMAP4-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -308,7 +283,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -363,7 +338,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -379,14 +354,6 @@
 
 =back
 
-Mail::Box::IMAP4-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -438,6 +405,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -521,6 +496,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -542,8 +525,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::IMAP4-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -558,7 +543,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -566,6 +551,16 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::IMAP4-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
@@ -575,7 +570,7 @@
 
 =back
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -583,6 +578,16 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDER, OPTIONS)
+
+Mail::Box::IMAP4-E<gt>B<create>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Net/"METHODS">
+
+=back
+
 $obj-E<gt>B<createTransporter>(CLASS, OPTIONS)
 
 =over 4
@@ -634,6 +639,14 @@
 
 =back
 
+Mail::Box::IMAP4-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<getHead>(MESSAGE)
 
 =over 4
@@ -800,9 +813,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::IMAP4-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::IMAP4-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -1002,7 +1015,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,275 @@
+use strict;
+use warnings;
+
+package Mail::Box::Identity;
+use vars '$VERSION';
+$VERSION = '2.060';
+use base qw/User::Identity::Item Mail::Reporter/;
+
+use Mail::Box::Collection;
+
+# tests in tests/52message/30collect.t
+
+
+sub type { "mailbox" }
+
+
+sub new(@)
+{   my $class = shift;
+    unshift @_, 'name' if @_ % 2;
+    $class->Mail::Reporter::new(@_);
+}
+
+sub init($)
+{   my ($self, $args) = @_;
+
+    $self->Mail::Reporter::init($args);
+    $self->User::Identity::init($args);
+
+    $self->{MBI_location}  = delete $args->{location};
+    $self->{MBI_ftype}     = delete $args->{folder_type};
+    $self->{MBI_manager}   = delete $args->{manager};
+    $self->{MBI_subf_type} = delete $args->{subf_type}||'Mail::Box::Collection';
+    $self->{MBI_only_subs} = delete $args->{only_subs};
+    $self->{MBI_marked}    = delete $args->{marked};
+    $self->{MBI_deleted}   = delete $args->{deleted};
+    $self->{MBI_inferiors} = exists $args->{inferiors} ? $args->{inferiors} : 1;
+
+    $self;
+}
+
+#-------------------------------------------
+
+
+sub fullname(;$)
+{   my $self   = shift;
+    my $delim  = @_ && defined $_[0] ? shift : '/';
+
+    my $parent = $self->parent or return $self->name;
+    $parent->parent->fullname($delim) . $delim . $self->name;
+}
+
+#-------------------------------------------
+
+
+sub location(;$)
+{   my $self = shift;
+    return ($self->{MBI_location} = shift) if @_;
+    return $self->{MBI_location} if defined $self->{MBI_location};
+
+    my $parent = $self->parent;
+    unless(defined $parent)
+    {   $self->log(ERROR => "Toplevel directory requires explicit location");
+        return undef;
+    }
+
+    $self->folderType
+         ->nameOfSubFolder($self->name, $parent->parent->location)
+}
+
+#-------------------------------------------
+
+
+sub folderType()
+{   my $self = shift;
+    return $self->{MBI_ftype} if defined $self->{MBI_ftype};
+
+    my $parent = $self->parent;
+    unless(defined $parent)
+    {   $self->log(ERROR => "Toplevel directory requires explicit folder type");
+        return undef;
+    }
+
+    $parent->parent->folderType;
+}
+
+#-------------------------------------------
+
+
+sub manager()
+{    my $self = shift;
+     return $self->{MBI_manager} if $self->{MBI_manager};
+     my $parent = $self->parent or return undef;
+     $self->parent->manager;
+}
+
+#-------------------------------------------
+
+
+sub topfolder()
+{   my $self = shift;
+    my $parent = $self->parent or return $self;
+    $parent->parent->topfolder;
+}
+
+#-------------------------------------------
+
+
+sub onlySubfolders(;$)
+{   my $self = shift;
+    return($self->{MBI_only_subs} = shift) if @_;
+    return $self->{MBI_only_subs} if exists $self->{MBI_only_subs};
+    $self->parent ? 1 : ! $self->folderType->topFolderWithMessages;
+}
+
+#-------------------------------------------
+
+
+sub marked(;$)
+{   my $self = shift;
+    @_ ? ($self->{MBI_marked} = shift) : $self->{MBI_marked};
+}
+
+#-------------------------------------------
+
+
+sub inferiors(;$)
+{   my $self = shift;
+    @_ ? ($self->{MBI_inferiors} = shift) : $self->{MBI_inferiors};
+}
+
+#-------------------------------------------
+                                                                                
+
+sub deleted(;$)
+{   my $self = shift;
+    @_ ? ($self->{MBI_deleted} = shift) : $self->{MBI_deleted};
+}
+                                                                                
+#-------------------------------------------
+
+
+sub subfolders()
+{   my $self = shift;
+    my $subs = $self->collection('subfolders');
+    return (wantarray ? $subs->roles : $subs)
+        if defined $subs;
+
+    my @subs;
+    if(my $location = $self->location)
+    {   @subs  = $self->folderType->listSubFolders
+         ( folder    => $location
+         );
+    }
+    else
+    {   my $mgr   = $self->manager;
+        my $top   = defined $mgr ? $mgr->folderdir : '.';
+
+        @subs  = $self->folderType->listSubFolders
+          ( folder    => $self->fullname
+          , folderdir => $top
+          );
+    }
+    @subs or return ();
+
+    my $subf_type
+      = $self->{MBI_subf_type} || ref($self->parent) || 'Mail::Box::Collection';
+
+    $subs = $subf_type->new('subfolders');
+
+    $self->addCollection($subs);
+    $subs->addRole(name => $_) for @subs;
+    wantarray ? $subs->roles : $subs;
+}
+
+#-------------------------------------------
+
+
+sub subfolderNames() { map {$_->name} shift->subfolders }
+
+#-------------------------------------------
+
+
+sub folder(@)
+{   my $self = shift;
+    return $self unless @_ && defined $_[0];
+
+    my $subs = $self->subfolders  or return undef;
+    my $nest = $subs->find(shift) or return undef;
+    $nest->folder(@_);
+}
+
+#-------------------------------------------
+
+
+sub open(@)
+{   my $self = shift;
+    my $mgr  = $self->manager;
+
+    $mgr->open
+      ( $self->fullname
+      , type => $self->folderType
+      , @_
+      );
+}
+
+#-------------------------------------------
+
+
+sub foreach($)
+{   my ($self, $code) = @_;
+    $code->($self);
+
+    my $subs = $self->subfolders or return ();
+    $_->foreach($code) for $subs->sorted;
+    $self;
+}
+
+#-------------------------------------------
+
+
+sub addSubfolder(@)
+{   my $self  = shift;
+    my $subs  = $self->subfolders;
+
+    if(defined $subs) { ; }
+    elsif(!$self->inferiors)
+    {   my $name = $self->fullname;
+        $self->log(ERROR => "It is not permitted to add subfolders to $name");
+        return undef;
+    }
+    else
+    {   $subs = $self->{MBI_subf_type}->new('subfolders');
+        $self->addCollection($subs);
+    }
+
+    $subs->addRole(@_);
+}
+
+#-------------------------------------------
+
+
+sub remove(;$)
+{   my $self = shift;
+
+    my $parent = $self->parent;
+    unless(defined $parent)
+    {   $self->log(ERROR => "The toplevel folder cannot be removed this way");
+        return ();
+    }
+
+    return $parent->removeRole($self->name)
+        unless @_;
+
+    my $name = shift;
+    my $subs = $self->subfolders or return ();
+    $subs->removeRole($name);
+}
+
+#-------------------------------------------
+
+
+sub rename($;$)
+{   my ($self, $folder, $newname) = @_;
+    $newname = $self->name unless defined $newname;
+
+    my $away = $self->remove;
+    $away->name($newname);
+
+    $folder->addSubfolder($away);
+}
+
+
+1;
+
+

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Identity.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,616 @@
+
+=head1 NAME
+
+Mail::Box::Identity - represents an unopened folder
+
+
+=head1 INHERITANCE
+
+ Mail::Box::Identity
+   is a User::Identity::Item
+
+ Mail::Box::Identity
+   is a Mail::Reporter
+
+
+=head1 SYNOPSIS
+
+ use User::Identity;
+ use Mail::Box::Identity;
+ my $me   = User::Identity->new(...);
+
+ my $mailbox = Mail::Box::Identity->new(...);
+ $me->add(folders => $mailbox);
+
+ # Simpler
+
+ use User::Identity;
+ my $me   = User::Identity->new(...);
+ my $addr = $me->add(folders => ...);
+
+
+=head1 DESCRIPTION
+
+The C<Mail::Box::Identity> object contains the description of a
+single mailbox.  The mailboxes are collected by an L<Mail::Box::Collection|Mail::Box::Collection>
+object.  This corresponds with IMAP's C<\NoSelect>, for instance.
+
+Nearly all methods can return undef.
+
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Box::Identity-E<gt>B<new>([NAME], OPTIONS)
+
+=over 4
+
+ Option       Defined in       Default                        
+ deleted                       <false>                        
+ description  L<User::Identity::Item>  undef                          
+ folder_type                   C<from parent>                 
+ inferiors                     1                              
+ location                      C<undef>                       
+ log          L<Mail::Reporter>  C<'WARNINGS'>                  
+ manager                       <from parent>                  
+ marked                        C<undef>                       
+ name         L<User::Identity::Item>  <required>                     
+ only_subs                     <foldertype and name dependent>
+ parent       L<User::Identity::Item>  C<undef>                       
+ subf_type                     <same as parent>               
+ trace        L<Mail::Reporter>  C<'WARNINGS'>                  
+
+. deleted BOOLEAN
+
+=over 4
+
+The folder is flagged for deletion.  This not have any implications yet,
+because it may still get undeleted.
+
+=back
+
+. description STRING
+
+. folder_type CLASS
+
+. inferiors BOOLEAN
+
+=over 4
+
+Can this folder have childs?  If not, this is cleared.
+
+=back
+
+. location DIRECTORY|FILENAME
+
+=over 4
+
+The location of this folder.  Often, only the manager can figure-out
+where this folder really is.
+
+=back
+
+. log LEVEL
+
+. manager OBJECT
+
+=over 4
+
+Any L<Mail::Box::Manager|Mail::Box::Manager> or L<Mail::Box::Manage::User|Mail::Box::Manage::User> OBJECT.
+
+=back
+
+. marked BOOLEAN|C<undef>
+
+=over 4
+
+Whether the folder is flagged for some reason, for instance because
+new messages have arrived.
+
+=back
+
+. name STRING
+
+. only_subs BOOLEAN
+
+=over 4
+
+Some folder types can have messages in their toplevel folder, other
+cannot. That determines the default.
+See L<Mail::Box::topFolderWithMessages()|Mail::Box/"Sub-folders">
+
+=back
+
+. parent OBJECT
+
+. subf_type CLASS
+
+=over 4
+
+The type for a subfolder collection, must extend CLASS
+L<Mail::Box::Collection|Mail::Box::Collection>.
+
+=back
+
+. trace LEVEL
+
+=back
+
+=head2 Attributes
+
+
+$obj-E<gt>B<deleted>({BOOLEAN])
+
+=over 4
+
+=back
+
+$obj-E<gt>B<description>
+
+=over 4
+
+See L<User::Identity::Item/"Attributes">
+
+=back
+
+$obj-E<gt>B<folderType>
+
+=over 4
+
+Returns the type of this folder.
+
+=back
+
+$obj-E<gt>B<fullname>([DELIMETER])
+
+=over 4
+
+Returns the name of the folder, from the toplevel until this one, with
+the DELIMETER string between each level.  DELIMETER default to a forward
+slash (a C</>).
+
+=back
+
+$obj-E<gt>B<inferiors>([BOOLEAN])
+
+=over 4
+
+C<Inferiors> are C<subfolders>.  When this flag is set, it is permitted
+to create subfolders.
+
+=back
+
+$obj-E<gt>B<location>([FILENAME|DIRECTORY|undef])
+
+=over 4
+
+Returns the directory or filename of the folder.  If this is not pre-defined,
+it is computed based on the knowledge about the folder type.  Be sure to set
+the location of the toplevel folder to the folderdir of the user to get
+this to work.
+
+=back
+
+$obj-E<gt>B<manager>
+
+=over 4
+
+Returns the manager (usually a L<Mail::Box::Manage::User|Mail::Box::Manage::User> which owns
+the folders.  May be undefined, by default from parent.
+
+=back
+
+$obj-E<gt>B<marked>([BOOLEAN|undef])
+
+=over 4
+
+When something special has happened with the folder, this flag can
+be set (or cleared).  The C<undef> status is an "unknown".  In the
+IMAP4 protocol, C<0> will result in a C<\Unmarked>, a C<1> results
+in a C<\Marked>, and C<undef> in nothing.
+
+=back
+
+$obj-E<gt>B<name>([NEWNAME])
+
+=over 4
+
+See L<User::Identity::Item/"Attributes">
+
+=back
+
+$obj-E<gt>B<onlySubfolders>([BOOLEAN])
+
+=over 4
+
+Than this folder be opened (without trying) or not?  The default
+depends on the folder type, and whether this is the toplevel folder
+or not.  See L<Mail::Box::topFolderWithMessages()|Mail::Box/"Sub-folders">
+
+=back
+
+$obj-E<gt>B<topfolder>
+
+=over 4
+
+Run up the tree to find the highest level folder.
+
+=back
+
+=head2 Collections
+
+
+$obj-E<gt>B<add>(COLLECTION, ROLE)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<addCollection>(OBJECT | ([TYPE], OPTIONS))
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<collection>(NAME)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<find>(COLLECTION, ROLE)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<parent>([PARENT])
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<removeCollection>(OBJECT|NAME)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<type>
+
+Mail::Box::Identity-E<gt>B<type>
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+$obj-E<gt>B<user>
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
+=head2 Attributes
+
+
+=head2 Subfolders
+
+
+$obj-E<gt>B<addSubfolder>(L<Mail::Box::Identity|Mail::Box::Identity>|DATA)
+
+=over 4
+
+Add a new folder into the administration.  With DATA, a new object
+will be instantiated first.  The identity is returned on success.
+
+=back
+
+$obj-E<gt>B<folder>([[NAME, ...], NAME])
+
+=over 4
+
+Returns the subfolder's object with NAME or C<undef> if it does not
+exist.  When multiple NAMEs are added, those super folders are traverst
+first.  Without any NAME, the current object is returned
+
+I<Example:> get some folder
+
+
+ my $a = $user->folders->folder('b', 'a');
+
+ my $name  = "a:b:c";
+ my $delim = ":";
+ my $f = $user->folders->folder(split $delim, $name);
+
+=back
+
+$obj-E<gt>B<foreach>(CODE)
+
+=over 4
+
+For each of the subfolders found below this point call CODE.  This current
+folder is called first.  Be warned that you may find identities with
+the L<deleted()|Mail::Box::Identity/"Attributes"> flag on.
+
+=back
+
+$obj-E<gt>B<open>(OPTIONS)
+
+=over 4
+
+Open the folder which is described by this identity.  Returned is some
+L<Mail::Box|Mail::Box>.  The options are passed to L<Mail::Box::Manager::open()|Mail::Box::Manager/"Manage open folders">.
+
+=back
+
+$obj-E<gt>B<remove>([NAME])
+
+=over 4
+
+Remove the folder (plus subfolders) with the NAME.  Without NAME, this
+C<Mail::Box::Identity> itself is removed.
+
+The removed structure is returned, which is C<undef> if not
+found.  This is only an administrative remove, you still need a
+L<Mail::Box::Manager::delete()|Mail::Box::Manager/"Manage existing folders">.
+
+=back
+
+$obj-E<gt>B<rename>(FOLDER, [NEWSUBNAME])
+
+=over 4
+
+Move the folder to a different super-FOLDER, under a NEW SUBfolder NAME.
+
+I<Example:> renaming a folder
+
+
+ my $top = $user->topfolder;
+ my $new = $top->folder('xyz') or die;
+ my $f   = $top->folder('abc', 'def')->rename($new, '123');
+
+ print $f->name;      # 123
+ print $f->fullname;  # =/xyz/123
+
+=back
+
+$obj-E<gt>B<subfolderNames>
+
+=over 4
+
+Convenience method: returns the names of the collected subfolders.
+
+=back
+
+$obj-E<gt>B<subfolders>
+
+=over 4
+
+Returns the subfolders or C<undef> if there are none.  This
+information is lazy evaluated and cached.  In LIST context, the folder
+objects are returned (L<Mail::Box::Identity|Mail::Box::Identity> objects), in SCALAR context
+the collection, the L<Mail::Box::Collection|Mail::Box::Collection>.
+
+=back
+
+=head2 Error handling
+
+
+$obj-E<gt>B<AUTOLOAD>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<addReport>(OBJECT)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+Mail::Box::Identity-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<errors>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<log>([LEVEL [,STRINGS]])
+
+Mail::Box::Identity-E<gt>B<log>([LEVEL [,STRINGS]])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logPriority>(LEVEL)
+
+Mail::Box::Identity-E<gt>B<logPriority>(LEVEL)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logSettings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<notImplemented>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<report>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<reportAll>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<trace>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<warnings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+=head2 Cleanup
+
+
+$obj-E<gt>B<DESTROY>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+$obj-E<gt>B<inGlobalDestruction>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+
+
+=head1 DIAGNOSTICS
+
+I<Error:> $object is not a collection.
+
+The first argument is an object, but not of a class which extends
+L<User::Identity::Collection|User::Identity::Collection>.
+
+I<Error:> Cannot load collection module for $type ($class).
+
+Either the specified $type does not exist, or that module named $class returns
+compilation errors.  If the type as specified in the warning is not
+the name of a package, you specified a nickname which was not defined.
+Maybe you forgot the 'require' the package which defines the nickname.
+
+I<Error:> Creation of a collection via $class failed.
+
+The $class did compile, but it was not possible to create an object
+of that class using the options you specified.
+
+I<Error:> Don't know what type of collection you want to add.
+
+If you add a collection, it must either by a collection object or a
+list of options which can be used to create a collection object.  In
+the latter case, the type of collection must be specified.
+
+I<Error:> It is not permitted to add subfolders to $name
+
+The L<inferiors()|Mail::Box::Identity/"Attributes"> flag prohibits the creation of subfolders to this
+folder.
+
+I<Warning:> No collection $name
+
+The collection with $name does not exist and can not be created.
+
+I<Error:> Package $package does not implement $method.
+
+Fatal error: the specific package (or one of its superclasses) does not
+implement this method where it should. This message means that some other
+related classes do implement this method however the class at hand does
+not.  Probably you should investigate this and probably inform the author
+of the package.
+
+I<Error:> The toplevel folder cannot be removed this way
+
+The L<Mail::Box::Identity|Mail::Box::Identity> folder administration structure requires
+a top directory.  That top is registered somewhere (for instance
+by a L<Mail::Box::Manage::User|Mail::Box::Manage::User>).  If you need to remove the top,
+you have to look for a method of that object.
+
+I<Error:> Toplevel directory requires explicit folder type
+
+
+I<Error:> Toplevel directory requires explicit location
+
+
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Locker::DotLock;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Locker';
 
 use IO::File;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/DotLock.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -146,9 +146,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Locker::DotLock-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Locker::DotLock-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -274,7 +274,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Locker::Flock;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Locker';
 
 use IO::File;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Flock.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -140,9 +140,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Locker::Flock-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Locker::Flock-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -285,7 +285,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Locker::Multi;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Locker';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/Multi.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -170,9 +170,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Locker::Multi-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Locker::Multi-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -298,7 +298,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Locker::NFS;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Locker';
 
 use Sys::Hostname;
@@ -86,7 +86,7 @@
 
     if(-e $lockfile && -A $lockfile > $expires)
     {   if(unlink $lockfile)
-             { $self->log(WARNING => "Removed expired lockfile $lockfile.\n") }
+             { $self->log(WARNING => "Removed expired lockfile $lockfile.") }
         else { $self->log(ERROR =>
                         "Unable to remove expired lockfile $lockfile: $!") }
     }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/NFS.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -141,9 +141,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Locker::NFS-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Locker::NFS-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -281,7 +281,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Locker::POSIX;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Locker';
 
 use POSIX;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker/POSIX.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -137,9 +137,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Locker::POSIX-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Locker::POSIX-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -282,7 +282,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,11 +3,10 @@
 
 package Mail::Box::Locker;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Carp;
-use File::Spec;
 use Scalar::Util 'weaken';
 
 #-------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Locker.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -287,9 +287,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Locker-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Locker-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -416,7 +416,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::MH::Index;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Message::Head::Subset;
@@ -87,11 +87,14 @@
     my %index;
 
     while(my $head = $type->new(@options)->read($parser))
-    {   my $msgfile = $head->get('x-mailbox-filename');
+    {
+        # cleanup the index from files which were renamed
+        my $msgfile = $head->get('x-mailbox-filename');
         my $size    = int $head->get('x-mailbox-size');
         next unless -f $msgfile && -s _ == $size;
         next if defined $index_age && -M _ >= $index_age;
 
+        # keep this one
         $index{$msgfile} = $head;
     }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Index.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -149,9 +149,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::MH::Index-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::MH::Index-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -277,7 +277,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::MH::Labels;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Message::Head::Subset;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Labels.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -131,9 +131,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::MH::Labels-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::MH::Labels-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -259,7 +259,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,11 +4,19 @@
 
 package Mail::Box::MH::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Dir::Message';
 
 use File::Copy;
 use Carp;
 
 
+#-------------------------------------------
+
+
+# Purpose of doc is only the warning... no new implementation required.
+
+#-------------------------------------------
+
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -33,7 +33,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -41,14 +41,6 @@
 
 =back
 
-Mail::Box::MH::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::MH::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -68,7 +60,7 @@
 
 =back
 
-Mail::Box::MH::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::MH::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -190,22 +182,46 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<filename>([FILENAME])
+
+=over 4
+
+See L<Mail::Box::Dir::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -213,7 +229,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -221,15 +237,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -237,15 +261,28 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+The order of this message in the folder, counted from zero.  Do not
+change the number (unless you understand the implications).
+
+WARNING:  This sequence number has nothing to do with the message's
+filename, which in case of MH folders are also numbers!  If you need
+that one, use the File::Basename subroutine basename of the filename.
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -253,7 +290,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -261,7 +298,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -525,7 +562,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -541,57 +578,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<filename>([FILENAME])
+Mail::Box::MH::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Dir::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-The order of this message in the folder, counted from zero.  Do not
-change the number (unless you understand the implications).
-
-WARNING:  This sequence number has nothing to do with the message's
-filename, which in case of MH folders are also numbers!  If you need
-that one, use the File::Basename subroutine basename of the filename.
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<create>(FILENAME)
 
 =over 4
@@ -707,9 +712,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::MH::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::MH::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -875,10 +880,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -901,6 +914,14 @@
 a message is used for the first time here, but has disappeared or is
 unreadible for some other reason.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -961,7 +982,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::MH;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Dir';
 
 use Mail::Box::MH::Index;
@@ -10,8 +10,9 @@
 use Mail::Box::MH::Labels;
 
 use Carp;
-use File::Spec;
-use File::Basename;
+use File::Spec       ();
+use File::Basename   'basename';
+use IO::Handle       ();
 
 # Since MailBox 2.052, the use of File::Spec is reduced to the minimum,
 # because it is too slow.  The '/' directory separators do work on
@@ -70,11 +71,11 @@
     return $class if -d $directory;
 
     if(mkdir $directory, 0700)
-    {   $class->log(PROGRESS => "Created folder $name.\n");
+    {   $class->log(PROGRESS => "Created folder $name.");
         return $class;
     }
     else
-    {   $class->log(ERROR => "Cannot create MH folder $name: $!\n");
+    {   $class->log(ERROR => "Cannot create MH folder $name: $!");
         return;
     }
 }
@@ -180,13 +181,6 @@
 
 #-------------------------------------------
 
-sub nameOfSubFolder($@)
-{   my ($self, $name) = (shift, shift);
-    $self->directory . '/' . $name;
-}
-
-#-------------------------------------------
-
 sub openSubFolder($)
 {   my ($self, $name) = @_;
 
@@ -201,7 +195,11 @@
 
 #-------------------------------------------
 
+sub topFolderWithMessages() { 1 }
 
+#-------------------------------------------
+
+
 sub appendMessages(@)
 {   my $class  = shift;
     my %args   = @_;
@@ -362,7 +360,24 @@
  
 #-------------------------------------------
 
+sub delete(@)
+{   my $self = shift;
+    $self->SUPER::delete(@_);
 
+    my $dir = $self->directory;
+    return 1 unless opendir DIR, $dir;
+    IO::Handle::untaint \*DIR;
+
+    # directories (subfolders) are not removed, as planned
+    unlink "$dir/$_" for readdir DIR;
+    closedir DIR;
+
+    rmdir $dir;    # fails when there are subdirs (without recurse)
+}
+
+#-------------------------------------------
+
+
 sub writeMessages($)
 {   my ($self, $args) = @_;
 
@@ -421,7 +436,5 @@
 
 #-------------------------------------------
 
-#-------------------------------------------
 
-
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/MH.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -58,19 +58,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box::MH-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
- Option     Defined in    Default
- folderdir  L<Mail::Box>  undef  
-
-. folderdir DIRECTORY
-
-=back
-
 Mail::Box::MH-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -81,6 +68,7 @@
  body_type          L<Mail::Box>     L<Mail::Message::Body::Lines|Mail::Message::Body::Lines>        
  coerce_options     L<Mail::Box>     C<[]>                                                           
  create             L<Mail::Box>     <false>                                                         
+ directory          L<Mail::Box::Dir>  <derived from folder name>                                      
  extract            L<Mail::Box>     C<10240>                                                        
  field_type         L<Mail::Box>     undef                                                           
  fix_headers        L<Mail::Box>     <false>                                                         
@@ -120,6 +108,8 @@
 
 . create BOOLEAN
 
+. directory DIRECTORY
+
 . extract INTEGER | CODE | METHOD | 'LAZY'|'ALWAYS'
 
 . field_type CLASS
@@ -225,7 +215,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -251,6 +241,7 @@
  folder    L<Mail::Box>     <required>
  message   L<Mail::Box>     undef     
  messages  L<Mail::Box>     undef     
+ share     L<Mail::Box>     <false>   
 
 . folder FOLDERNAME
 
@@ -258,6 +249,8 @@
 
 . messages ARRAY-OF-MESSAGES
 
+. share BOOLEAN
+
 =back
 
 $obj-E<gt>B<close>(OPTIONS)
@@ -276,7 +269,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -300,14 +293,6 @@
 
 =back
 
-Mail::Box::MH-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -359,6 +344,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -442,6 +435,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -463,8 +464,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::MH-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -479,7 +482,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -487,10 +490,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::MH-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -498,6 +511,19 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box::MH-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+ Option     Defined in    Default
+ folderdir  L<Mail::Box>  undef  
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -514,6 +540,14 @@
 
 =back
 
+Mail::Box::MH-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<highestMessageNumber>
 
 =over 4
@@ -674,9 +708,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::MH-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::MH-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -940,7 +974,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,13 +1,13 @@
 
+use strict;
+use warnings;
+
 package Mail::Box::Maildir::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Dir::Message';
 
-use strict;
 use File::Copy;
-use Carp;
-use warnings;
 
 
 sub filename(;$)
@@ -32,11 +32,13 @@
      , replied => ($flags{R} || 0)
      , seen    => ($flags{S} || 0)
      , deleted => ($flags{T} || 0)
+
+     , passed  => ($flags{P} || 0)   # uncommon
      );
 
-    if(defined $oldname)
-    {   move $oldname, $newname
-           or confess "Cannot move $oldname to $newname: $!";
+    if(defined $oldname && ! move $oldname, $newname)
+    {   $self->log(ERROR => "Cannot move $oldname to $newname: $!");
+        return undef;
     }
 
     $self->SUPER::filename($newname);
@@ -79,6 +81,7 @@
     my $newflags    # alphabeticly ordered!
       = ($labels->{draft}   ? 'D' : '')
       . ($labels->{flagged} ? 'F' : '')
+      . ($labels->{passed}  ? 'P' : '')
       . ($labels->{replied} ? 'R' : '')
       . ($labels->{seen}    ? 'S' : '')
       . ($labels->{deleted} ? 'T' : '');
@@ -93,7 +96,7 @@
 
     if($new ne $old)
     {   unless(move $old, $new)
-        {   warn "Cannot rename $old to $new: $!";
+        {   $self->log(ERROR => "Cannot rename $old to $new: $!");
             return;
         }
         $self->log(PROGRESS => "Moved $old to $new.");

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -32,7 +32,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -40,14 +40,6 @@
 
 =back
 
-Mail::Box::Maildir::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::Maildir::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -67,7 +59,7 @@
 
 =back
 
-Mail::Box::Maildir::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Maildir::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -189,22 +181,50 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<filename>([FILENAME])
+
+=over 4
+
+Returns the current filename for this message.  If the FILENAME argument
+is specified, a new filename will be set.  For maildir messages this
+means that modifications are immediately performed: there will be
+a rename (move) from the old name to the new name.  Labels may change
+within in the message object as well.
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -212,7 +232,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -220,15 +240,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -236,15 +264,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -252,7 +288,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -260,7 +296,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -527,7 +563,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -543,81 +579,50 @@
 
 =back
 
-=head2 The message
+=head2 Labels
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<labelsToFilename>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+When the labels on a message change, this may implicate a change in
+the message's filename.  The change will take place immediately.  The
+new filename (which may be the same as the old filename) is returned.
+C<undef> is returned when the rename is required but fails.
 
 =back
 
-$obj-E<gt>B<filename>([FILENAME])
+=head2 Internals
 
-=over 4
 
-Returns the current filename for this message.  If the FILENAME argument
-is specified, a new filename will be set.  For maildir messages this
-means that modifications are immediately performed: there will be
-a rename (move) from the old name to the new name.  Labels may change
-within in the message object as well.
+$obj-E<gt>B<accept>([BOOLEAN])
 
-=back
-
-$obj-E<gt>B<folder>([FOLDER])
-
 =over 4
 
-See L<Mail::Box::Message/"The message">
+Accept a message for the folder.  This will move it from the C<new>
+or C<tmp> sub-directories into the C<cur> sub-directory (or back when
+the BOOLEAN is C<false>).  When you accept an already accepted message,
+nothing will happen.
 
 =back
 
-$obj-E<gt>B<moveTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<seqnr>([INTEGER])
+Mail::Box::Maildir::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-=head2 Labels
-
-
-$obj-E<gt>B<labelsToFilename>
-
-=over 4
-
-When the labels on a message change, this may implicate a change in
-the message's filename.  The change will take place immediately.  The
-new filename (which may be the same as the old filename) is returned.
-C<undef> is returned when the rename is required but fails.
-
-=back
-
-=head2 Internals
-
-
-$obj-E<gt>B<accept>([BOOLEAN])
-
-=over 4
-
-Accept a message for the folder.  This will move it from the C<new>
-or C<tmp> sub-directories into the C<cur> sub-directory (or back when
-the BOOLEAN is C<false>).  When you accept an already accepted message,
-nothing will happen.
-
-=back
-
 $obj-E<gt>B<create>(FILENAME)
 
 =over 4
@@ -733,9 +738,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Maildir::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Maildir::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -901,10 +906,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -927,6 +940,14 @@
 a message is used for the first time here, but has disappeared or is
 unreadible for some other reason.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -958,7 +979,7 @@
  my ($time, $unique, $hostname, $info)
     = $filename =~ m!^(\d+)\.(.*)\.(\w+)(\:.*)?$!;
  my ($semantics, $flags)
-    = $info =~ m!([12])\,([RSTDF]+)$!;
+    = $info =~ m!([12])\,([DFPRST]*)$!;
  my @flags = split //, $flags;
 
 When an application opens the folder, there may be messages in C<new>
@@ -988,6 +1009,9 @@
  S      => seen
  T      => deleted  (tagged for deletion)
 
+Some maildir clients support
+ P      => passed   (resent/forwarded/bounced to someone else)
+
 The flags will immediately change when L<label()|Mail::Message/"Flags"> or L<delete()|Mail::Message/"Flags"> is used,
 which differs from other message implementations: maildir is stateless,
 and should not break when applications crash.
@@ -1002,7 +1026,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,15 +2,16 @@
 use strict;
 package Mail::Box::Maildir;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Dir';
 
 use Mail::Box::Maildir::Message;
 
 use Carp;
-use File::Copy;
+use File::Copy     'move';
 use File::Basename 'basename';
-use Sys::Hostname;
+use Sys::Hostname  'hostname';
+use File::Remove   'remove';
 
 # Maildir is only supported on UNIX, because the filenames probably
 # do not work on other platforms.  Since MailBox 2.052, the use of
@@ -123,13 +124,6 @@
 
 #-------------------------------------------
 
-sub nameOfSubFolder($)
-{   my ($self, $name) = @_;
-    $self->directory.'/'.$name;
-}
-
-#-------------------------------------------
-
 sub openSubFolder($@)
 {   my ($self, $name) = (shift, shift);
     $self->createDirs($self->nameOfSubFolder($name));
@@ -138,14 +132,18 @@
 
 #-------------------------------------------
 
+sub topFolderWithMessages() { 1 }
+
+#-------------------------------------------
+
 my $uniq = rand 1000;
 
 
 sub coerce($)
-{   my ($self, $message) = @_;
+{   my ($self, $message) = (shift, shift);
 
     my $is_native = $message->isa('Mail::Box::Maildir::Message');
-    my $coerced   = $self->SUPER::coerce($message);
+    my $coerced   = $self->SUPER::coerce($message, @_);
 
     my $basename  = $is_native ? basename($message->filename)
       : ($message->timestamp || time) .'.'. hostname .'.'. $uniq++;
@@ -168,19 +166,19 @@
 sub createDirs($)
 {   my ($thing, $dir) = @_;
 
-    $thing->log(ERROR => "Cannot create Maildir folder directory $dir: $!\n"), return
+    $thing->log(ERROR => "Cannot create Maildir folder directory $dir: $!"), return
         unless -d $dir || mkdir $dir;
 
     my $tmp = "$dir/tmp";
-    $thing->log(ERROR => "Cannot create Maildir folder subdir $tmp: $!\n"), return
+    $thing->log(ERROR => "Cannot create Maildir folder subdir $tmp: $!"), return
         unless -d $tmp || mkdir $tmp;
 
     my $new = "$dir/new";
-    $thing->log(ERROR => "Cannot create Maildir folder subdir $new: $!\n"), return
+    $thing->log(ERROR => "Cannot create Maildir folder subdir $new: $!"), return
         unless -d $new || mkdir $new;
 
     my $cur = "$dir/cur";
-    $thing->log(ERROR =>  "Cannot create Maildir folder subdir $cur: $!\n"), return
+    $thing->log(ERROR =>  "Cannot create Maildir folder subdir $cur: $!"), return
         unless -d $cur || mkdir $cur;
 
     $thing;
@@ -219,6 +217,15 @@
 
 #-------------------------------------------
 
+sub delete(@)
+{   my $self = shift;
+
+    # Subfolders are not nested in the directory structure
+    remove \1, $self->directory;
+}
+
+#-------------------------------------------
+
 sub readMessageFilenames
 {   my ($self, $dirname) = @_;
 
@@ -361,12 +368,20 @@
     croak "Cannot create directory $tmpdir: $!", return
         unless -d $tmpdir || mkdir $tmpdir;
 
+    my $msgtype  = $args{message_type} || 'Mail::Box::Maildir::Message';
+
     foreach my $message (@messages)
-    {   my $is_native = $message->isa('Mail::Box::Maildir::Message');
-        my $coerced   = $self->SUPER::coerce($message);
+    {   my $is_native = $message->isa($msgtype);
+        my ($basename, $coerced);
 
-        my $basename  = $is_native ? basename($message->filename)
-         : ($message->timestamp || time) .'.'. hostname .'.'. $uniq++;
+        if($is_native)
+        {   $coerced  = $message;
+            $basename = basename $message->filename;
+        }
+        else
+        {   $coerced  = $self->SUPER::coerce($message);
+            $basename = ($message->timestamp||time).'.'. hostname.'.'.$uniq++;
+        }
 
        my $dir = $self->directory;
        my $tmp = "$dir/tmp/$basename";

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Maildir.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -61,19 +61,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box::Maildir-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
- Option     Defined in    Default
- folderdir  L<Mail::Box>  undef  
-
-. folderdir DIRECTORY
-
-=back
-
 Mail::Box::Maildir-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -85,6 +72,7 @@
  body_type          L<Mail::Box>     L<Mail::Message::Body::Lines|Mail::Message::Body::Lines>        
  coerce_options     L<Mail::Box>     C<[]>                                                           
  create             L<Mail::Box>     <false>                                                         
+ directory          L<Mail::Box::Dir>  <derived from folder name>                                      
  extract            L<Mail::Box>     C<10240>                                                        
  field_type         L<Mail::Box>     undef                                                           
  fix_headers        L<Mail::Box>     <false>                                                         
@@ -128,6 +116,8 @@
 
 . create BOOLEAN
 
+. directory DIRECTORY
+
 . extract INTEGER | CODE | METHOD | 'LAZY'|'ALWAYS'
 
 . field_type CLASS
@@ -175,7 +165,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -215,7 +205,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -239,14 +229,6 @@
 
 =back
 
-Mail::Box::Maildir-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -298,6 +280,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -381,6 +371,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -402,8 +400,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::Maildir-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -418,7 +418,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -426,6 +426,16 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::Maildir-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
@@ -445,12 +455,25 @@
 
 =back
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box::Maildir-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+ Option     Defined in    Default
+ folderdir  L<Mail::Box>  undef  
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<createDirs>(FOLDERDIR)
 
 Mail::Box::Maildir-E<gt>B<createDirs>(FOLDERDIR)
@@ -496,6 +519,14 @@
 
 =back
 
+Mail::Box::Maildir-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -616,9 +647,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Maildir-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Maildir-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -852,7 +883,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,203 @@
+
+use strict;
+use warnings;
+
+package Mail::Box::Manage::User;
+use vars '$VERSION';
+$VERSION = '2.060';
+use base 'Mail::Box::Manager';
+
+use Mail::Box::Collection     ();
+
+#-------------------------------------------
+
+
+sub init($)
+{   my ($self, $args) = @_;
+
+    $self->SUPER::init($args) or return ();
+
+    my $identity = $self->{MBMU_id} = $args->{identity};
+    defined $identity or die;
+
+    my $top     = $args->{folder_id_type}  || 'Mail::Box::Identity';
+    my $coltype = $args->{collection_type} || 'Mail::Box::Collection';
+
+    unless(ref $top)
+    {   my $name = $args->{topfolder_name};
+        $name    = '=' unless defined $name;   # MailBox's abbrev to top
+
+        $top     = $top->new
+         ( name        => $name
+         , manager     => $self
+         , location    => scalar($self->folderdir)
+         , folder_type => $self->defaultFolderType
+         , collection_type => $coltype
+         );
+    }
+
+    $self->{MBMU_topfolder} = $top;
+    $self->{MBMU_delim}     = $args->{delimiter} || '/';
+    $self->{MBMU_inbox}     = $args->{inbox};
+
+    $self;
+}
+
+#-------------------------------------------
+
+
+sub identity() { shift->{MBMU_id} }
+
+#-------------------------------------------
+
+
+sub inbox(;$)
+{   my $self = shift;
+    @_ ? ($self->{MBMU_inbox} = shift) : $self->{MBMU_inbox};
+}
+
+#-------------------------------------------
+
+
+# A lot of work still has to be done here: all moves etc must inform
+# the "existence" administration as well.
+
+#-------------------------------------------
+
+
+sub topfolder() { shift->{MBMU_topfolder} }
+
+#-------------------------------------------
+
+
+sub folder($)
+{   my ($self, $name) = @_;
+    my $top  = $self->topfolder or return ();
+    my @path = split $self->{MBMU_delim}, $name;
+    return () unless shift @path eq $top->name;
+
+    $top->folder(@path);
+}
+
+#-------------------------------------------
+
+
+sub folderCollection($)
+{   my ($self, $name) = @_;
+    my $top  = $self->topfolder or return ();
+
+    my @path = split $self->{MBMU_delim}, $name;
+    unless(shift @path eq $top->name)
+    {   $self->log(ERROR => "Folder name $name not under top.");
+        return ();
+    }
+
+    my $base = pop @path;
+
+    ($top->folder(@path), $base);
+}
+
+#-------------------------------------------
+
+
+# This feature is thoroughly tested in the Mail::Box::Netzwert distribution
+
+sub create($@)
+{   my ($self, $name, %args) = @_;
+    my ($dir, $base) = $self->folderCollection($name);
+
+    unless(defined $dir)
+    {   unless($args{create_supers})
+        {   $self->log(ERROR => "Cannot create $name: higher levels missing");
+            return undef;
+        }
+
+        (my $upper = $name) =~ s!$self->{MBMU_delim}$base!!
+             or die "$name - $base";
+
+        $dir = $self->create($upper, %args, deleted => 1);
+    }
+
+    my $id = $dir->folder($base);
+    if(!defined $id)
+    {   my $idopt= $args{id_options} || [];
+        $id  = $dir->addSubfolder($base, @$idopt, deleted => $args{deleted});
+    }
+    elsif($args{deleted})
+    {   $id->deleted(1);
+        return $id;
+    }
+    elsif($id->deleted)
+    {   # Revive! Raise the death!
+        $id->deleted(0);
+    }
+    else
+    {   # Bumped into existing folder
+        $self->log(ERROR => "Folder $name already exists");
+        return undef;
+    }
+
+    if(!defined $args{create_real} || $args{create_real})
+    {   $self->defaultFolderType->create($id->location, %args)
+           or return undef;
+    }
+
+    $id;
+}
+
+#-------------------------------------------
+                                                                                
+
+sub delete($)
+{   my ($self, $name) = @_;
+    my $id = $self->folder($name) or return ();
+    $id->remove;
+
+    $self->SUPER::delete($name);
+}
+
+#-------------------------------------------
+
+
+sub rename($$@)
+{   my ($self, $oldname, $newname, %args) = @_;
+
+    my $old     = $self->folder($oldname);
+    unless(defined $old)
+    {   $self->log(WARNING
+            => "Source for rename does not exist: $oldname to $newname");
+        return ();
+    }
+
+    my ($newdir, $base) = $self->folderCollection($newname);
+    unless(defined $newdir)
+    {   unless($args{create_supers})
+        {   $self->log(ERROR
+               => "Cannot rename $oldname to $newname: higher levels missing");
+            return ();
+        }
+
+        (my $upper = $newname) =~ s!$self->{MBMU_delim}$base!!
+             or die "$newname - $base";
+
+        $newdir = $self->create($upper, %args, deleted => 1);
+    }
+
+    my $oldlocation = $old->location;
+    my $new         = $old->rename($newdir, $base);
+
+    my $newlocation = $new->location;
+    if($oldlocation ne $newlocation)
+    {   require Carp;
+        croak("Physical folder relocation not yet implemented");
+# this needs a $old->rename(xx,yy) which isn't implemented yet
+    }
+
+    $self->log(PROGRESS => "Renamed folder $oldname to $newname");
+    $new;
+}
+
+#-------------------------------------------
+
+
+1;

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manage/User.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,653 @@
+
+=head1 NAME
+
+Mail::Box::Manage::User - manage the folders of a user
+
+
+=head1 INHERITANCE
+
+ Mail::Box::Manage::User
+   is a Mail::Box::Manager
+   is a Mail::Reporter
+
+
+=head1 SYNOPSIS
+
+ use Mail::Box::Manage::User;
+ use User::Identity;
+
+ my $id      = User::Identity->new(...);
+ my $user    = Mail::Box::Manage::User->new
+   ( identity  => $id
+   , folderdir => "$ENV{HOME}/Mail"
+   , inbox     => $ENV{MAIL}
+   );
+
+ my $inbox   = $user->open($user->inbox);
+ my $top     = $user->topfolder;
+
+
+=head1 DESCRIPTION
+
+Where the L<Mail::Box::Manager|Mail::Box::Manager> takes care of some set of open folder,
+this extension will add knowledge about some related person.  At the
+same time, it will try to cache some information about that person's
+folder files.
+
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Box::Manage::User-E<gt>B<new>(ARGS)
+
+=over 4
+
+Use L<new(default_folder_type)|Mail::Box::Manager/"METHODS"> to explicitly state which kind of folders
+you use.
+
+ Option               Defined in       Default                                       
+ autodetect           L<Mail::Box::Manager>  C<undef>                                      
+ collection_type                       L<Mail::Box::Collection|Mail::Box::Collection>
+ default_folder_type  L<Mail::Box::Manager>  C<'mbox'>                                     
+ delimiter                             "/"                                           
+ folder_id_type                        L<Mail::Box::Identity|Mail::Box::Identity>    
+ folder_types         L<Mail::Box::Manager>  <all standard types>                          
+ folderdir            L<Mail::Box::Manager>  C<[ '.' ]>                                    
+ folderdirs           L<Mail::Box::Manager>  <synonym for C<folderdir>>                    
+ identity                              <required>                                    
+ inbox                                 C<undef>                                      
+ log                  L<Mail::Reporter>  C<'WARNINGS'>                                 
+ topfolder_name                        C<'='>                                        
+ trace                L<Mail::Reporter>  C<'WARNINGS'>                                 
+
+. autodetect TYPE|ARRAY-OF-TYPES
+
+. collection_type CLASS
+
+=over 4
+
+Subfolders grouped together.
+
+=back
+
+. default_folder_type NAME|CLASS
+
+. delimiter STRING
+
+=over 4
+
+The separator used in folder names.  This doesn't need to be the
+same as your directory system is using.
+
+=back
+
+. folder_id_type CLASS|OBJECT
+
+. folder_types NEW-TYPE | ARRAY-OF-NEW-TYPES
+
+. folderdir DIRECTORY
+
+. folderdirs [DIRECTORIES]
+
+. identity OBJECT
+
+=over 4
+
+The main difference between the L<Mail::Box::Manager|Mail::Box::Manager> and this class, is
+the concept of some person (or virtual person) who's files are being
+administered by this object.  The OBJECT is an L<User::Identity|User::Identity>.
+
+The smallest identity that will do:
+C<< my $id = User::Identity->new('myname') >>
+
+=back
+
+. inbox NAME
+
+=over 4
+
+The name of the user's inbox.
+
+=back
+
+. log LEVEL
+
+. topfolder_name STRING
+
+. trace LEVEL
+
+=back
+
+=head2 Attributes
+
+
+$obj-E<gt>B<defaultFolderType>
+
+=over 4
+
+See L<Mail::Box::Manager/"Attributes">
+
+=back
+
+$obj-E<gt>B<folderTypes>
+
+=over 4
+
+See L<Mail::Box::Manager/"Attributes">
+
+=back
+
+$obj-E<gt>B<folderdir>
+
+=over 4
+
+See L<Mail::Box::Manager/"Attributes">
+
+=back
+
+$obj-E<gt>B<identity>
+
+=over 4
+
+Returns a L<User::Identity|User::Identity> object.
+
+=back
+
+$obj-E<gt>B<inbox>([NAME])
+
+=over 4
+
+(Set and) get the NAME of the mailbox which is considered the folder
+for incoming mail.  In many protocols, this folder is handled seperately.
+For instance in IMAP this is the only case-insensitive folder name.
+
+=back
+
+$obj-E<gt>B<registerType>(TYPE, CLASS [,OPTIONS])
+
+=over 4
+
+See L<Mail::Box::Manager/"Attributes">
+
+=back
+
+=head2 Manage open folders
+
+
+$obj-E<gt>B<close>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Manage open folders">
+
+=back
+
+$obj-E<gt>B<closeAllFolders>(, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Manage open folders">
+
+=back
+
+$obj-E<gt>B<isOpenFolder>(FOLDER)
+
+=over 4
+
+See L<Mail::Box::Manager/"Manage open folders">
+
+=back
+
+$obj-E<gt>B<open>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Manage open folders">
+
+=back
+
+$obj-E<gt>B<openFolders>
+
+=over 4
+
+See L<Mail::Box::Manager/"Manage open folders">
+
+=back
+
+=head2 Manage existing folders
+
+
+$obj-E<gt>B<create>(NAME, OPTIONS)
+
+=over 4
+
+Creates a new folder with the specified name.  An folder's administrative
+structure (L<Mail::Box::Identity|Mail::Box::Identity>) is returned, but the folder is not
+opened.
+
+In the accidental case that the folder already
+exists, a warning will be issued, and an empty list/undef returned.
+
+The OPTIONS are passed to L<Mail::Box::create()|Mail::Box/"Internals"> of your default folder
+type, except for the options intended for this method itself.
+
+ Option         Defined in       Default
+ create_real                     <true> 
+ create_supers                   <false>
+ deleted                         <false>
+ id_options                      []     
+
+. create_real BOOLEAN
+
+=over 4
+
+When this option is false, the pysical folder will not be created, but
+only the administration is updated.
+
+=back
+
+. create_supers BOOLEAN
+
+=over 4
+
+When you create a folder where upper hierarchy level are missing, they
+will be created as well.
+
+=back
+
+. deleted BOOLEAN
+
+=over 4
+
+The folder starts as deleted.
+
+=back
+
+. id_options ARRAY
+
+=over 4
+
+Values passed to the instantiated L<Mail::Box::Identity|Mail::Box::Identity>.  That object
+is very picky about the initiation values it accepts.
+
+=back
+
+=back
+
+$obj-E<gt>B<delete>(NAME)
+
+=over 4
+
+Remove all signs from the folder on the file-system.  Messages still in
+the folder will be removed.  This method returns a true value when the
+folder has been removed or not found, so "false" means failure.
+
+It is also possible to delete a folder using C<< $folder->delete >>,
+which will call this method here.  OPTIONS, which are used for some
+other folder types, will be ignored here: the user's index contains the
+required details.
+
+ Option     Defined in             Default           
+ recursive  L<Mail::Box::Manager>  <folder's default>
+
+. recursive BOOLEAN
+
+I<Example:> how to delete a folder
+
+
+ print "no xyz (anymore)\n" if $user->delete('xyz');
+
+=back
+
+$obj-E<gt>B<folder>(NAME)
+
+=over 4
+
+Returns the folder description, a L<Mail::Box::Identity|Mail::Box::Identity>.
+
+=back
+
+$obj-E<gt>B<folderCollection>(NAME)
+
+=over 4
+
+Returns a pair: the folder collection (L<Mail::Box::Collection|Mail::Box::Collection>) and
+the base name of NAME.
+
+=back
+
+$obj-E<gt>B<rename>(OLDNAME, NEWNAME, OPTIONS)
+
+=over 4
+
+Rename the folder with name OLDNAME to NEWNAME.  Both names are full
+pathnames.
+
+ Option         Defined in  Default
+ create_supers              <false>
+
+. create_supers BOOLEAN
+
+=over 4
+
+When you rename a folder to a place where upper hierarchy levels are
+missing, they will get be defined, but with the deleted flag set.
+
+=back
+
+=back
+
+$obj-E<gt>B<topfolder>
+
+=over 4
+
+Returns the top folder of the user's mailbox storage.
+
+=back
+
+=head2 Move messages to folders
+
+
+$obj-E<gt>B<appendMessage>([FOLDER|FOLDERNAME,] MESSAGES, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Move messages to folders">
+
+=back
+
+$obj-E<gt>B<copyMessage>([FOLDER|FOLDERNAME,] MESSAGES, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Move messages to folders">
+
+=back
+
+$obj-E<gt>B<moveMessage>([FOLDER|FOLDERNAME,] MESSAGES, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Move messages to folders">
+
+=back
+
+=head2 Manage message threads
+
+
+$obj-E<gt>B<threads>([FOLDERS], OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Manager/"Manage message threads">
+
+=back
+
+=head2 Internals
+
+
+$obj-E<gt>B<decodeFolderURL>(URL)
+
+=over 4
+
+See L<Mail::Box::Manager/"Internals">
+
+=back
+
+$obj-E<gt>B<toBeThreaded>(FOLDER, MESSAGES)
+
+=over 4
+
+See L<Mail::Box::Manager/"Internals">
+
+=back
+
+$obj-E<gt>B<toBeUnthreaded>(FOLDER, MESSAGES)
+
+=over 4
+
+See L<Mail::Box::Manager/"Internals">
+
+=back
+
+=head2 Error handling
+
+
+$obj-E<gt>B<AUTOLOAD>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<addReport>(OBJECT)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+Mail::Box::Manage::User-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<errors>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<log>([LEVEL [,STRINGS]])
+
+Mail::Box::Manage::User-E<gt>B<log>([LEVEL [,STRINGS]])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logPriority>(LEVEL)
+
+Mail::Box::Manage::User-E<gt>B<logPriority>(LEVEL)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logSettings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<notImplemented>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<report>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<reportAll>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<trace>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<warnings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+=head2 Cleanup
+
+
+$obj-E<gt>B<DESTROY>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+$obj-E<gt>B<inGlobalDestruction>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+
+
+=head1 DIAGNOSTICS
+
+I<Error:> Cannot create $name: higher levels missing
+
+Unless you set L<create(create_supers)|Mail::Box::Manage::User/"Manage existing folders">, all higher level folders must
+exist before this new one can be created.
+
+I<Error:> Cannot rename $name to $new: higher levels missing
+
+Unless you set L<create(create_supers)|Mail::Box::Manage::User/"Manage existing folders">, all higher level folders must
+exist before this new one can be created.
+
+I<Error:> Folder $name is already open.
+
+You cannot ask the manager for a folder which is already open. In some
+older releases (before MailBox 2.049), this was permitted, but then
+behaviour changed, because many nasty side-effects are to be expected.
+For instance, an L<Mail::Box::update()|Mail::Box/"The folder"> on one folder handle would
+influence the second, probably unexpectedly.
+
+I<Error:> Folder $name is not a Mail::Box; cannot add a message.
+
+The folder where the message should be appended to is an object which is
+not a folder type which extends L<Mail::Box|Mail::Box>.  Probably, it is not a folder
+at all.
+
+I<Warning:> Folder does not exist, failed opening $type folder $name.
+
+The folder does not exist and creating is not permitted (see
+L<open(create)|Mail::Box::Manager/"Manage open folders">) or did not succeed.  When you do not have sufficient
+access rights to the folder (for instance wrong password for POP3),
+this warning will be produced as well.
+
+The manager tried to open a folder of the specified type.  It may help
+to explicitly state the type of your folder with the C<type> option.
+There will probably be another warning or error message which is related
+to this report and provides more details about its cause.  You may also
+have a look at L<new(autodetect)|Mail::Box::Manager/"METHODS"> and L<new(folder_types)|Mail::Box::Manager/"METHODS">.
+
+I<Warning:> Folder type $type is unknown, using autodetect.
+
+The specified folder type (see L<open(type)|Mail::Box::Manager/"Manage open folders">, possibly derived from
+the folder name when specified as url) is not known to the manager.
+This may mean that you forgot to require the L<Mail::Box|Mail::Box> extension
+which implements this folder type, but probably it is a typo.  Usually,
+the manager is able to figure-out which type to use by itself.
+
+I<Error:> Illegal folder URL '$url'.
+
+The folder name was specified as URL, but not according to the syntax.
+See L<decodeFolderURL()|Mail::Box::Manager/"Internals"> for an description of the syntax.
+
+I<Error:> No foldername specified to open.
+
+C<open()> needs a folder name as first argument (before the list of options),
+or with the C<folder> option within the list.  If no name was found, the
+MAIL environment variable is checked.  When even that does not result in
+a usable folder, then this error is produced.  The error may be caused by
+an accidental odd-length option list.
+
+I<Error:> Package $package does not implement $method.
+
+Fatal error: the specific package (or one of its superclasses) does not
+implement this method where it should. This message means that some other
+related classes do implement this method however the class at hand does
+not.  Probably you should investigate this and probably inform the author
+of the package.
+
+I<Error:> Unable to remove folder $dir
+
+
+I<Error:> Use appendMessage() to add messages which are not in a folder.
+
+You do not need to copy this message into the folder, because you do
+not share the message between folders.
+
+I<Warning:> Use moveMessage() or copyMessage() to move between open folders.
+
+The message is already part of a folder, and now it should be appended
+to a different folder.  You need to decide between copy or move, which
+both will clone the message (not the body, because they are immutable).
+
+I<Warning:> Will never create a folder $name without having write access.
+
+You have set L<open(create)|Mail::Box::Manager/"Manage open folders">, but only want to read the folder.  Create is
+only useful for folders which have write or append access modes
+(see L<Mail::Box::new(access)|Mail::Box/"Constructors">).
+
+
+=head1 DETAILS
+
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Manager;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Box;
@@ -21,6 +21,8 @@
   , [ maildir => 'Mail::Box::Maildir' ]
   , [ pop     => 'Mail::Box::POP3'    ]
   , [ pop3    => 'Mail::Box::POP3'    ]
+  , [ imap    => 'Mail::Box::IMAP4'   ]
+  , [ imap4   => 'Mail::Box::IMAP4'   ]
   );
 
 my @managers;  # usually only one, but there may be more around :(
@@ -47,11 +49,11 @@
     $self->{MBM_folder_types} = [];
     $self->registerType(@$_) foreach @new_types, @basic_types;
 
-    $self->{MBM_default_type} = $args->{default_folder_type};
+    $self->{MBM_default_type} = $args->{default_folder_type} || 'mbox';
 
     # Inventory on existing folder-directories.
 
-    $self->{MBM_folderdirs} = [ '.' ];
+    $self->{MBM_folderdirs} = [ ];
     if(exists $args->{folderdir})
     {   my @dirs = $args->{folderdir};
         @dirs = @{$dirs[0]} if ref $dirs[0];
@@ -63,6 +65,7 @@
         @dirs = @{$dirs[0]} if ref $dirs[0];
         push @{$self->{MBM_folderdirs}}, @dirs;
     }
+    push @{$self->{MBM_folderdirs}}, '.';
 
     $self->{MBM_folders} = [];
     $self->{MBM_threads} = [];
@@ -85,6 +88,14 @@
 #-------------------------------------------
 
 
+sub folderdir()
+{   my $dirs = shift->{MBM_folderdirs} or return ();
+    wantarray ? @$dirs : $dirs->[0];
+}
+
+#-------------------------------------------
+
+
 sub folderTypes()
 {   my $self = shift;
     my %uniq;
@@ -92,7 +103,21 @@
     sort keys %uniq;
 }
 
+#-------------------------------------------
 
+
+sub defaultFolderType()
+{   my $self = shift;
+    my $name = $self->{MBM_default_type};
+    return $name if $name =~ m/\:\:/;  # obviously a class name
+
+    foreach my $def (@{$self->{MBM_folder_types}})
+    {   return $def->[1] if $def->[0] eq $name || $def->[1] eq $name;
+    }
+
+    undef;
+}
+
 #-------------------------------------------
 
 
@@ -100,15 +125,11 @@
 {   my $self = shift;
     my $name = @_ % 2 ? shift : undef;
     my %args = @_;
+    $args{authentication} ||= 'AUTO';
 
-    $name    = defined $args{folder} ? $args{folder} : $ENV{MAIL}
+    $name    = defined $args{folder} ? $args{folder} : ($ENV{MAIL} || '')
         unless defined $name;
 
-    unless(defined $name)
-    {   $self->log(ERROR => "Don't know which folder I should open: no name.");
-        return undef;
-    }
-      
     if($name =~ m/^(\w+)\:/ && grep { $_ eq $1 } $self->folderTypes)
     {   # Complicated folder URL
         my %decoded = $self->decodeFolderURL($name);
@@ -126,8 +147,16 @@
         $args{folder} = $name;
     }
 
+    my $type = $args{type};
+    if(defined $type && $type eq 'pop3')
+    {   my $un   = $args{username}    ||= $ENV{USER} || $ENV{LOGIN};
+        my $srv  = $args{server_name} ||= 'localhost';
+        my $port = $args{server_port} ||= 110;
+        $args{folder} = $name = "pop3://$un\@$srv:$port";
+    }
+
     unless(defined $name && length $name)
-    {   $self->log(ERROR => "No foldername specified to open.\n");
+    {   $self->log(ERROR => "No foldername specified to open.");
         return undef;
     }
         
@@ -144,7 +173,7 @@
 
     # Do not open twice.
     if(my $folder = $self->isOpenFolder($name))
-    {   $self->log(WARNING => "Folder $name is already open.\n");
+    {   $self->log(ERROR => "Folder $name is already open.");
         return undef;
     }
 
@@ -153,7 +182,7 @@
     #
 
     my ($folder_type, $class, @defaults);
-    if(my $type = $args{type})
+    if($type)
     {   # User-specified foldertype prevails.
         foreach (@{$self->{MBM_folder_types}})
         {   (my $abbrev, $class, @defaults) = @$_;
@@ -210,9 +239,10 @@
 
     push @defaults, manager => $self;
     my $folder = $class->new(@defaults, %args);
-
     unless(defined $folder)
-    {   $self->log(WARNING =>"Folder does not exist, failed opening $folder_type folder $name.");
+    {   $self->log(WARNING =>
+           "Folder does not exist, failed opening $folder_type folder $name.")
+           unless $args{access} eq 'd';
         return;
     }
 
@@ -238,7 +268,7 @@
 
 
 sub close($@)
-{   my ($self, $folder, @options) = @_;
+{   my ($self, $folder, %options) = @_;
     return unless $folder;
 
     my $name      = $folder->name;
@@ -250,7 +280,9 @@
     $self->{MBM_folders} = [ @remaining ];
     $_->removeFolder($folder) foreach @{$self->{MBM_threads}};
 
-    $folder->close(close_by_manager => 1, @options);
+    $folder->close(close_by_manager => 1, %options)
+       unless $options{close_by_self};
+
     $self;
 }
 
@@ -269,9 +301,13 @@
 
 
 sub delete($@)
-{   my ($self, $name, @options) = @_;
-    my $folder = $self->open(folder => $name, @options) or return;
-    $folder->delete;
+{   my ($self, $name, %args) = @_;
+    my $recurse = delete $args{recursive};
+
+    my $folder = $self->open(folder => $name, access => 'd', %args)
+        or return $self;  # still successful
+
+    $folder->delete(recursive => $recurse);
 }
 
 #-------------------------------------------
@@ -373,8 +409,9 @@
         push @messages, $message;
     }
 
-    my %options = @_;
-    $folder ||= $options{folder};
+    my %args = @_;
+    $folder ||= $args{folder};
+    my $share   = exists $args{share} ? $args{share} : $args{_delete};
 
     # Try to resolve filenames into opened-files.
     $folder = $self->isOpenFolder($folder) || $folder
@@ -382,11 +419,11 @@
 
     my @coerced
      = ref $folder
-     ? map {$_->copyTo($folder)} @messages
-     : $self->appendMessages(@messages, %options, folder => $folder);
+     ? map {$_->copyTo($folder, share => $args{share})} @messages
+     : $self->appendMessages(@messages, %args, folder => $folder);
 
     # hidden option, do not use it: it's designed to optimize moveMessage
-    if($options{_delete})
+    if($args{_delete})
     {   $_->label(deleted => 1) foreach @messages;
     }
 
@@ -424,7 +461,7 @@
        :                           $folders
        );
 
-    $self->log(INTERNAL => "No folders specified.\n")
+    $self->log(INTERNAL => "No folders specified.")
        unless @folders;
 
     my $threads;
@@ -488,10 +525,11 @@
     $username ||= $ENV{USER} || $ENV{LOGNAME};
 
     $password ||= '';        # decode password from url
-    $password =~ s/\+/ /g;
-    $password =~ s/\%([A-Fa-f0-9]{2})/chr hex $1/ge;
+    $password   =~ s/\+/ /g;
+    $password   =~ s/\%([A-Fa-f0-9]{2})/chr hex $1/ge;
 
     $hostname ||= 'localhost';
+
     $path     ||= '=';
 
     ( type        => $type,     folder      => $path
@@ -503,4 +541,5 @@
 #-------------------------------------------
 
 
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Manager.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -9,7 +9,10 @@
  Mail::Box::Manager
    is a Mail::Reporter
 
+ Mail::Box::Manager is extended by
+   Mail::Box::Manage::User
 
+
 =head1 SYNOPSIS
 
  use Mail::Box::Manager;
@@ -81,7 +84,7 @@
 
 Specifies the default folder type for newly created folders.  If this
 option is not specified, the most recently registered type is used (see
-L<registerType()|Mail::Box::Manager/"Manage folders"> and the L<new(folder_types)|Mail::Box::Manager/"METHODS"> option.
+L<registerType()|Mail::Box::Manager/"Attributes"> and the L<new(folder_types)|Mail::Box::Manager/"METHODS"> option.
 
 =back
 
@@ -105,7 +108,7 @@
 =over 4
 
 The default directory, or directories, where folders are
-located.  C<Mail::Box::Manager> can autodetect the existing folder-types.
+located. The C<Mail::Box::Manager> can autodetect the existing folder-types.
 There may be different kinds of folders opened at the same time, and
 messages can be moved between those types, although that may result in
 a loss of information depending on the folder types.
@@ -120,65 +123,102 @@
 
 =back
 
-=head2 Manage folders
+=head2 Attributes
 
 
-$obj-E<gt>B<close>(FOLDER, OPTIONS)
+$obj-E<gt>B<defaultFolderType>
 
 =over 4
 
-C<close> removes the specified folder from the list of open folders.
-Indirectly it will update the files on disk if needed (depends on
-the L<Mail::Box::new(save_on_exit)|Mail::Box/"Constructors"> flag for each folder). OPTIONS are
-passed to L<Mail::Box::close()|Mail::Box/"The folder"> of the folder.
+Returns the default folder type, some class name.
 
-The folder's messages will also be withdrawn from the known message threads.
-You may also close the folder directly. The manager will be informed
-about this event and take appropriate actions.
+=back
 
+$obj-E<gt>B<folderTypes>
+
+=over 4
+
+Returns the list of currently defined folder types.
+
 I<Example:> 
 
- my $inbox = $mgr->open('inbox');
- $mgr->close($inbox);
- $inbox->close;        # alternative
+ print join("\n", $manager->folderTypes), "\n";
 
 =back
 
-$obj-E<gt>B<closeAllFolders>(, OPTIONS)
+$obj-E<gt>B<folderdir>
 
 =over 4
 
-C<closeAllFolders> calls close() for each folder managed by
-this object.  It is called just before the program stops (before global
-cleanup).
+In list context, this returns all folderdirs specified.  In SCALAR
+context only the first.
 
 =back
 
-$obj-E<gt>B<delete>(FOLDERNAME [,OPTIONS])
+$obj-E<gt>B<registerType>(TYPE, CLASS [,OPTIONS])
 
 =over 4
 
-Remove the named folder, including all its sub-folders.  The OPTIONS
-are the same as those for L<open()|Mail::Box::Manager/"Manage folders">.
+With C<registerType> you can register one TYPE of folders.  The CLASS
+is compiled automatically, so you do not need to C<use> them in your own
+modules.  The TYPE is just an arbitrary name.
 
-The deletion of a folder can take some time.  Dependent on the type of
-folder, the folder must be read first.  For some folder-types this will
-be fast.
+The added types are prepended to the list of known types, so they are
+checked first when a folder is opened in autodetect mode.
 
+I<Example:> 
+
+ $manager->registerType(mbox => 'Mail::Box::Mbox',
+     save_on_exit => 0, folderdir => '/tmp');
+
 =back
 
-$obj-E<gt>B<folderTypes>
+=head2 Manage open folders
 
+
+$obj-E<gt>B<close>(FOLDER, OPTIONS)
+
 =over 4
 
-Returns the list of currently defined folder types.
+C<close> removes the specified folder from the list of open folders.
+Indirectly it will update the files on disk if needed (depends on
+the L<Mail::Box::new(save_on_exit)|Mail::Box/"Constructors"> flag for each folder). OPTIONS are
+passed to L<Mail::Box::close()|Mail::Box/"The folder"> of the folder.
 
+The folder's messages will also be withdrawn from the known message threads.
+You may also close the folder directly. The manager will be informed
+about this event and take appropriate actions.
+
+ Option         Defined in  Default
+ close_by_self              <false>
+
+. close_by_self BOOLEAN
+
+=over 4
+
+Used internally to avoid confusion about how the close was started.  Do
+not change this.
+
+=back
+
 I<Example:> 
 
- print join("\n", $manager->folderTypes), "\n";
+ my $inbox = $mgr->open('inbox');
+ $mgr->close($inbox);
+ $inbox->close;        # alternative
 
 =back
 
+$obj-E<gt>B<closeAllFolders>(, OPTIONS)
+
+=over 4
+
+C<closeAllFolders> calls close() for each folder managed by
+this object.  It is called just before the program stops (before global
+cleanup).
+
+=back
+
 $obj-E<gt>B<isOpenFolder>(FOLDER)
 
 =over 4
@@ -204,12 +244,24 @@
 description of the folder options, see the options to the constructor
 L<Mail::Box::new()|Mail::Box/"Constructors"> for each type of mail box.
 
- Option     Defined in       Default                 
- create                      <false>                 
- folder                      C<$ENV{MAIL}>           
- folderdir                   C<'.'>                  
- type                        <first, usually C<mbox>>
+ Option        Defined in       Default                 
+ authenticate                   C<'AUTO'>               
+ create                         <false>                 
+ folder                         C<$ENV{MAIL}>           
+ folderdir                      C<'.'>                  
+ type                           <first, usually C<mbox>>
 
+. authenticate TYPE|ARRAY-OF-TYPES|'AUTO'
+
+=over 4
+
+The TYPE of authentication to be used, or a list of TYPES which the
+client prefers.  The server may provide preferences as well, and that
+order will be kept.  This option is only supported by a small subset of
+folder types, especially by POP and IMAP.
+
+=back
+
 . create BOOLEAN
 
 =over 4
@@ -289,24 +341,32 @@
 
 =back
 
-$obj-E<gt>B<registerType>(TYPE, CLASS [,OPTIONS])
+=head2 Manage existing folders
 
+
+$obj-E<gt>B<delete>(FOLDERNAME, OPTIONS)
+
 =over 4
 
-With C<registerType> you can register one TYPE of folders.  The CLASS
-is compiled automatically, so you do not need to C<use> them in your own
-modules.  The TYPE is just an arbitrary name.
+Remove the named folder.  The OPTIONS are the same as those for L<open()|Mail::Box::Manager/"Manage open folders">.
 
-The added types are prepended to the list of known types, so they are
-checked first when a folder is opened in autodetect mode.
+The deletion of a folder can take some time.  Dependent on the type of
+folder, the folder must be read first.  For some folder-types this will
+be fast.
 
-I<Example:> 
+ Option     Defined in  Default           
+ recursive              <folder's default>
 
- $manager->registerType(mbox => 'Mail::Box::Mbox',
-     save_on_exit => 0, folderdir => '/tmp');
+. recursive BOOLEAN
 
+=over 4
+
+Some folder can only be recursively deleted, other have more flexibility.
+
 =back
 
+=back
+
 =head2 Move messages to folders
 
 
@@ -351,15 +411,26 @@
 =over 4
 
 Copy a message from one folder into another folder.  If the destination
-folder is already opened, the copied message is stored in memory and
-written to disk when a write of the folder is later performed. Otherwise,
-the destination folder will be opened, the message written, and then the
-folder closed.
+folder is already opened, L<Mail::Box::copyTo()|Mail::Box/"The folder"> is used.  Otherwise,
+L<Mail::Box::appendMessages()|Mail::Box/"The folder"> is called.
 
 You need to specify a folder's name or folder object as the first
 argument, or in the options list.  The options are the same as those
 which can be specified when opening a folder.
 
+ Option  Defined in  Default
+ share               <false>
+
+. share BOOLEAN
+
+=over 4
+
+Try to share the physical storage of the messages.  The folder types
+may be different, but it all depends on the actual folder where the
+message is copied to.  Silently ignored when not possible to share.
+
+=back
+
 I<Example:> 
 
  my $drafts = $mgr->open(folder => 'Drafts');
@@ -367,7 +438,7 @@
  $mgr->copyMessage($outbox, $drafts->message(0));
 
  my @messages = $drafts->message(1,2);
- $mgr->copyMessage('=Trash', @messages.
+ $mgr->copyMessage('=Trash', @messages,
     folderdir => '/tmp', create => 1);
 
  $mgr->copyMessage($drafts->message(1),
@@ -388,9 +459,14 @@
 
 is equivalent to
 
- $mgr->copyMessage($received, $inbox->message(1));
+ $mgr->copyMessage($received, $inbox->message(1), share => 1);
  $inbox->message(1)->delete;
 
+ Option  Defined in  Default
+ share               <true> 
+
+. share BOOLEAN
+
 =back
 
 =head2 Manage message threads
@@ -464,9 +540,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Manager-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Manager-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -573,11 +649,8 @@
 
 =head1 DIAGNOSTICS
 
-I<Error:> Don't know which folder I should open: no name
+I<Error:> Folder $name is already open.
 
-
-I<Warning:> Folder $name is already open.
-
 You cannot ask the manager for a folder which is already open. In some
 older releases (before MailBox 2.049), this was permitted, but then
 behaviour changed, because many nasty side-effects are to be expected.
@@ -593,7 +666,7 @@
 I<Warning:> Folder does not exist, failed opening $type folder $name.
 
 The folder does not exist and creating is not permitted (see
-L<open(create)|Mail::Box::Manager/"Manage folders">) or did not succeed.  When you do not have sufficient
+L<open(create)|Mail::Box::Manager/"Manage open folders">) or did not succeed.  When you do not have sufficient
 access rights to the folder (for instance wrong password for POP3),
 this warning will be produced as well.
 
@@ -605,7 +678,7 @@
 
 I<Warning:> Folder type $type is unknown, using autodetect.
 
-The specified folder type (see L<open(type)|Mail::Box::Manager/"Manage folders">, possibly derived from
+The specified folder type (see L<open(type)|Mail::Box::Manager/"Manage open folders">, possibly derived from
 the folder name when specified as url) is not known to the manager.
 This may mean that you forgot to require the L<Mail::Box|Mail::Box> extension
 which implements this folder type, but probably it is a typo.  Usually,
@@ -643,24 +716,87 @@
 to a different folder.  You need to decide between copy or move, which
 both will clone the message (not the body, because they are immutable).
 
-I<Error:> Will never create a folder $name without having write access.
+I<Warning:> Will never create a folder $name without having write access.
 
-You have set L<open(create)|Mail::Box::Manager/"Manage folders">, but only want to read the folder.  Create is
+You have set L<open(create)|Mail::Box::Manager/"Manage open folders">, but only want to read the folder.  Create is
 only useful for folders which have write or append access modes
 (see L<Mail::Box::new(access)|Mail::Box/"Constructors">).
 
 
+=head1 DETAILS
 
+On many places in the documentation you can read that it is useful to
+have a manager object.  There are two of them: the L<Mail::Box::Manager|Mail::Box::Manager>,
+which maintains a set of open folders, and an extension of it: the
+L<Mail::Box::Manage::User|Mail::Box::Manage::User>.
 
+=head2 Managing open folders
 
+It is useful to start your program by creating a folder manager object,
+an L<Mail::Box::Manager|Mail::Box::Manager>.  The object takes a few burdons from your neck:
 
+=over 4
+
+=item * autodetect the type of folder which is used.
+
+This means that your application can be fully folder type independent.
+
+=item * autoload the required modules
+
+There are so many modules involved in MailBox, that it is useful to
+have some lazy autoloading of code.  The manager knows which modules
+belong to which type of folder.
+
+=item * avoid double openings
+
+Your programming mistakes may cause the same folder to be opened twice.
+The result of that could be very destructive.  Therefore, the manager
+keeps track on all open folders and avoids the same folder to be opened
+for the second time.
+
+=item * close folders at clean-up
+
+When the program is ending, the manager will cleanly close all folders
+which are still open.  This is required, because the autodestruct
+sequence of Perl works in an unpredicatable order.
+
+=item * message thread detection
+
+MailBox can discover message threads which span multiple folders. Any set
+of open folders may be grouped in a tree of replies on replies on replies.
+When a folder is closed, it will automatically be removed from the threads,
+
+and a new folder can dynamically be added to the structure.
+=back
+
+The manager is really simplifying things, and should therefore be the
+base of all programs. However, it is possible to write useful programs
+without it.
+
+=head2 Managing a user
+
+One step further is the L<Mail::Box::Manage::User|Mail::Box::Manage::User> object (since MailBox
+v2.057), which not only keeps track on open folders, but also collects
+information about not-open folders.
+
+The user class is, as the name says, targeted on managing one single user.
+Where the L<Mail::Box::Manager|Mail::Box::Manager> will open any set of folder files, probably
+from multiple users, the user class want one root folder directory.
+
+In many aspects, the user manager simplifies the task for user-based servers
+and other user-centric applications by setting smart defaults.
+
+
+
+
+
 =head1 REFERENCES
 
 See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Mbox::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::File::Message';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -31,7 +31,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -39,14 +39,6 @@
 
 =back
 
-Mail::Box::Mbox::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::Mbox::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -66,7 +58,7 @@
 
 =back
 
-Mail::Box::Mbox::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Mbox::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -188,22 +180,46 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<fromLine>([LINE])
+
+=over 4
+
+See L<Mail::Box::File::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -211,7 +227,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -219,15 +235,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -235,15 +259,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -251,7 +283,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -523,7 +555,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -539,52 +571,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::Mbox::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<fromLine>([LINE])
-
-=over 4
-
-See L<Mail::Box::File::Message/"The message">
-
-=back
-
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -692,9 +697,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Mbox::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Mbox::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -843,10 +848,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -858,6 +871,14 @@
 I<Error:> Unable to read delayed body.
 
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -881,7 +902,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Mbox;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::File';
 
 use Mail::Box::Mbox::Message;
@@ -66,6 +66,16 @@
 
 #-------------------------------------------
 
+sub delete(@)
+{   my $self = shift;
+    $self->SUPER::delete(@_);
+
+    my $subfdir = $self->filename . $default_sub_extension;
+    rmdir $subfdir;   # may fail, when there are still subfolders (no recurse)
+}
+
+#-------------------------------------------
+
 sub writeMessages($)
 {   my ($self, $args) = @_;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Mbox.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -58,31 +58,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box::Mbox-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
- Option               Defined in       Default
- folderdir            L<Mail::Box>     undef  
- subfolder_extension                   undef  
-
-. folderdir DIRECTORY
-
-. subfolder_extension STRING
-
-=over 4
-
-If a directory is found on the location of the folder to be created, this
-STRING is used to extend that directory name with.  This will cause the
-directory to be seen as sub-folder for the created folder.  This argument
-is passed to L<folderToFilename()|Mail::Box::Mbox/"Internals">.
-
-=back
-
-=back
-
 Mail::Box::Mbox-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -190,7 +165,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -230,7 +205,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -254,28 +229,6 @@
 
 =back
 
-Mail::Box::Mbox-E<gt>B<foundIn>([FOLDERNAME], [OPTIONS])
-
-=over 4
-
-If no FOLDERNAME is specified, then the value of the C<folder> option
-is taken.  A mbox folder is a file which starts with a separator
-line: a line with C<'From '> as first characters.  Blank lines which
-start the file are ignored, which is not for all MUA's acceptable.
-
- Option               Defined in       Default      
- folder                                undef        
- folderdir            L<Mail::Box>     undef        
- subfolder_extension                   <from object>
-
-. folder FOLDERNAME
-
-. folderdir DIRECTORY
-
-. subfolder_extension STRING
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -327,6 +280,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -410,6 +371,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -427,12 +396,12 @@
 
 =over 4
 
- Option               Defined in       Default      
- check                L<Mail::Box>     <false>      
- folder               L<Mail::Box>     <required>   
- folderdir            L<Mail::Box>     <from folder>
- skip_empty           L<Mail::Box>     <false>      
- subfolder_extension                   <from object>
+ Option               Defined in       Default              
+ check                L<Mail::Box>     <false>              
+ folder               L<Mail::Box>     <from calling object>
+ folderdir            L<Mail::Box>     <from folder>        
+ skip_empty           L<Mail::Box>     <false>              
+ subfolder_extension                   <from object>        
 
 . check BOOLEAN
 
@@ -453,8 +422,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::Mbox-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -469,7 +440,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -477,10 +448,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::Mbox-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -488,6 +469,31 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box::Mbox-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+ Option               Defined in       Default
+ folderdir            L<Mail::Box>     undef  
+ subfolder_extension                   undef  
+
+. folderdir DIRECTORY
+
+. subfolder_extension STRING
+
+=over 4
+
+If a directory is found on the location of the folder to be created, this
+STRING is used to extend that directory name with.  This will cause the
+directory to be seen as sub-folder for the created folder.  This argument
+is passed to L<folderToFilename()|Mail::Box::Mbox/"Internals">.
+
+=back
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -509,6 +515,28 @@
 
 =back
 
+Mail::Box::Mbox-E<gt>B<foundIn>([FOLDERNAME], [OPTIONS])
+
+=over 4
+
+If no FOLDERNAME is specified, then the value of the C<folder> option
+is taken.  A mbox folder is a file which starts with a separator
+line: a line with C<'From '> as first characters.  Blank lines which
+start the file are ignored, which is not for all MUA's acceptable.
+
+ Option               Defined in       Default      
+ folder                                undef        
+ folderdir            L<Mail::Box>     undef        
+ subfolder_extension                   <from object>
+
+. folder FOLDERNAME
+
+. folderdir DIRECTORY
+
+. subfolder_extension STRING
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -648,9 +676,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Mbox-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Mbox-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -905,7 +933,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Message::Destructed;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Message';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message/Destructed.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -39,7 +39,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -47,24 +47,6 @@
 
 =back
 
-Mail::Box::Message::Destructed-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-Coerce a L<Mail::Box::Message|Mail::Box::Message> into destruction.
-
-I<Example:> of coercion to death
-
-
- Mail::Box::Message::Destructed->coerce($folder->message(1));
- $folder->message(1)->destruct;  # same
-
- my $msg = $folder->message(1);
- Mail::Box::Message::Destructed->coerce($msg);
- $msg->destruct;                 # same
-
-=back
-
 Mail::Box::Message::Destructed-E<gt>B<new>(MESSAGE-ID, OPTIONS)
 
 =over 4
@@ -129,7 +111,7 @@
 
 =back
 
-Mail::Box::Message::Destructed-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Message::Destructed-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -251,22 +233,38 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -274,7 +272,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -282,15 +280,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -298,15 +304,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -314,7 +328,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -322,7 +336,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -590,7 +604,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -606,44 +620,35 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::Message::Destructed-E<gt>B<coerce>(MESSAGE)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+Coerce a L<Mail::Box::Message|Mail::Box::Message> into destruction.
 
-=back
+I<Example:> of coercion to death
 
-$obj-E<gt>B<moveTo>(FOLDER)
 
-=over 4
+ Mail::Box::Message::Destructed->coerce($folder->message(1));
+ $folder->message(1)->destruct;  # same
 
-See L<Mail::Box::Message/"The message">
+ my $msg = $folder->message(1);
+ Mail::Box::Message::Destructed->coerce($msg);
+ $msg->destruct;                 # same
 
 =back
 
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -727,9 +732,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Message::Destructed-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Message::Destructed-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -893,10 +898,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Box::Message::Destructed/"METHODS">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -918,6 +931,14 @@
 your program still tries to get to the header or body data after this
 destruction, which is not possible.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -941,7 +962,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,41 +4,30 @@
 
 package Mail::Box::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message';
 
 use Date::Parse;
 use Scalar::Util 'weaken';
 
 
+#-------------------------------------------
+
+
 sub init($)
 {   my ($self, $args) = @_;
     $self->SUPER::init($args);
 
-    $self->{MBM_body_type}  = $args->{body_type}
-        if exists $args->{body_type};
-
-    $self->{MBM_folder}     = $args->{folder};
+    $self->{MBM_body_type} = $args->{body_type};
+    $self->{MBM_folder}    = $args->{folder};
     weaken($self->{MBM_folder});
 
     return $self if $self->isDummy;
-
     $self;
 }
 
 #-------------------------------------------
 
-
-sub coerce($)
-{   my ($class, $message) = @_;
-    return bless $message, $class
-        if $message->isa(__PACKAGE__);
-
-    $class->SUPER::coerce($message);
-}
-
-#-------------------------------------------
-
 sub head(;$)
 {   my $self  = shift;
     return $self->SUPER::head unless @_;
@@ -88,17 +77,23 @@
 #-------------------------------------------
 
 
-sub copyTo($)
-{   my ($self, $folder) = @_;
-    $folder->addMessage($self->clone);
+sub copyTo($@)
+{   my ($self, $folder) = (shift, shift);
+    my $clone = $self->clone(@_);
+
+    $folder->addMessage($clone);
 }
 
 #-------------------------------------------
 
 
-sub moveTo($)
-{   my ($self, $folder) = @_;
-    my $added = $folder->addMessage($self->clone);
+sub moveTo($@)
+{   my ($self, $folder, %args) = @_;
+
+    $args{share} = 1
+         unless exists $args{share} || exists $args{shallow_body};
+
+    my $added = $folder->copyTo($folder, %args);
     $self->label(deleted => 1);
     $added;
 }
@@ -111,7 +106,7 @@
 
     unless($getbodytype)
     {   my $folder   = $self->{MBM_folder};
-        $getbodytype = sub {$folder->determineBodyType(@_)};
+        $getbodytype = sub {$folder->determineBodyType(@_)} if defined $folder;
     }
 
     $self->SUPER::readBody($parser, $head, $getbodytype);

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -45,7 +45,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -53,17 +53,6 @@
 
 =back
 
-Mail::Box::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-Coerce a message to be included in a folder.  The folder itself
-is not specified, but the type of the message is transformed correctly.
-The coerced version of the message is returned.  When no changes had
-to be made, the original message is returned.
-
-=back
-
 Mail::Box::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -147,7 +136,7 @@
 
 =back
 
-Mail::Box::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -269,22 +258,86 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+Copy the message to the indicated opened FOLDER, without deleting the
+original.  The coerced message (the clone in the destination folder)
+is returned.
+
+ Option        Defined in       Default
+ shallow                        <false>
+ shallow_body                   <false>
+ shallow_head                   <false>
+ share                          <false>
+
+. shallow BOOLEAN
+
+=over 4
+
+Used for L<clone(shallow)|Mail::Message/"Constructors">.
+
+=back
+
+. shallow_body BOOLEAN
+
+=over 4
+
+Used for L<clone(shallow_body)|Mail::Message/"Constructors">.
+
+=back
+
+. shallow_head BOOLEAN
+
+=over 4
+
+Used for L<clone(shallow_head)|Mail::Message/"Constructors">.
+
+=back
+
+. share BOOLEAN
+
+=over 4
+
+Try to share the physical storage of the message between the two folders.
+Sometimes, they even may be of different types.  When not possible, this
+options will be silently ignored.
+
+=back
+
+I<Example:> 
+
+ my $draft = $mgr->open(folder => 'Draft');
+ $message->copyTo($draft, share => 1);
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+In with folder did we detect this message/dummy?  This is a reference
+to the folder-object.
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -292,7 +345,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -300,15 +353,63 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+Move the message from this folder to the FOLDER specified.  This will
+create a copy using L<clone()|Mail::Message/"Constructors"> first.  Then, this original message is
+flagged to get deleted.  So until the source folder is closed, two copies
+of the message may stay in memory.
+
+The newly created message clone (part of the destination folder)
+is returned.  All OPTIONS are passed to L<copyTo()|Mail::Box::Message/"The message">
+
+ Option        Defined in       Default                          
+ shallow_body                   <undef>                          
+ share                          <true unless shallow_body exists>
+
+. shallow_body BOOLEAN
+
+=over 4
+
+Only create a shallow body, which means that the header can not be
+reused.  A message can therefore not be shared in storage unless
+explicitly stated.
+
+=back
+
+. share BOOLEAN
+
+=over 4
+
+When there is a chance that the original message can be undeleted, then
+this must be set to false.  Otherwise a shallow clone will be made, which
+will share the header which can be modified in the undeleted message.
+
+=back
+
+I<Example:> of moving a message
+
+
+ my $t = $msg->moveTo('trash');
+
+is equivalent to
+
+ my $t = $msg->copyTo('trash', share => 1);
+ $msg->delete;
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -316,15 +417,24 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+Get the number of this message is the current folder.  It starts counting
+from zero.  Do not change the number.
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -332,7 +442,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -340,7 +450,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -604,7 +714,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -620,57 +730,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-Copy the message to the indicated opened FOLDER, without deleting the
-original.  The coerced message (the copy in the desitnation folder) is
-returned.
+See L<Mail::Message/"Internals">
 
-I<Example:> 
-
- my $draft = $mgr->open(folder => 'Draft');
- $message->copyTo($draft);
-
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-In with folder did we detect this message/dummy?  This is a reference
-to the folder-object.
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-Move the message from this folder to the FOLDER specified.  This will
-create a copy using L<clone()|Mail::Message/"Constructors"> first, and flag this original message
-to be deleted.  So until the source folder is closed, two copies of
-the message stay in memory.  The newly created message (part of the
-destination folder) is returned.
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-Get the number of this message is the current folder.  It starts counting
-from zero.  Do not change the number.
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -763,9 +841,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -917,10 +995,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -929,6 +1015,14 @@
 not.  Probably you should investigate this and probably inform the author
 of the package.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -952,7 +1046,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Box::Net::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Message';
 
 use File::Copy;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -36,7 +36,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -44,14 +44,6 @@
 
 =back
 
-Mail::Box::Net::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::Net::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -122,7 +114,7 @@
 
 =back
 
-Mail::Box::Net::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::Net::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -244,22 +236,38 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -267,7 +275,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -275,15 +283,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -291,15 +307,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -307,15 +331,25 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<unique>([STRING|undef])
+
+=over 4
+
+Returns the name of the file in which this message is actually stored.  This
+will return C<undef> when the message is not stored in a file.  When a STRING
+is specified, a new identifier is stored first.
+
+=back
+
 $obj-E<gt>B<write>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -579,7 +613,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -595,54 +629,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::Net::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<unique>([STRING|undef])
-
-=over 4
-
-Returns the name of the file in which this message is actually stored.  This
-will return C<undef> when the message is not stored in a file.  When a STRING
-is specified, a new identifier is stored first.
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -732,9 +737,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Net::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Net::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -883,10 +888,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -901,6 +914,14 @@
 I<Error:> Unable to read delayed head.
 
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -924,7 +945,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Net;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use base 'Mail::Box';
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Net.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -71,21 +71,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDER, OPTIONS)
-
-Mail::Box::Net-E<gt>B<create>(FOLDER, OPTIONS)
-
-=over 4
-
-Create a new folder on the remote server.
-
- Option     Defined in    Default   
- folderdir  L<Mail::Box>  <not used>
-
-. folderdir DIRECTORY
-
-=back
-
 Mail::Box::Net-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -211,7 +196,7 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -251,7 +236,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -268,14 +253,6 @@
 
 =back
 
-Mail::Box::Net-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -327,6 +304,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -410,6 +395,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -431,8 +424,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::Net-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -447,7 +442,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -455,10 +450,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::Net-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -466,6 +471,21 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDER, OPTIONS)
+
+Mail::Box::Net-E<gt>B<create>(FOLDER, OPTIONS)
+
+=over 4
+
+Create a new folder on the remote server.
+
+ Option     Defined in    Default   
+ folderdir  L<Mail::Box>  <not used>
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -474,6 +494,14 @@
 
 =back
 
+Mail::Box::Net-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -586,9 +614,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Net-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Net-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -777,7 +805,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Box::POP3::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Net::Message';
 
 use File::Copy;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -34,7 +34,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -42,14 +42,6 @@
 
 =back
 
-Mail::Box::POP3::Message-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Box::Message/"METHODS">
-
-=back
-
 Mail::Box::POP3::Message-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -114,7 +106,7 @@
 
 =back
 
-Mail::Box::POP3::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Box::POP3::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -236,22 +228,38 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<copyTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
+$obj-E<gt>B<folder>([FOLDER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<isDummy>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -259,7 +267,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -267,15 +275,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<moveTo>(FOLDER, OPTIONS)
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<print>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -283,10 +299,18 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<seqnr>([INTEGER])
+
+=over 4
+
+See L<Mail::Box::Message/"The message">
+
+=back
+
 $obj-E<gt>B<size>
 
 =over 4
@@ -302,15 +326,23 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
+$obj-E<gt>B<unique>([STRING|undef])
+
+=over 4
+
+See L<Mail::Box::Net::Message/"The message">
+
+=back
+
 $obj-E<gt>B<write>([FILEHANDLE])
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -574,7 +606,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -590,52 +622,25 @@
 
 =back
 
-=head2 The message
+=head2 Internals
 
 
-$obj-E<gt>B<copyTo>(FOLDER)
+$obj-E<gt>B<clonedFrom>
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<folder>([FOLDER])
+Mail::Box::POP3::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Message/"The message">
+See L<Mail::Message/"Internals">
 
 =back
 
-$obj-E<gt>B<moveTo>(FOLDER)
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<seqnr>([INTEGER])
-
-=over 4
-
-See L<Mail::Box::Message/"The message">
-
-=back
-
-$obj-E<gt>B<unique>([STRING|undef])
-
-=over 4
-
-See L<Mail::Box::Net::Message/"The message">
-
-=back
-
-=head2 Internals
-
-
 $obj-E<gt>B<diskDelete>
 
 =over 4
@@ -727,9 +732,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::POP3::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::POP3::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -878,10 +883,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -896,6 +909,14 @@
 I<Error:> Unable to read delayed head.
 
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -919,7 +940,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Box::POP3;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Net';
 
 use strict;
@@ -20,6 +20,7 @@
 {   my ($self, $args) = @_;
 
     $args->{server_port} ||= 110;
+    $args->{folder}      ||= 'inbox';
 
     $self->SUPER::init($args);
 
@@ -76,26 +77,24 @@
 
 #-------------------------------------------
 
-sub close()
+sub close(@)
 {   my $self = shift;
 
-    if(my $pop = delete $self->{MBP_client})
-    {   $pop->disconnect;
-    }
+    $self->SUPER::close(@_);
 
-    $self->SUPER::close;
+    my $pop = delete $self->{MBP_client};
+    $pop->disconnect if defined $pop;
+
+    $self;
 }
 
 #-------------------------------------------
 
 
-sub delete()
+sub delete(@)
 {   my $self = shift;
-    $self->log(NOTICE =>
-        "A POP3 folder cannot be deleted: it will be emptied.");
-
-    $_->label(deleted => 1) foreach $self->messages;
-    $self;
+    $self->log(WARNING => "POP3 folders cannot be deleted.");
+    undef;
 }
 
 #-------------------------------------------
@@ -110,7 +109,11 @@
 
 #-------------------------------------------
 
+sub topFolderWithMessages() { 1 }  # Yes: only top folder
 
+#-------------------------------------------
+
+
 sub update() {shift->notImplemented}
 
 #-------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/POP3.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -61,22 +61,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDER, OPTIONS)
-
-Mail::Box::POP3-E<gt>B<create>(FOLDER, OPTIONS)
-
-=over 4
-
-It is not possible to create a new folder on a POP3 server.  This method
-will always return C<false>.
-
- Option     Defined in    Default   
- folderdir  L<Mail::Box>  <not used>
-
-. folderdir DIRECTORY
-
-=back
-
 Mail::Box::POP3-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -95,7 +79,7 @@
  extract            L<Mail::Box>     C<10240>                                                        
  field_type         L<Mail::Box>     undef                                                           
  fix_headers        L<Mail::Box>     <false>                                                         
- folder             L<Mail::Box>     C<'/'>                                                          
+ folder             L<Mail::Box>     <not applicable>                                                
  folderdir          L<Mail::Box>     <not used>                                                      
  head_delayed_type  L<Mail::Box>     L<Mail::Message::Head::Delayed|Mail::Message::Head::Delayed>    
  head_type          L<Mail::Box>     L<Mail::Message::Head::Complete|Mail::Message::Head::Complete>  
@@ -225,6 +209,11 @@
 C<undef> is returned, and an error displayed.  However, no complaint is
 given when the MESSAGE is C<undef> itself.
 
+ Option  Defined in    Default   
+ share   L<Mail::Box>  <not used>
+
+. share BOOLEAN
+
 =back
 
 $obj-E<gt>B<addMessages>(MESSAGES)
@@ -260,7 +249,7 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
@@ -268,6 +257,11 @@
 is remove all the messages in it... which is the action implemented here.
 A notice is logged about this.
 
+ Option     Defined in    Default   
+ recursive  L<Mail::Box>  <not used>
+
+. recursive BOOLEAN
+
 =back
 
 $obj-E<gt>B<folderdir>([DIRECTORY])
@@ -278,14 +272,6 @@
 
 =back
 
-Mail::Box::POP3-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Box/"The folder">
-
-=back
-
 $obj-E<gt>B<name>
 
 =over 4
@@ -337,6 +323,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+See L<Mail::Box/"Folder flags">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -420,6 +414,14 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"The messages">
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -440,11 +442,11 @@
 The standard POP3 protocol does not support sub-folders, so an
 empty list will be returned in any case.
 
- Option      Defined in       Default      
- check       L<Mail::Box>     <false>      
- folder      L<Mail::Box>     <required>   
- folderdir   L<Mail::Box>     <from folder>
- skip_empty  L<Mail::Box>     <false>      
+ Option      Defined in       Default              
+ check       L<Mail::Box>     <false>              
+ folder      L<Mail::Box>     <from calling object>
+ folderdir   L<Mail::Box>     <from folder>        
+ skip_empty  L<Mail::Box>     <false>              
 
 . check BOOLEAN
 
@@ -456,8 +458,10 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box::POP3-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 See L<Mail::Box/"Sub-folders">
@@ -482,10 +486,20 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box::POP3-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+See L<Mail::Box/"Sub-folders">
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -493,6 +507,22 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDER, OPTIONS)
+
+Mail::Box::POP3-E<gt>B<create>(FOLDER, OPTIONS)
+
+=over 4
+
+It is not possible to create a new folder on a POP3 server.  This method
+will always return C<false>.
+
+ Option     Defined in    Default   
+ folderdir  L<Mail::Box>  <not used>
+
+. folderdir DIRECTORY
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -501,6 +531,14 @@
 
 =back
 
+Mail::Box::POP3-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Box/"Internals">
+
+=back
+
 $obj-E<gt>B<getHead>(MESSAGE)
 
 =over 4
@@ -640,9 +678,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::POP3-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::POP3-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -749,12 +787,6 @@
 
 =head1 DIAGNOSTICS
 
-I<Notice:> A POP3 folder cannot be deleted: it will be emptied.
-
-Each user has only one POP3 folder on a server.  This folder is created and
-deleted by the server's administrator only.  A delete can only remove the
-messages in the folder for you.
-
 I<Error:> Cannot create POP3 client for $name.
 
 The connection to the POP3 server cannot be established.  You may see
@@ -818,6 +850,11 @@
 of two messages with the same id.  The warning emerges when the C<@> is
 missing from the string.
 
+I<Warning:> POP3 folders cannot be deleted.
+
+Each user has only one POP3 folder on a server.  This folder is created and
+deleted by the server's administrator only.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -886,7 +923,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Parser::Perl;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Parser';
 
 use Mail::Message::Field;
@@ -154,7 +154,7 @@
     my @seps    = @{$self->{MBPP_separators}};
 
     my $file    = $self->{MBPP_file};
-    my @lines   = ();
+    my $lines   = [];
 
     if(@seps && $self->{MBPP_trusted})
     {   my $sep  = $seps[0];
@@ -171,7 +171,7 @@
                 last;
             }
 
-            push @lines, $line;
+            push @$lines, $line;
         }
     }
     elsif(@seps)
@@ -190,32 +190,31 @@
             }
 
             $line =~ s/\015$//;
-            push @lines, $line;
+            push @$lines, $line;
         }
     }
-    else
-    {   # File without separators.
-        @lines = $file->getlines;
+    else # File without separators.
+    {   $lines = ref $file eq 'Mail::Box::FastScalar' ? $file->getlines : [ $file->getlines ];
     }
 
     my $end = $file->tell;
     if($exp_lines > 0 )
-    {    while(@lines > $exp_lines && $lines[-1] =~ $empty)
-         {   $end -= length $lines[-1];
-             pop @lines;
+    {    while(@$lines > $exp_lines && $lines->[-1] =~ $empty)
+         {   $end -= length $lines->[-1];
+             pop @$lines;
          }
     }
-    elsif(@seps && @lines && $lines[-1] =~ $empty)
+    elsif(@seps && @$lines && $lines->[-1] =~ $empty)
     {   # blank line should be in place before a separator.  Only that
         # line is removed.
-        $end -= length $lines[-1];      
-        pop @lines;
+        $end -= length $lines->[-1];
+        pop @$lines;
     }
 
-    map { s/^\>(\>*From\s)/$1/ } @lines
+    map { s/^\>(\>*From\s)/$1/ } @$lines
         if $self->{MBPP_strip_gt};
 
-    $end, \@lines;
+    $end, $lines;
 }
 
 #------------------------------------------
@@ -261,7 +260,7 @@
     my $begin = $file->tell;
 
     my ($end, $lines) = $self->_read_stripped_lines($exp_chars, $exp_lines);
-    ($begin, $end, @$lines);
+    ($begin, $end, $lines);
 }
 
 #------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser/Perl.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -270,9 +270,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Parser::Perl-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Parser::Perl-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -423,7 +423,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Box::Parser;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 use Carp;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Parser.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -363,9 +363,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Parser-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Parser-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -509,7 +509,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Box::Search::Grep;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Search';
 
 use strict;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/Grep.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -238,9 +238,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Search::Grep-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Search::Grep-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -366,7 +366,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Box::Search::SpamAssassin;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Box::Search';
 
 use strict;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search/SpamAssassin.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -226,9 +226,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Search::SpamAssassin-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Search::SpamAssassin-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -354,7 +354,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Box::Search;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use strict;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Search.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -11,8 +11,8 @@
 
  Mail::Box::Search is extended by
    Mail::Box::Search::Grep
-   Mail::Box::Search::IMAP
    Mail::Box::Search::SpamAssassin
+   Mail::Server::IMAP4::Search
 
 
 =head1 SYNOPSIS
@@ -45,7 +45,7 @@
 
 Try to detect spam, using Mail::SpamAssassin.
 
-=item L<Mail::Box::Search::IMAP|Mail::Box::Search::IMAP>
+=item Mail::Box::Search::IMAP
 
 Search an IMAP folder for special interface IMAP folders provide for it.
 UNDER CONSTRUCTION till L<Mail::Transport::IMAP4|Mail::Transport::IMAP4> is complete.
@@ -289,9 +289,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Search-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Search-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -436,7 +436,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Thread::Manager;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Manager.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -293,7 +293,7 @@
 
 Get a replacement message to be used in threads.  Be warned that a
 dummy is not a member of any folder, so the program working with
-threads must test with L<Mail::Message::isDummy()|Mail::Message/"The Message"> before trying things only
+threads must test with L<Mail::Message::isDummy()|Mail::Message/"The message"> before trying things only
 available to real messages.
 
 =back
@@ -355,9 +355,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Thread::Manager-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Thread::Manager-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -568,7 +568,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Thread::Node;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Thread/Node.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -402,9 +402,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Thread::Node-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box::Thread::Node-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -530,7 +530,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Tie::ARRAY;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Carp;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/ARRAY.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -180,7 +180,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -2,7 +2,7 @@
 use strict;
 package Mail::Box::Tie::HASH;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Carp;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie/HASH.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -170,7 +170,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Box::Tie;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use strict;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box/Tie.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -51,7 +51,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Cookbook.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Cookbook.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Cookbook.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -271,7 +271,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Index.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Index.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Index.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -23,25 +23,10 @@
 <li><strong><a name="general">General</a> sources of information</strong>
   <ul>
   <li>MailBox distribution overview (Mail::Box-Overview)
-      <ul>
-      <li>Introduction
-      <li>The class relations
-      <li>The Manager
-      <li>The Messages
-      <li>The Folder types
-      <li>Various Other Classes
-      </ul>
   <li>MailBox simple recepies (Mail::Box-Cookbook)
-      <ul>
-      <li>The Manager
-      <li>Multi part messages
-      <li>Filter
-      <li>Create a reply
-      <li>Build a message
-      </ul>
   </ul>
 
-<li><strong><a name="messages">Messages</a></strong> (L<Mail::Message|Mail::Message>)
+<li><strong><a name="messages">Messages</a></strong> (L<Mail::Message|Mail::Message>)<br />
       See separate entries on header, body, fields
       and construction in this index below.
   <ul>
@@ -123,16 +108,14 @@
 <li><strong><a name="process">Message processing</a></strong>
   <ul>
   <li>Reading a message (Mail::Message::Construct::Read)
-  <li>Building a message (Mail::Message::Construct::Build)
+  <li>Building a message
+      (Mail::Message::Construct::Build)
   <li>Reply to a message (Mail::Message::Construct::Reply)
   <li>Creating a forward
+      (Mail::Message::Construct::Forward)
   <li>Bounce a message (Mail::Message::Construct::Bounce)
-  <li>Rebuilding a message (Mail::Message::Construct::Rebuild)
-      <ul>
-      <li>General rules
-      <li>Conversion rules
-      <li>Adding your own rules
-      </ul>
+  <li>Rebuilding a message
+      (Mail::Message::Construct::Rebuild)
   <li>Convert messages
       <ul>
       <li>To and from Mail::Internet objects (Mail::Message::Convert::MailInternet)
@@ -150,13 +133,17 @@
 <li><strong><a name="folders">Folders</a></strong> (L<Mail::Box|Mail::Box>)
       See separate section for type specifics below.
   <ul>
+  <li>Folder managers
+      <ul>
+      <li>Managing open folders (Mail::Box::Manager)
+      <li>Managing a user (Mail::Box::Manage::User)
+      </ul>
   <li>Folder types (Mail::Box)
       <ul>
       <li>Different kinds of folders
-      <li>Supported folder types
+      <li>Available folder types
       <li>Folder class implementation
       </ul>
-  <li>The folder manager (Mail::Box::Manager)
   <li>Folder tied as array (Mail::Box::Tie::ARRAY)
       <ul>
       <li>Limitations
@@ -245,6 +232,7 @@
       <li>Reducing the header size
           (Mail::Message::Head::Partial)
       <li>
+      </ul>
   <li>Destructing messages (Mail::Box::Message::Destructed)
   </ul>
 <li><strong>Additional modules</strong>
@@ -281,7 +269,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Overview.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Overview.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box-Overview.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -319,7 +319,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Box;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Box::Message;
@@ -136,7 +136,7 @@
           ( folder   => $self
           , method   => $args->{lock_type}
           , timeout  => $args->{lock_timeout}
-          , wait     => $args->{lock_wait}
+          , expires  => $args->{lock_wait}
           , file     => ($args->{lockfile} || $args->{lock_file})
           );
 
@@ -146,20 +146,12 @@
 #-------------------------------------------
 
 
-sub create($@) {shift->notImplemented}
-
-#-------------------------------------------
-
-
 sub folderdir(;$)
 {   my $self = shift;
     $self->{MB_folderdir} = shift if @_;
     $self->{MB_folderdir};
 }
 
-#-------------------------------------------
-
-
 sub foundIn($@) { shift->notImplemented }
 
 #-------------------------------------------
@@ -212,13 +204,14 @@
 #-------------------------------------------
 
 
-sub addMessage($)
+sub addMessage($@)
 {   my $self    = shift;
     my $message = shift or return $self;
+    my %args    = @_;
 
-    confess <<ERROR if $message->can('folder') && $message->folder;
+    confess <<ERROR if $message->can('folder') && defined $message->folder;
 You cannot add a message which is already part of a folder to a new
-one.  Please use moveMessage or copyMessage.
+one.  Please use moveTo or copyTo.
 ERROR
 
     # Force the message into the right folder-type.
@@ -244,6 +237,10 @@
     $coerced;
 }
 
+#-------------------------------------------
+
+
+
 sub addMessages(@)
 {   my $self = shift;
     map {$self->addMessage($_)} @_;
@@ -267,14 +264,15 @@
        :                            (1, 0);
 
     my $delete = $args{delete_copied} || 0;
+    my $share  = $args{share}         || 0;
 
-    $self->_copy_to($to, $select, $flatten, $recurse, $delete);
+    $self->_copy_to($to, $select, $flatten, $recurse, $delete, $share);
 }
 
 # Interface may change without warning.
 sub _copy_to($@)
 {   my ($self, $to, @options) = @_;
-    my ($select, $flatten, $recurse, $delete) = @options;
+    my ($select, $flatten, $recurse, $delete, $share) = @options;
 
     $self->log(ERROR => "Destination folder $to is not writable."),
         return unless $to->writable;
@@ -285,7 +283,8 @@
         "Copying ". at select." messages from $self to $to.");
 
     foreach my $msg (@select)
-    {   if($msg->copyTo($to)) { $msg->label(deleted => 1) if $delete }
+    {   if($msg->copyTo($to, share => $share))
+             { $msg->label(deleted => 1) if $delete }
         else { $self->log(ERROR => "Copying failed for one message.") }
     }
 
@@ -339,7 +338,8 @@
 
     # Inform manager that the folder is closed.
     my $manager = delete $self->{MB_manager};
-    $manager->close($self) if defined $manager && !$args{close_by_manager};
+    $manager->close($self, close_by_self =>1)
+        if defined $manager && !$args{close_by_manager};
 
     my $write;
     for($args{write} || 'MODIFIED')
@@ -364,15 +364,16 @@
                );
 
     $self->locker->unlock;
-    $self->{MB_messages} = [];    # Boom!
+    $self->{MB_messages} = [];                  # Boom!
     $rc;
 }
 
 #-------------------------------------------
 
 
-sub delete()
-{   my $self = shift;
+sub delete(@)
+{   my ($self, %args) = @_;
+    my $recurse = exists $args{recursive} ? $args{recursive} : 1;
 
     # Extra protection: do not remove read-only folders.
     unless($self->writable)
@@ -382,17 +383,15 @@
     }
 
     # Sub-directories need to be removed first.
-    foreach ($self->listSubFolders)
-    {   my $sub = $self->openRelatedFolder(folder => "$self/$_",access => 'rw');
-        next unless defined $sub;
-        $sub->delete;
+    if($recurse)
+    {   foreach ($self->listSubFolders)
+        {   my $sub = $self->openRelatedFolder
+               (folder => "$self/$_", access => 'd', create => 0);
+            defined $sub && $sub->delete(%args);
+        }
     }
 
-    $_->delete foreach $self->messages;
-
-    $self->{MB_remove_empty} = 1;
-    $self->close(write => 'ALWAYS');
-
+    $self->close(write => 'NEVER');
     $self;
 }
 
@@ -404,13 +403,18 @@
 #-------------------------------------------
 
 
-sub writable()  {shift->{MB_access} =~ /w|a/ }
+sub writable()  {shift->{MB_access} =~ /w|a|d/ }
 sub writeable() {shift->writable}  # compatibility [typo]
 sub readable()  {1}  # compatibility
 
 #-------------------------------------------
 
 
+sub access()    {shift->{MB_access}}
+
+#-------------------------------------------
+
+
 sub modified(;$)
 {   my $self = shift;
     return $self->isModified unless @_;   # compat 2.036
@@ -490,6 +494,8 @@
     }
 
     $self->{MB_msgid}{$msgid} = $message;
+    weaken($self->{MB_msgid}{$msgid});
+    $message;
 }
 
 sub messageID(@) {shift->messageId(@_)} # compatibility
@@ -505,6 +511,10 @@
     {   $msgid = $1;
         $msgid =~ s/\s//gs;
     }
+    else
+    {   # Illegal message-id
+        $msgid =~ s/\s/+/gs;
+    }
 
     $self->scanForMessages(undef, $msgid, 'EVER', 'ALL')
         unless exists $msgids->{$msgid};
@@ -549,6 +559,11 @@
 #-------------------------------------------
 
 
+sub nrMessages(@) { scalar shift->messages(@_) }
+
+#-------------------------------------------
+
+
 sub messageIds()    { map {$_->messageId} shift->messages }
 sub allMessageIds() {shift->messageIds}  # compatibility
 sub allMessageIDs() {shift->messageIds}  # compatibility
@@ -677,14 +692,20 @@
 #-------------------------------------------
 
 
-sub nameOfSubFolder($)
-{   my ($self, $name)= @_;
-    "$self/$name";
+sub nameOfSubFolder($;$)
+{   my ($thing, $name) = (shift, shift);
+    my $parent = @_ ? shift : ref $thing ? $thing->name : undef;
+    defined $parent ? "$parent/$name" : $name;
 }
 
 #-------------------------------------------
 
 
+sub topFolderWithMessages() { 1 }
+
+#-------------------------------------------
+
+
 sub read(@)
 {   my $self = shift;
     $self->{MB_open_time}    = time;
@@ -717,7 +738,7 @@
 {   my ($self, %args) = @_;
 
     unless($args{force} || $self->writable)
-    {   $self->log(ERROR => "Folder $self is opened read-only.\n");
+    {   $self->log(ERROR => "Folder $self is opened read-only.");
         return;
     }
 
@@ -807,15 +828,23 @@
 #-------------------------------------------
 
 
-sub coerce($)
-{   my ($self, $message) = @_;
-    $self->{MB_message_type}->coerce($message);
-}
+sub create($@) {shift->notImplemented}
 
+#-------------------------------------------
 
+
 #-------------------------------------------
 
 
+sub coerce($@)
+{   my ($self, $message) = (shift, shift);
+    my $mmtype = $self->{MB_message_type};
+    $message->isa($mmtype) ? $message : $mmtype->coerce($message, @_);
+}
+
+#-------------------------------------------
+
+
 sub readMessages(@) {shift->notImplemented}
 
 #-------------------------------------------
@@ -870,7 +899,7 @@
         :                $1 * 604800;  # week
     }
     else
-    {   $_[0]->log(ERROR => "Invalid timespan '$_' specified.\n");
+    {   $_[0]->log(ERROR => "Invalid timespan '$_' specified.");
         undef;
     }
 }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Box.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -127,29 +127,6 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-Mail::Box-E<gt>B<create>(FOLDERNAME, OPTIONS)
-
-=over 4
-
-Create a folder.  If the folder already exists, it will
-be left unchanged.  As options, you may specify:
-
- Option     Defined in  Default
- folderdir              undef  
-
-. folderdir DIRECTORY
-
-=over 4
-
-When the foldername is preceded by a C<=>, the C<folderdir> directory
-will be searched for the named folder.
-
-=back
-
-=back
-
 Mail::Box-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -195,16 +172,27 @@
 
 =over 4
 
-Access-rights to the folder. MODE can be read-only (C<"r">), append (C<"a">),
-and read-write (C<"rw">).  Folders are opened for read-only (C<"r">)
-(which means write-protected) by default!
+Access-rights to the folder.  Folders are opened for read-only (which
 
-These MODEs have no relation to the modes actually used to open the
-folder files within this module.  For instance, if you specify C<"rw">, and
+means write-protected) by default! MODE can be
+
+=over 4
+
+=item C<'r'>: read-only (default)
+
+=item C<'a'>: append
+
+=item C<'rw'>: read-write
+
+=item C<'d'>: delete
+=back
+
+These MODE has no relation to the modes actually used to open the folder
+files within this module.  For instance, if you specify C<"rw">, and
 open the folder, only read permission on the folder-file is required.
 
-Be warned: writing a MBOX folder may create a new file to replace the
-old folder.  The permissions and owner of the file get changed by this.
+Be warned: writing a MBOX folder may create a new file to replace the old
+folder.  The permissions and owner of the file may get changed by this.
 
 =back
 
@@ -272,7 +260,7 @@
 work when access is granted for writing or appending to the folder.
 
 Be careful: you may create a different folder type than you expect unless you
-explicitly specify L<Mail::Box::Manager::open(type)|Mail::Box::Manager/"Manage folders">.
+explicitly specify L<Mail::Box::Manager::open(type)|Mail::Box::Manager/"Manage open folders">.
 
 =back
 
@@ -442,7 +430,7 @@
 
 The type of the locker object.  This may be the full name of a CLASS
 which extends Mail::Box::Locker, or one of the known locker types
-C<DotLock>, C<File>, C<Multi>, C<NFS>, C<POSIX>, or C<NONE>.  If an
+C<DotLock>, C<Flock>, C<Multi>, C<NFS>, C<POSIX>, or C<NONE>.  If an
 ARRAY is specified, then a Multi locker is built which uses the specified
 list.
 
@@ -537,16 +525,10 @@
 =head2 The folder
 
 
-$obj-E<gt>B<addMessage>(MESSAGE)
+$obj-E<gt>B<addMessage>(MESSAGE, OPTIONS)
 
 =over 4
 
-=back
-
-$obj-E<gt>B<addMessages>(MESSAGE [, MESSAGE, ...])
-
-=over 4
-
 Add a message to the folder.  A message is usually a
 L<Mail::Box::Message|Mail::Box::Message> object or a sub-class thereof.  The message
 shall not be in an other folder, when you use this method.
@@ -555,6 +537,26 @@
 
 Messages with id's which already exist in this folder are not added.
 
+ Option  Defined in  Default   
+ share               <not used>
+
+. share BOOLEAN
+
+=over 4
+
+Try to share the physical resource of the current message with the
+indicated message.  It is sometimes possible to share messages between
+different folder types.  When the sharing is not possible, than this
+option is simply ignored.
+
+Sharing the resource is quite dangerous, and only available for a
+limited number of folder types, at the moment only some L<Mail::Box::Dir|Mail::Box::Dir>
+folders; these file-based messages can be hardlinked (on platforms that
+support it).  The link may get broken when one message is modified in one
+of the folders.... but maybe not, depending on the folder types involved.
+
+=back
+
 I<Example:> 
 
  $folder->addMessage($msg);
@@ -562,6 +564,19 @@
 
 =back
 
+$obj-E<gt>B<addMessages>(MESSAGE [, MESSAGE, ...])
+
+=over 4
+
+Adds a set of MESSAGE objects to the open folder at once.  For some folder
+types this may be faster than adding them one at a time.
+
+I<Example:> 
+
+ $folder->addMessages($msg1, $msg2, ...);
+
+=back
+
 Mail::Box-E<gt>B<appendMessages>(OPTIONS)
 
 =over 4
@@ -570,14 +585,16 @@
 Usually, this method is called by the L<Mail::Box::Manager::appendMessage()|Mail::Box::Manager/"Move messages to folders">,
 in which case the correctness of the folder type is checked.
 
-This method takes a list of labeled parameters, which may contain
-any option which can be used when a folder is opened, most importantly
-L<new(folderdir)|Mail::Box/"Constructors">.
+For some folder types it is required to open the folder before it can
+be used for appending.  This can be fast, but this can also be very
+slow (depends on the implementation).  All OPTIONS passed will also be
+used to open the folder, if needed.
 
  Option    Defined in       Default   
  folder                     <required>
  message                    undef     
  messages                   undef     
+ share                      <false>   
 
 . folder FOLDERNAME
 
@@ -601,6 +618,15 @@
 
 =back
 
+. share BOOLEAN
+
+=over 4
+
+Try to share physical storage of the message.  Only available for a
+limited number of folder types, otherwise no-op.
+
+=back
+
 I<Example:> 
 
  my $message = Mail::Message->new(...);
@@ -690,6 +716,7 @@
  Option         Defined in       Default                
  delete_copied                   <false>                
  select                          'ACTIVE'               
+ share                           <not used>             
  subfolders                      <folder type dependent>
 
 . delete_copied BOOLEAN
@@ -711,6 +738,15 @@
 
 =back
 
+. share BOOLEAN
+
+=over 4
+
+Try to share the message between the folders.  Some L<Mail::Box::Dir|Mail::Box::Dir>
+folder types do support it by creating a hardlink (on UNIX/Linux).
+
+=back
+
 . subfolders BOOLEAN|'FLATTEN'|'RECURSE'
 
 =over 4
@@ -736,71 +772,48 @@
 
 =back
 
-$obj-E<gt>B<delete>
+$obj-E<gt>B<delete>(OPTIONS)
 
 =over 4
 
 Remove the specified folder file or folder directory (depending on
 the type of folder) from disk.  Of course, THIS IS DANGEROUS: you "may"
-lose data.
+lose data.  Returns a C<true> value on success.
 
 WARNING: When moving messages from one folder to another, be sure to write the
 destination folder before deleting the source folder.  Otherwise you may lose
 data if the system crashes or if there are software problems.
 
-I<Example:> 
+ Option     Defined in  Default
+ recursive              1      
 
- my $folder = Mail::Box::Mbox->new(folder => 'InBox');
- $folder->delete;
+. recursive BOOLEAN
 
-=back
+I<Example:> removing an open folder
 
-$obj-E<gt>B<folderdir>([DIRECTORY])
 
-=over 4
+ my $folder = Mail::Box::Mbox->new(folder => 'InBox', access => 'rw');
+ ... some other code ...
+ $folder->delete;
 
-Get or set the DIRECTORY which is used to store mail-folders by default.
+I<Example:> removing an closed folder
 
-I<Example:> 
 
- print $folder->folderdir;
- $folder->folderdir("$ENV{HOME}/nsmail");
+ my $folder = Mail::Box::Mbox->new(folder => 'INBOX', access => 'd');
+ $folder->delete;
 
 =back
 
-Mail::Box-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+$obj-E<gt>B<folderdir>([DIRECTORY])
 
 =over 4
 
-Determine if the specified folder is of the type handled by the
-folder class. This method is extended by each folder sub-type.
+Get or set the DIRECTORY which is used to store mail-folders by default.
 
-The FOLDERNAME specifies the name of the folder, as is specified by the
-application.  You need to specified the C<folder> option when you skip
-this first argument.
-
-OPTIONS is a list of extra information for the request.  Read
-the documentation for each type of folder for type specific options, but
-each folder class will at least support the C<folderdir> option:
-
- Option     Defined in  Default
- folderdir              undef  
-
-. folderdir DIRECTORY
-
-=over 4
-
-The location where the folders of this class are stored by default.  If the
-user specifies a name starting with a C<=>, that indicates that the folder is
-to be found in this default DIRECTORY.
-
-=back
-
 I<Example:> 
 
- Mail::Box::Mbox->foundIn('=markov',
-     folderdir => "$ENV{HOME}/Mail");
- Mail::Box::MH->foundIn(folder => '=markov');
+ print $folder->folderdir;
+ $folder->folderdir("$ENV{HOME}/nsmail");
 
 =back
 
@@ -867,7 +880,7 @@
 =over 4
 
 Represent the folder as a URL (Universal Resource Locator) string.  You may
-pass such a URL as folder name to L<Mail::Box::Manager::open()|Mail::Box::Manager/"Manage folders">.
+pass such a URL as folder name to L<Mail::Box::Manager::open()|Mail::Box::Manager/"Manage open folders">.
 
 I<Example:> 
 
@@ -881,6 +894,14 @@
 =head2 Folder flags
 
 
+$obj-E<gt>B<access>
+
+=over 4
+
+Returns the access mode of the folder, as set by L<new(access)|Mail::Box/"Constructors">
+
+=back
+
 $obj-E<gt>B<isModified>
 
 =over 4
@@ -992,14 +1013,16 @@
 existing message whose message ID is MESSAGE-ID. (The message ID of MESSAGE
 need not match MESSAGE-ID.)
 
+!!WARNING!!: when the message headers are delay-parsed, the message
+might be in the folder but not yet parsed into memory. In this case, use
+L<find()|Mail::Box/"The messages"> instead of C<messageId()> if you really need a thorough search.
+This is especially the case for directory organized folders without
+special indexi, like L<Mail::Box::MH|Mail::Box::MH>.
+
 The MESSAGE-ID may still be in angles, which will be stripped.  In that
 case blanks (which origin from header line folding) are removed too.  Other
 info around the angles will be removed too.
 
-WARNING: when the message headers are delay-parsed, the message might be in
-the folder but not yet parsed into memory. In this case, use L<find()|Mail::Box/"The messages">
-instead of C<messageId()> if you really need a thorough search.
-
 I<Example:> 
 
  my $msg = $folder->messageId('<complex-message.id>');
@@ -1079,6 +1102,15 @@
 
 =back
 
+$obj-E<gt>B<nrMessages>(OPTIONS)
+
+=over 4
+
+Simply calls L<messages()|Mail::Box/"The messages"> in scalar context to return a count instead
+of the messages itself.  Some people seem to understand this better.
+
+=back
+
 $obj-E<gt>B<scanForMessages>(MESSAGE, MESSAGE-IDS, TIMESPAN, WINDOW)
 
 =over 4
@@ -1140,11 +1172,11 @@
 
 For MBOX folders, sub-folders are simulated.
 
- Option      Defined in       Default      
- check                        <false>      
- folder                       <required>   
- folderdir                    <from folder>
- skip_empty                   <false>      
+ Option      Defined in       Default              
+ check                        <false>              
+ folder                       <from calling object>
+ folderdir                    <from folder>        
+ skip_empty                   <false>              
 
 . check BOOLEAN
 
@@ -1186,13 +1218,28 @@
 
 =back
 
-$obj-E<gt>B<nameOfSubFolder>(NAME)
+$obj-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
 
+Mail::Box-E<gt>B<nameOfSubFolder>(SUBNAME, [PARENTNAME])
+
 =over 4
 
 Returns the constructed name of the folder with NAME, which is a
-sub-folder of this current one.
+sub-folder of this current one.  You have either to call this method
+as instance method, or specify a PARENTNAME.
 
+I<Example:> how to get the name of a subfolder
+
+
+ my $sub = Mail::Box::Mbox->nameOfSubfolder('xyz', 'abc');
+ print $sub;                        # abc/xyz
+
+ my $f = Mail::Box::Mbox->new(folder => 'abc');
+ print $f->nameOfSubfolder('xyz');  # abc/xyz
+
+ my $sub = Mail::Box::Mbox->nameOfSubfolder('xyz', undef);
+ print $sub;                        # xyz
+
 =back
 
 $obj-E<gt>B<openRelatedFolder>(OPTIONS)
@@ -1206,7 +1253,7 @@
 
 =back
 
-$obj-E<gt>B<openSubFolder>(NAME, OPTIONS)
+$obj-E<gt>B<openSubFolder>(SUBNAME, OPTIONS)
 
 =over 4
 
@@ -1220,10 +1267,21 @@
 
 =back
 
+$obj-E<gt>B<topFolderWithMessages>
+
+Mail::Box-E<gt>B<topFolderWithMessages>
+
+=over 4
+
+Some folder types can have messages in the top-level folder, some other
+can't.
+
+=back
+
 =head2 Internals
 
 
-$obj-E<gt>B<coerce>(MESSAGE)
+$obj-E<gt>B<coerce>(MESSAGE, OPTIONS)
 
 =over 4
 
@@ -1233,6 +1291,31 @@
 
 =back
 
+$obj-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+Mail::Box-E<gt>B<create>(FOLDERNAME, OPTIONS)
+
+=over 4
+
+Create a folder.  If the folder already exists, it will be left unchanged.
+The folder is created, but not opened!  If you want to open a file which
+may need to be created, then use L<Mail::Box::Manager::open()|Mail::Box::Manager/"Manage open folders"> with the
+create flag, or L<Mail::Box::new(create)|Mail::Box/"Constructors">.
+
+ Option     Defined in  Default
+ folderdir              undef  
+
+. folderdir DIRECTORY
+
+=over 4
+
+When the foldername is preceded by a C<=>, the C<folderdir> directory
+will be searched for the named folder.
+
+=back
+
+=back
+
 $obj-E<gt>B<determineBodyType>(MESSAGE, HEAD)
 
 =over 4
@@ -1242,6 +1325,42 @@
 
 =back
 
+Mail::Box-E<gt>B<foundIn>([FOLDERNAME], OPTIONS)
+
+=over 4
+
+Determine if the specified folder is of the type handled by the
+folder class. This method is extended by each folder sub-type.
+
+The FOLDERNAME specifies the name of the folder, as is specified by the
+application.  You need to specified the C<folder> option when you skip
+this first argument.
+
+OPTIONS is a list of extra information for the request.  Read
+the documentation for each type of folder for type specific options, but
+each folder class will at least support the C<folderdir> option:
+
+ Option     Defined in  Default
+ folderdir              undef  
+
+. folderdir DIRECTORY
+
+=over 4
+
+The location where the folders of this class are stored by default.  If the
+user specifies a name starting with a C<=>, that indicates that the folder is
+to be found in this default DIRECTORY.
+
+=back
+
+I<Example:> 
+
+ Mail::Box::Mbox->foundIn('=markov',
+     folderdir => "$ENV{HOME}/Mail");
+ Mail::Box::MH->foundIn(folder => '=markov');
+
+=back
+
 $obj-E<gt>B<lineSeparator>([STRING|'CR'|'LF'|'CRLF'])
 
 =over 4
@@ -1446,9 +1565,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Box-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -1693,7 +1812,7 @@
 
 =back
 
-=head2 Supported folder types
+=head2 Available folder types
 
 =over 4
 
@@ -1707,8 +1826,13 @@
 therefore not by MailBox. Read access is enough to do folder conversions,
 for instance.
 
-=item * L<Mail::Box::IMAP4|Mail::Box::IMAP4> (under development)
+=item * L<Mail::Box::IMAP4|Mail::Box::IMAP4> (partially)
 
+The IMAP protocol is very complex.  Some parts are implemented to
+create (sub-optimal but usable) IMAP clients.  Besides, there are
+also some parts for IMAP servers present.  The most important lacking
+feature is support for encrypted connections.
+
 =item * L<Mail::Box::Maildir|Mail::Box::Maildir>
 
 Maildir folders have a directory for each folder.  A folder directory
@@ -1741,6 +1865,12 @@
 messages can be looked at and removed as if they are on the local
 system.
 
+=item * Mail::Box::Netzwert
+
+The Netzwert folder type is optimized for mailbox handling on a cluster
+of systems with a shared NFS storage.  The code is not released under
+GPL (yet)
+
 =back
 
 Other folder types are on the (long) wishlist to get implemented.  Please,
@@ -1752,11 +1882,12 @@
 instance, a L<Mail::Box::File::Message|Mail::Box::File::Message> relates to a L<Mail::Box::File|Mail::Box::File>
 folder.  The folder types are:
 
- Mail::Box::Mbox    Mail::Box::Maildir  Mail::Box::POP3
- |  Mail::Box::Dbx  |  Mail::Box::MH    |  Mail::Box::IMAP4
- |  |               |  |                |  |
- |  |               |  |                |  |
- Mail::Box::File    Mail::Box::Dir      Mail::Box::Net
+                    Mail::Box::Netzwert
+ Mail::Box::Mbox   | Mail::Box::Maildir Mail::Box::POP3
+ |  Mail::Box::Dbx | | Mail::Box::MH    |  Mail::Box::IMAP4
+ |  |               | | |                 |  |
+ |  |               | | |                 |  |
+ Mail::Box::File   Mail::Box::Dir       Mail::Box::Net
        |                  |                   |
        `--------------.   |   .---------------'
                       |   |   |
@@ -1780,7 +1911,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -5,7 +5,7 @@
 
 package Mail::Message::Body;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Carp;
 use Mail::Message::Body::String;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Construct.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -34,7 +34,7 @@
 
 The message-parts will be coerced into a L<Mail::Message::Part|Mail::Message::Part>, so you
 may attach Mail::Internet or MIME::Entity objects if you want --see
-L<Mail::Message::coerce()|Mail::Message/"Constructors">.  A new body with attached messages is
+L<Mail::Message::coerce()|Mail::Message/"Internals">.  A new body with attached messages is
 returned.
 
 I<Example:> 
@@ -181,7 +181,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body::Delayed;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Object::Realize::Later

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Delayed.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -145,7 +145,7 @@
 =head2 Internals
 
 
-$obj-E<gt>B<fileLocation>(BEGIN, END)
+$obj-E<gt>B<fileLocation>([BEGIN, END])
 
 =over 4
 
@@ -190,9 +190,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body::Delayed-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body::Delayed-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -318,7 +318,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::Body;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Carp;
@@ -163,8 +163,8 @@
 #------------------------------------------
 
 
-sub dispositionFilename($)
-{   my ($self, $dir) = @_;
+sub dispositionFilename(;$)
+{   my $self = shift;
     my $raw;
 
     my $field;
@@ -180,6 +180,9 @@
              || $field->attribute('name');
     }
 
+    return $raw unless @_;
+
+    my $dir      = shift;
     my $filename = '';
     if(defined $raw)
     {   $filename = basename $raw;
@@ -196,6 +199,7 @@
         }
         $filename = "$unique.$ext";
     }
+
     File::Spec->catfile($dir, $filename);
 }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Encode.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -149,13 +149,14 @@
 =head2 About the payload
 
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
 Returns the name which can be used as filename to store the information
 in the indicated DIRECTORY. To get a filename, various fields are searched
-for C<filename> and C<name> attributes.
+for C<filename> and C<name> attributes.  Without DIRECTORY, the name found
+will be returned.
 
 Only the basename of the found name will be used, for security reasons:
 otherwise, it may be possible to access other directories than the
@@ -236,7 +237,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body::File;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Body';
 
 use Mail::Box::Parser;
@@ -28,7 +28,7 @@
 
     my $file   = $self->tempFilename;
     unless(open OUT, '>', $file)
-    {   $self->log(ERROR => "Cannot write to temporary body file $file: $!\n");
+    {   $self->log(ERROR => "Cannot write to temporary body file $file: $!");
         return;
     }
 
@@ -50,7 +50,7 @@
     local *OUT;
 
     unless(open OUT, '>', $file)
-    {   $self->log(ERROR => "Cannot write to temporary body file $file: $!\n");
+    {   $self->log(ERROR => "Cannot write to temporary body file $file: $!");
         return;
     }
 
@@ -73,7 +73,7 @@
     local *OUT;
 
     unless(open OUT, '>', $file)
-    {   $self->log(ERROR => "Cannot write to temporary body file $file: $!\n");
+    {   $self->log(ERROR => "Cannot write to temporary body file $file: $!");
         return;
     }
 
@@ -94,7 +94,7 @@
     local *OUT;
 
     unless(open OUT, '>', $file)
-    {   $self->log(ERROR => "Cannot write to $file: $!\n");
+    {   $self->log(ERROR => "Cannot write to $file: $!");
         return;
     }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/File.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -268,7 +268,7 @@
 
 =back
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
@@ -495,9 +495,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body::File-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body::File-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -648,7 +648,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body::Lines;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Body';
 
 use Mail::Box::Parser;
@@ -31,7 +31,8 @@
 
 sub _data_from_filehandle(@)
 {   my ($self, $fh) = @_;
-    $self->{MMBL_array} = [ $fh->getlines ];
+    $self->{MMBL_array} =
+       ref $fh eq 'Mail::Box::FastScalar' ? $fh->getlines : [ $fh->getlines ];
     $self
 }
 
@@ -120,11 +121,11 @@
 
 sub read($$;$@)
 {   my ($self, $parser, $head, $bodytype) = splice @_, 0, 4;
-    my @lines = $parser->bodyAsList(@_);
-    return undef unless @lines;
+    my ($begin, $end, $lines) = $parser->bodyAsList(@_);
+    $lines or return undef;
 
-    $self->fileLocation(shift @lines, shift @lines);
-    $self->{MMBL_array} = \@lines;
+    $self->fileLocation($begin, $end);
+    $self->{MMBL_array} = $lines;
     $self;
 }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Lines.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -269,7 +269,7 @@
 
 =back
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
@@ -488,9 +488,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body::Lines-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body::Lines-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -634,7 +634,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body::Multipart;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Body';
 
 use Mail::Message::Body::Lines;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Multipart.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -377,7 +377,7 @@
 
 =back
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
@@ -666,9 +666,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body::Multipart-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body::Multipart-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -817,7 +817,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body::Nested;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Body';
 
 use Mail::Message::Body::Lines;
@@ -36,7 +36,7 @@
 
 #------------------------------------------
 
-sub isBinary() {shift->nested->body->isBinary}
+sub isBinary() { shift->nested->body->isBinary }
 
 #------------------------------------------
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/Nested.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -295,7 +295,7 @@
 
 =back
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
@@ -532,9 +532,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body::Nested-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body::Nested-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -673,7 +673,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body::String;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Body';
 
 use Carp;
@@ -36,9 +36,16 @@
 
 sub _data_from_filehandle(@)
 {   my ($self, $fh) = @_;
-    my @lines = $fh->getlines;
-    $self->{MMBS_nrlines} = @lines;
-    $self->{MMBS_scalar}  = join '', @lines;
+    if(ref $fh eq 'Mail::Box::FastScalar')
+    {   my $lines = $fh->getlines;
+        $self->{MMBS_nrlines} = @$lines;
+        $self->{MMBS_scalar}  = join '', @$lines;
+    }
+    else
+    {    my @lines = $fh->getlines;
+         $self->{MMBS_nrlines} = @lines;
+         $self->{MMBS_scalar}  = join '', @lines;
+    }
     $self;
 }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body/String.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -270,7 +270,7 @@
 
 =back
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
@@ -489,9 +489,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body::String-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body::String-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -635,7 +635,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Body;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Message::Field;
@@ -11,7 +11,8 @@
 use Mail::Message::Body::File;
 
 use Carp;
-use Scalar::Util 'weaken';
+use Scalar::Util     'weaken';
+use File::Basename   'basename';
 
 use MIME::Types;
 my $mime_types = MIME::Types->new;
@@ -93,12 +94,10 @@
       = @$args{ qw/mime_type transfer_encoding disposition charset/ };
 
     if(defined $filename)
-    {   unless(defined $disp)
-        {   $disp = Mail::Message::Field->new
-              ('Content-Disposition' => (-T $filename ? 'inline':'attachment'));
-            (my $abbrev = $filename) =~ s!.*[/\\]!!;
-            $disp->attribute(filename => $abbrev);
-        }
+    {   $disp = Mail::Message::Field->new
+           ('Content-Disposition' => (-T $filename ? 'inline':'attachment')
+           , filename => basename($filename)
+           ) unless defined $disp;
 
         unless(defined $mime)
         {   $mime = $mime_types->mimeTypeOf($filename);
@@ -184,7 +183,7 @@
     elsif($eol eq 'LF')    {s/[\015\012]+$/\012/     foreach @$lines}
     elsif($eol eq 'CRLF')  {s/[\015\012]+$/\015\012/ foreach @$lines}
     else
-    {   carp "Unknown line terminator $eol ignored.";
+    {   $self->log(WARNING => "Unknown line terminator $eol ignored.");
         return $self->eol('NATIVE');
     }
 
@@ -279,6 +278,7 @@
     return $self->{MMB_disposition} if !@_ && $self->{MMB_disposition};
 
     my $disp = defined $_[0] ? shift : 'none';
+
     $self->{MMB_disposition} = ref $disp ? $disp->clone
        : Mail::Message::Field->new('Content-Disposition' => $disp);
 }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Body.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -497,7 +497,7 @@
 
 =back
 
-$obj-E<gt>B<dispositionFilename>(DIRECTORY)
+$obj-E<gt>B<dispositionFilename>([DIRECTORY])
 
 =over 4
 
@@ -856,9 +856,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Body-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Body-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -1088,7 +1088,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,10 +3,11 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Mail::Message::Head::Complete;
 use Mail::Message::Field;
+use Carp         qw/croak/;
 
 
 sub bounce(@)
@@ -19,19 +20,22 @@
          return $bounce;
     }
 
-    my @rgs    = $head->resentGroups;  # No groups yet, then require Received
+    my @rgs    = $head->resentGroups;
     my $rg     = $rgs[0];
 
     if(defined $rg)
-    {   $rg->delete;     # Remove group to re-add it later: others field order
-        while(@_)        #  in header would be disturbed.
+    {   $rg->delete;     # Remove group to re-add it later: otherwise
+        while(@_)        #   field order in header would be disturbed.
         {   my $field = shift;
             ref $field ? $rg->set($field) : $rg->set($field, shift);
         }
     }
-    else
+    elsif(@_)
     {   $rg = Mail::Message::Head::ResentGroup->new(@_);
     }
+    else
+    {   croak "ERROR: bounce requires To, Cc, or Bcc";
+    }
  
     #
     # Add some nice extra fields.
@@ -46,6 +50,13 @@
     }
 
     $head->addResentGroup($rg);
+
+    #
+    # Flag action to original message
+    #
+
+    $self->label(passed => 1);    # used by some maildir clients
+
     $bounce;
 }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Bounce.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -62,18 +62,28 @@
 
 
 
+=head1 DIAGNOSTICS
 
+I<Error:> bounce requires To, Cc, or Bcc
 
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
 
 
 
+
+
+
 =head1 REFERENCES
 
 See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,33 +3,41 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
-use Mail::Message::Head::Complete;
-use Mail::Message::Body::Lines;
-use Mail::Message::Body::Multipart;
-use Mail::Message::Field;
+use Mail::Message::Head::Complete  ();
+use Mail::Message::Body::Lines     ();
+use Mail::Message::Body::Multipart ();
+use Mail::Message::Body::Nested    ();
+use Mail::Message::Field           ();
 
-use Mail::Address;
-use Carp;
-use Scalar::Util 'blessed';
-use IO::Lines;
+use Mail::Address  ();
 
 
 sub build(@)
 {   my $class = shift;
 
+    if($class->isa('Mail::Box::Message'))
+    {   $class->log(ERROR
+           => "Only build() Mail::Message's; they are not in a folder yet"); 
+         return undef;
+    }
+
     my @parts
       = ! ref $_[0] ? ()
       : $_[0]->isa('Mail::Message')       ? shift
       : $_[0]->isa('Mail::Message::Body') ? shift
       :               ();
 
-    my ($head, $type, @headerlines);
+    my ($head, @headerlines);
+    my ($type, $transfenc, $dispose);
     while(@_)
     {   my $key = shift;
         if(ref $key && $key->isa('Mail::Message::Field'))
-        {   if($key->name eq 'content-type') { $type = $key }
+        {   my $name = $key->name;
+               if($name eq 'content-type')              { $type      = $key }
+            elsif($name eq 'content-transfer-encoding') { $transfenc = $key }
+            elsif($name eq 'content-disposition')       { $dispose   = $key }
             else { push @headerlines, $key }
             next;
         }
@@ -48,13 +56,24 @@
         elsif($key eq 'files')
         {   @data = map {Mail::Message::Body->new(file => $_) } @$value }
         elsif($key eq 'attach')
-        {   @data = ref $value eq 'ARRAY' ? @$value : $value }
-        elsif(lc $key eq 'content-type')
-        {   $type = Mail::Message::Field->new($key, $value) }
+        {   foreach my $c (ref $value eq 'ARRAY' ? @$value : $value)
+	    {   push @data, $c->isa('Mail::Message')
+		          ? Mail::Message::Body::Nested->new(nested => $c)
+			  : $c;
+            }
+	}
+        elsif($key =~ m/^content\-(type|transfer\-encoding|disposition)$/i )
+        {   my $k     = lc $1;
+            my $field = Mail::Message::Field->new($key, $value);
+               if($k eq 'type') { $type = $field }
+            elsif($k eq 'disposition' ) { $dispose = $field }
+            else { $transfenc = $field }
+        }
         elsif($key =~ m/^[A-Z]/)
         {   push @headerlines, $key, $value }
         else
-        {   croak "Skipped unknown key $key in build." } 
+        {   $class->log(WARNING => "Skipped unknown key $key in build");
+        }
 
         push @parts, grep {defined $_} @data if @data;
     }
@@ -66,6 +85,8 @@
 
     # Setting the type explicitly, only after the body object is finalized
     $body->type($type) if defined $type;
+    $body->disposition($dispose) if defined $dispose;
+    $body->transferEncoding($transfenc) if defined $transfenc;
 
     $class->buildFromBody($body, $head, @headerlines);
 }
@@ -109,4 +130,7 @@
     $message;
 }
 
+#------------------------------------------
+
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Build.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -27,11 +27,11 @@
 =head2 Constructing a message
 
 
-Mail::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
-Simplified message object builder.  In case a MESSAGE is
+Simplified message object builder.  In case a MESSAGE or message PART is
 specified, a new message is created with the same body to start with, but
 new headers.  A BODY may be specified as well.  However, there are more
 ways to add data simply.
@@ -41,13 +41,13 @@
 fields are used for other purposes as listed below.  Each field may be used
 more than once.  Pairs where the value is C<undef> are ignored.
 
-If more than one C<data>, C<file>, and C<attach> is specified, a multi-parted
-message is created.  The C<Content-Type> field is treated separately: to
-set the type of the produced message body after it has been created.  For
-instance, to explicitly state that you wish a C<multipart/alternative>
-in stead of the default C<multipart/mixed>.  If
-you wish to specify the type per datum, you need to start playing with
-L<Mail::Message::Body|Mail::Message::Body> objects yourself.
+If more than one C<data>, C<file>, and C<attach> is specified,
+a multi-parted message is created.  Some C<Content-> fields are
+treated separately: to enforce the content lines of the produced
+message body B<after> it has been created.  For instance, to explicitly
+state that you wish a C<multipart/alternative> in stead of the default
+C<multipart/mixed>.  If you wish to specify the type per datum, you need
+to start playing with L<Mail::Message::Body|Mail::Message::Body> objects yourself.
 
 This C<build> method will use L<buildFromBody()|Mail::Message::Construct::Build/"Constructing a message"> when the body object has
 been constructed.  Together, they produce your message.
@@ -59,14 +59,18 @@
  files                    C<[ ]> 
  head                     undef  
 
-. attach BODY|MESSAGE|ARRAY-OF-BODY
+. attach BODY|PART|MESSAGE|ARRAY
 
 =over 4
 
-One attachment to the message.  Each attachment can be full MESSAGE or a BODY.
+One attachment to the message.  Each attachment can be full MESSAGE, a
+PART, or a BODY.
+Any MESSAGE will get encapsulated into a C<message/rfc822> body.
+You can specify many items (may be of different types) at once.
 
  attach => $folder->message(3)->decoded  # body
  attach => $folder->message(3)           # message
+ attach => [ $msg1, $msg2->part(6), $msg3->body ];
 
 =back
 
@@ -183,18 +187,155 @@
 
 
 
+=head1 DIAGNOSTICS
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
 
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
 
 
+=head1 DETAILS
 
+
+=head2 Building a message
+
+
+=head3 Rapid building
+
+Most messages you need to construct are relatively simple.  Therefore,
+this module provides a method to prepare a message with only one method
+call: L<build()|Mail::Message::Construct::Build/"Constructing a message">.
+
+=head3 Compared to MIME::Entity::build()
+
+The C<build> method in MailBox is modelled after the C<build> method
+as provided by MIMETools, but with a few simplifications:
+
+=over 4
+
+=item When a keys starts with a capital, than it is always a header field
+
+=item When a keys is lower-cased, it is always something else
+
+=item You use the real field-names, not abbreviations
+
+=item All field names are accepted
+
+=item You may specify field objects between key-value pairs
+
+=item A lot of facts are auto-detected, like content-type and encoding
+
+=item You can create a multipart at once
+
+=back
+
+Hum, reading the list above... what is equivalent?  L<MIME::Entity> is
+not that simple after all!  Let's look at an example from MIME::Entity's
+manual page:
+
+ ### Create the top-level, and set up the mail headers:
+ $top = MIME::Entity->build(Type     => "multipart/mixed",
+                            From     => 'me at myhost.com',
+                            To       => 'you at yourhost.com',
+                            Subject  => "Hello, nurse!");
+                                                                                
+ ### Attachment #1: a simple text document:
+ $top->attach(Path=>"./testin/short.txt");
+                                                                                
+ ### Attachment #2: a GIF file:
+ $top->attach(Path        => "./docs/mime-sm.gif",
+              Type        => "image/gif",
+              Encoding    => "base64");
+                                                                                
+ ### Attachment #3: text we'll create with text we have on-hand:
+ $top->attach(Data => $contents);
+                                                                                
+The MailBox equivalent could be
+
+ my $msg = Mail::Message->build
+   ( From     => 'me at myhost.com'
+   , To       => 'you at yourhost.com'
+   , Subject  => "Hello, nurse!"
+
+   , file     => "./testin/short.txt"
+   , file     => "./docs/mime-sm.gif"
+   , data     => $contents
+   );
+
+One of the simplifications is that L<MIME::Types|MIME::Types> is used to lookup
+the right content type and optimal transfer encoding.  Good values
+for content-disposition and such are added as well.
+
+=head3 build, starting with nothing
+
+See L<build()|Mail::Message::Construct::Build/"Constructing a message">.
+
+=head3 buildFromBody, body becomes message
+
+See L<buildFromBody()|Mail::Message::Construct::Build/"Constructing a message">.
+
+=head3 The Content-* fields
+
+The various C<Content-*> fields are not as harmless as they look.  For
+instance, the "Content-Type" field will have an effect on the default
+transfer encoding.
+
+When a message is built this way:
+
+ my $msg = Mail::Message->build
+  ( 'Content-Type' => 'video/mpeg3'
+  , 'Content-Transfer-Encoding' => 'base64'
+  , 'Content-Disposition' => 'attachment'
+  , file => '/etc/passwd'
+  );
+
+then first a C<text/plain> body is constructed (MIME::Types does not
+find an extension on the filename so defaults to C<text/plain>), with
+no encoding.  Only when that body is ready, the new type and requested
+encodings are set.  The content of the body will get base64 encoded,
+because it is requested that way.
+
+What basically happens is this:
+
+ my $head = ...other header lines...;
+ my $body = Mail::Message::Body::Lines->new(file => '/etc/passwd');
+ $body->type('video/mpeg3');
+ $body->transferEncoding('base64');
+ $body->diposition('attachment');
+ my $msg  = Mail::Message->buildFromBody($body, $head);
+ 
+A safer way to construct the message is:
+
+ my $body = Mail::Message::Body::Lines->new
+  ( file              => '/etc/passwd'
+  , mime_type         => 'video/mpeg3'
+  , transfer_encoding => 'base64'
+  , disposition       => 'attachment'
+  );
+
+ my $msg  = Mail::Message->buildFromBody
+  ( $body
+  , ...other header lines...
+  );
+
+In the latter program, you will immediately start with a body of
+the right type.
+
+
+
+
+
 =head1 REFERENCES
 
 See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Mail::Message::Body::Multipart;
 use Mail::Message::Body::Nested;
@@ -90,6 +90,7 @@
 
     # Ready
 
+    $self->label(passed => 1);
     $self->log(PROGRESS => "Forward created from $origid");
     $forward;
 }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Forward.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -144,8 +144,7 @@
 
 It is only possible to inline textual messages, therefore binary or
 multi-part messages will always be enclosed as attachment.
-Read the details about this choice in section L</Creating a forward>
-subsection L</Including the original message>.
+Read the details in section L</Creating a forward>..
 
 =back
 
@@ -384,9 +383,6 @@
 
 =head2 Creating a forward
 
-
-=head3 Including the original message
-
 The main difference between L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> and L<forward()|Mail::Message::Construct::Forward/"Constructing a message"> is the reason
 for message processing.  The I<bounce> has no intention to modify the
 content of message: the same information is passed-on to someplace else.
@@ -400,18 +396,20 @@
 
 So: some information comes in, is modified, and than forwarded to someone
 else.  Currently, there are four ways to get the original information
-included:
+included, which are explained in the next sections.
 
-=over 4
+After the creation of the forward, you may want to L<rebuild()|Mail::Message::Construct::Rebuild/"Constructing a message"> the
+message to remove unnecessary complexities.  Of course, that is not
+required.
 
-=item * specify a body
+=head3 forward, specify a body
 
 When you specify L<forward(body)|Mail::Message::Construct::Forward/"Constructing a message">, you have created your own body object to
 be used as content of the forwarded message.  This implies that
 L<forward(include)|Mail::Message::Construct::Forward/"Constructing a message"> is C<'NO'>: no automatic generation of the forwarded
 body.
 
-=item * inline the original
+=head3 forward, inline the original
 
 The L<forward(include)|Mail::Message::Construct::Forward/"Constructing a message"> is set to C<'INLINE'> (the default)
 This is the most complicated situation, but most often used by MUAs:
@@ -427,7 +425,7 @@
 When a binary message is encountered, inlining is impossible.  In that
 case, the message is treated as if C<'ENCAPSULATE'> was requested.
 
-=item * attach the original
+=head3 forward, attach the original
 
 When L<forward(include)|Mail::Message::Construct::Forward/"Constructing a message"> is explicitly set to C<'ATTACH'> the result
 will be a multipart which contains two parts.  The first part will
@@ -454,7 +452,7 @@
      text/plain: content in raw text
      text/html: content as html
 
-=item * encapsulate the original
+=head3 forward, encapsulate the original
 
 When L<forward(include)|Mail::Message::Construct::Forward/"Constructing a message"> is explicitly set to C<'ENCAPSULATE'>, then
 the original message is left in-tact as good as possible.  The lines
@@ -482,23 +480,17 @@
 This is probably the reason why many MUAs use this when the forward
 an original message as attachment.
 
-=back
 
-After the creation of the forward, you may want to L<rebuild()|Mail::Message::Construct::Rebuild/"Constructing a message"> the
-message to remove unnecessary complexities.  Of course, that is not
-required.
 
 
 
-
-
 =head1 REFERENCES
 
 See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Mail::Box::FastScalar;
 
@@ -38,7 +38,8 @@
         $file     = Mail::Box::FastScalar->new(\$buffer);
     }
     else
-    {   croak "Cannot read from $from";
+    {   $class->log(ERROR => "Cannot read from $from");
+        return undef;
     }
 
     my $strip_status = exists $args{strip_status_fields}

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Read.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -109,7 +109,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Mail::Message::Head::Complete;
 use Mail::Message::Body::Lines;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Rebuild.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -296,7 +296,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Mail::Message::Body::Multipart;
 use Mail::Address;
@@ -84,8 +84,14 @@
     {   my $reply = $mainhead->get('reply-to');
         $to       = [ $reply->addresses ] if defined $reply;
     }
-    $to  ||= $self->sender || return;
 
+    unless(defined $to)
+    {   my @from  = $self->from;
+        $to     ||= \@from if @from;
+    }
+
+    defined $to or return;
+
     # Add Cc
     my $cc = $args{Cc};
     if(!defined $cc && $args{group_reply})

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Reply.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -112,9 +112,9 @@
 =over 4
 
 The destination of your message.  By default taken from the C<Reply-To>
-field in the source message.  If that field is not present, the C<Sender>
-field is taken.  If that field is not present as well, the C<From> line
-is scanned.  If they all fail, C<undef> is returned.
+field in the source message.  If that field is not present as well, the
+C<From> line is scanned.  If they all fail, C<undef> is returned by this
+method: no reply message produced.
 
 =back
 
@@ -304,7 +304,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use IO::Lines;
 
@@ -41,9 +41,17 @@
 
 sub printStructure(;$$)
 {   my $self    = shift;
-    my $indent  = @_ && !ref $_[-1] && substr($_[-1], -1, 1) eq ' ' ? pop : '';
+
+    my $indent
+      = @_==2                       ? pop
+      : defined $_[0] && !ref $_[0] ? shift
+      :                               '';
+
     my $fh      = @_ ? shift : select;
 
+    my $buffer;   # only filled if filehandle==undef
+    open $fh, '>', \$buffer unless defined $fh;
+
     my $subject = $self->get('Subject') || '';
     $subject    = ": $subject" if length $subject;
 
@@ -61,6 +69,8 @@
       :                      ();
 
     $_->printStructure($fh, $indent.'   ') foreach @parts;
+    $buffer;
 }
     
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct/Text.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -51,23 +51,29 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
-Print the structure of a message to the selected filehandle.
+Print the structure of a message to the specified FILEHANDLE or the
+selected filehandle.  When explicitly C<undef> is specified as handle,
+then the output will be returned as string.
+
 The message's subject and the types of all composing parts are
 displayed.
 
-INDENT specifies the initial indentation string: it is added in
-front of each line, and SHALL end with a blank, if specified.
+INDENT specifies the initial indentation string: it is added in front
+of each line. The INDENT must contain at least one white-space.
 
 I<Example:> 
 
  my $msg = ...;
  $msg->printStructure(\*OUTPUT);
+
  $msg->printStructure;
 
+ my $struct = $msg->printStructure(undef);
+
  # Possible output for one message:
  multipart/mixed: forwarded message from Pietje Puk (1550 bytes)
     text/plain (164 bytes)
@@ -86,6 +92,7 @@
 
 =back
 
+=head2 Flags
 
 
 
@@ -93,13 +100,15 @@
 
 
 
+
+
 =head1 REFERENCES
 
 See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Mail::Message::Head::Complete;
 use Mail::Message::Body::Lines;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Construct.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -46,7 +46,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Convert::Html;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Convert';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/Html.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -179,9 +179,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert::Html-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert::Html-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -307,7 +307,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Convert::HtmlFormatPS;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Convert';
 
 use Mail::Message::Body::String;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatPS.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -94,9 +94,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert::HtmlFormatPS-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert::HtmlFormatPS-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -222,7 +222,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Convert::HtmlFormatText;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Convert';
 
 use Mail::Message::Body::String;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/HtmlFormatText.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -109,9 +109,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert::HtmlFormatText-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert::HtmlFormatText-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -237,7 +237,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::Convert::MailInternet;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Convert';
 
 use Mail::Internet;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MailInternet.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -113,9 +113,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert::MailInternet-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert::MailInternet-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -241,7 +241,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::Convert::MimeEntity;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Convert';
 
 use MIME::Entity;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/MimeEntity.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -121,9 +121,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert::MimeEntity-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert::MimeEntity-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -252,7 +252,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Convert::TextAutoformat;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Convert';
 
 use Mail::Message::Body::String;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert/TextAutoformat.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -99,9 +99,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert::TextAutoformat-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert::TextAutoformat-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -227,7 +227,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::Convert;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Convert.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -138,9 +138,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Convert-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Convert-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -266,7 +266,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Dummy;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Dummy.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -25,7 +25,7 @@
 their place is occupied by a dummy.
 
 Be careful when using modules which may create dummies.  Before trying to
-access the header or body use L<isDummy()|Mail::Message/"The Message"> to check if the message is a
+access the header or body use L<isDummy()|Mail::Message/"The message"> to check if the message is a
 dummy message.
 
 
@@ -36,7 +36,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -44,14 +44,6 @@
 
 =back
 
-Mail::Message::Dummy-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-See L<Mail::Message/"Constructors">
-
-=back
-
 Mail::Message::Dummy-E<gt>B<new>(MESSAGE-ID, OPTIONS)
 
 =over 4
@@ -115,7 +107,7 @@
 
 =back
 
-Mail::Message::Dummy-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Message::Dummy-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -237,14 +229,14 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -252,7 +244,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -260,7 +252,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -268,7 +260,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -276,7 +268,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -284,7 +276,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -292,7 +284,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -300,7 +292,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -308,7 +300,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -570,7 +562,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -589,6 +581,22 @@
 =head2 Internals
 
 
+$obj-E<gt>B<clonedFrom>
+
+=over 4
+
+See L<Mail::Message/"Internals">
+
+=back
+
+Mail::Message::Dummy-E<gt>B<coerce>(MESSAGE, OPTIONS)
+
+=over 4
+
+See L<Mail::Message/"Internals">
+
+=back
+
 $obj-E<gt>B<isDelayed>
 
 =over 4
@@ -664,9 +672,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Dummy-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Dummy-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -820,10 +828,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -837,9 +853,17 @@
 Dummy messages are place-holders in message threads: the thread detected
 the existence of the message, because it found the message-id in a
 Reply-To or References field, however it did not find the header and
-body of the message yet.  Use L<isDummy()|Mail::Message/"The Message"> to check whether the thread
+body of the message yet.  Use L<isDummy()|Mail::Message/"The message"> to check whether the thread
 node returned a dummy or not.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -863,7 +887,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Field::AddrGroup;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'User::Identity::Collection::Emails';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/AddrGroup.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -63,37 +63,47 @@
 
 =back
 
-=head2 Initiation
+=head2 Constructors
 
 
+$obj-E<gt>B<coerce>(OBJECT)
+
+=over 4
+
+Coerce an OBJECT into a L<Mail::Message::Field::AddrGroup|Mail::Message::Field::AddrGroup>.  Currently,
+you can only coerce L<User::Identity::Collection::Emails|User::Identity::Collection::Emails> (which is
+the base class for this one) into this one.
+
+=back
+
 Mail::Message::Field::AddrGroup-E<gt>B<new>([NAME], OPTIONS)
 
 =over 4
 
-See L<User::Identity::Collection::Emails/"Initiation">
+See L<User::Identity::Collection::Emails/"Constructors">
 
 =back
 
 =head2 Attributes
 
 
-$obj-E<gt>B<addRole>(ROLE| ( [NAME],OPTIONS ) | ARRAY-OF-OPTIONS)
+$obj-E<gt>B<description>
 
 =over 4
 
-See L<User::Identity::Collection/"Attributes">
+See L<User::Identity::Item/"Attributes">
 
 =back
 
-$obj-E<gt>B<description>
+$obj-E<gt>B<itemType>
 
 =over 4
 
-See L<User::Identity::Item/"Attributes">
+See L<User::Identity::Collection/"Attributes">
 
 =back
 
-$obj-E<gt>B<name>
+$obj-E<gt>B<name>([NEWNAME])
 
 =over 4
 
@@ -144,6 +154,14 @@
 
 =back
 
+$obj-E<gt>B<removeCollection>(OBJECT|NAME)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
 $obj-E<gt>B<type>
 
 Mail::Message::Field::AddrGroup-E<gt>B<type>
@@ -162,30 +180,52 @@
 
 =back
 
-=head2 Searching
+=head2 Maintaining roles
 
 
-$obj-E<gt>B<find>(NAME|CODE|undef)
+$obj-E<gt>B<addRole>(ROLE| ( [NAME],OPTIONS ) | ARRAY-OF-OPTIONS)
 
 =over 4
 
-See L<User::Identity::Collection/"Searching">
+See L<User::Identity::Collection/"Maintaining roles">
 
 =back
 
-=head2 Constructors
+$obj-E<gt>B<removeRole>(ROLE|NAME)
 
+=over 4
 
-$obj-E<gt>B<coerce>(OBJECT)
+See L<User::Identity::Collection/"Maintaining roles">
 
+=back
+
+$obj-E<gt>B<renameRole>(ROLE|OLDNAME, NEWNAME)
+
 =over 4
 
-Coerce an OBJECT into a L<Mail::Message::Field::AddrGroup|Mail::Message::Field::AddrGroup>.  Currently,
-you can only coerce L<User::Identity::Collection::Emails|User::Identity::Collection::Emails> (which is
-the base class for this one) into this one.
+See L<User::Identity::Collection/"Maintaining roles">
 
 =back
 
+$obj-E<gt>B<sorted>
+
+=over 4
+
+See L<User::Identity::Collection/"Maintaining roles">
+
+=back
+
+=head2 Searching
+
+
+$obj-E<gt>B<find>(NAME|CODE|undef)
+
+=over 4
+
+See L<User::Identity::Collection/"Searching">
+
+=back
+
 =head2 Addresses
 
 
@@ -194,7 +234,7 @@
 =over 4
 
 Add one e-mail address to the list which is maintained in the group. This
-is a wrapper around L<addRole()|User::Identity::Collection/"Attributes"> adding flexibility on how addresses
+is a wrapper around L<addRole()|User::Identity::Collection/"Maintaining roles"> adding flexibility on how addresses
 are specified.  An ADDRESS can be anything which is acceptable for
 L<Mail::Message::Field::Address::coerce()|Mail::Message::Field::Address/"Constructors"> or a list of options which
 will create such an object.
@@ -256,6 +296,12 @@
 the name of a package, you specified a nickname which was not defined.
 Maybe you forgot the 'require' the package which defines the nickname.
 
+I<Error:> Cannot rename $name into $newname: already exists
+
+
+I<Error:> Cannot rename $name into $newname: doesn't exist
+
+
 I<Error:> Creation of a collection via $class failed.
 
 The $class did compile, but it was not possible to create an object
@@ -287,7 +333,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Field::Address;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Identity';
 
 use Mail::Message::Field::Addresses;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Address.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -57,17 +57,6 @@
 =head1 METHODS
 
 
-=head2 Initiation
-
-
-Mail::Message::Field::Address-E<gt>B<new>([NAME], OPTIONS)
-
-=over 4
-
-See L<Mail::Identity/"METHODS">
-
-=back
-
 =head2 Constructors
 
 
@@ -97,6 +86,14 @@
 
 =back
 
+Mail::Message::Field::Address-E<gt>B<new>([NAME], OPTIONS)
+
+=over 4
+
+See L<Mail::Identity/"METHODS">
+
+=back
+
 $obj-E<gt>B<parse>(STRING)
 
 =over 4
@@ -167,7 +164,7 @@
 
 =back
 
-$obj-E<gt>B<name>
+$obj-E<gt>B<name>([NEWNAME])
 
 =over 4
 
@@ -242,6 +239,14 @@
 
 =back
 
+$obj-E<gt>B<removeCollection>(OBJECT|NAME)
+
+=over 4
+
+See L<User::Identity::Item/"Collections">
+
+=back
+
 $obj-E<gt>B<type>
 
 Mail::Message::Field::Address-E<gt>B<type>
@@ -327,7 +332,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Field::Addresses;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field::Structured';
 
 use Mail::Message::Field::AddrGroup;
@@ -113,15 +113,6 @@
 #------------------------------------------
 
 
-sub addExtra($@)
-{   my $self = shift;
-    $self->log(ERROR => 'No extras in address fields.');
-    $self;
-}
-
-#------------------------------------------
-
-
 sub parse($)
 {   my ($self, $string) = @_;
     my ($group, $email) = ('', undef);
@@ -187,7 +178,6 @@
 
 #------------------------------------------
 
-
 sub produceBody()
 {  my @groups = sort {$a->name cmp $b->name} shift->groups;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Addresses.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -128,8 +128,8 @@
  Option      Defined in       Default      
  attributes  L<Mail::Message::Field::Structured>  <ignored>    
  charset     L<Mail::Message::Field::Full>  undef        
+ datum       L<Mail::Message::Field::Structured>  C<undef>     
  encoding    L<Mail::Message::Field::Full>  C<'q'>       
- extra       L<Mail::Message::Field::Structured>  <ignored>    
  force       L<Mail::Message::Field::Full>  false        
  language    L<Mail::Message::Field::Full>  undef        
  log         L<Mail::Reporter>  C<'WARNINGS'>
@@ -139,10 +139,10 @@
 
 . charset STRING
 
+. datum STRING
+
 . encoding 'q'|'Q'|'b'|'B'
 
-. extra STRING
-
 . force BOOLEAN
 
 . language STRING
@@ -322,14 +322,6 @@
 
 =back
 
-$obj-E<gt>B<addExtra>(...)
-
-=over 4
-
-Extras are not permitted in address fields.
-
-=back
-
 $obj-E<gt>B<addGroup>(GROUP|OPTIONS)
 
 =over 4
@@ -488,25 +480,6 @@
 
 =back
 
-$obj-E<gt>B<consumeAddress>(STRING, OPTIONS)
-
-=over 4
-
-Try to destilate address information from the STRING.   Returned are
-an address B<object> and the left-over string.  If no address was found,
-the first returned value is C<undef>.
-
-=back
-
-$obj-E<gt>B<consumeDomain>(STRING)
-
-=over 4
-
-Try to get a valid domain representation from STRING.  Returned are the
-domain string as found (or C<undef>) and the rest of the string.
-
-=back
-
 $obj-E<gt>B<decode>(STRING, OPTIONS)
 
 Mail::Message::Field::Addresses-E<gt>B<decode>(STRING, OPTIONS)
@@ -543,15 +516,6 @@
 
 =back
 
-$obj-E<gt>B<produceBody>
-
-=over 4
-
-Produce the text for the field.  This will start with the single addresses,
-and end in the groups.
-
-=back
-
 $obj-E<gt>B<setWrapLength>([LENGTH])
 
 =over 4
@@ -579,6 +543,16 @@
 =head2 Parsing
 
 
+$obj-E<gt>B<consumeAddress>(STRING, OPTIONS)
+
+=over 4
+
+Try to destilate address information from the STRING.   Returned are
+an address B<object> and the left-over string.  If no address was found,
+the first returned value is C<undef>.
+
+=back
+
 $obj-E<gt>B<consumeComment>(STRING)
 
 Mail::Message::Field::Addresses-E<gt>B<consumeComment>(STRING)
@@ -589,6 +563,15 @@
 
 =back
 
+$obj-E<gt>B<consumeDomain>(STRING)
+
+=over 4
+
+Try to get a valid domain representation from STRING.  Returned are the
+domain string as found (or C<undef>) and the rest of the string.
+
+=back
+
 $obj-E<gt>B<consumeDotAtom>(STRING)
 
 =over 4
@@ -607,6 +590,14 @@
 
 =back
 
+$obj-E<gt>B<datum>([VALUE])
+
+=over 4
+
+See L<Mail::Message::Field::Structured/"Parsing">
+
+=back
+
 $obj-E<gt>B<parse>(STRING)
 
 =over 4
@@ -615,6 +606,14 @@
 
 =back
 
+$obj-E<gt>B<produceBody>
+
+=over 4
+
+See L<Mail::Message::Field::Full/"Parsing">
+
+=back
+
 =head2 Error handling
 
 
@@ -634,9 +633,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::Addresses-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::Addresses-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -777,10 +776,6 @@
 Is is not possible to add attributes to address fields: it is not permitted
 by the RFCs.
 
-I<Error:> No extras in address fields.
-
-It is not permitted to have free-format text parts in address fields.
-
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -803,7 +798,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,9 +3,8 @@
 
 package Mail::Message::Field::Attribute;
 use vars '$VERSION';
-$VERSION = '2.055';
-
-use Mail::Reporter;
+$VERSION = '2.060';
+use base 'Mail::Reporter';
 use 5.007003;
 use Encode ();
 
@@ -14,22 +13,25 @@
 
 sub new($$@)
 {   my ($class, $attr) = (shift, shift);
-    my $value = @_ % 1 == 1 ? shift : undef;
-    my %args  = @_;
+    my $value = @_ % 2 == 1 ? shift : undef;
+    $class->SUPER::new(attr => $attr, value => $value, @_);
+}
 
-    my $name  = $attr =~ m/^(.*?)(?:\*\d+)?\*?\=/ ? $1 : $attr;
-    $class->log(WARNING => "Illegal character in parameter name '$name'.\n")
+sub init($$)
+{   my ($self, $args)  = @_;
+    $self->SUPER::init($args);
+
+    my ($attr, $value, $cont) = @$args{ qw/attr value use_continuations/ };
+
+    my $name  = ($attr =~ m/^(.*?)(?:\*\d+)?\*?\=/ ? $1 : $attr);
+    $self->log(WARNING => "Illegal character in parameter name '$name'.")
         if $name !~ m/^[!#-'*+\-.0-9A-Z^-~]+$/;
 
-    my $self  = bless
-     { MMFF_name    => $name
-     , MMFF_usecont =>
-          (defined $args{use_continuations} ? $args{use_continuations} : 1)
-     }, $class;
+    $self->{MMFF_name}     = $name;
+    $self->{MMFF_usecont}  = defined $cont ? $cont : 1;
+    $self->{MMFF_charset}  = $args->{charset}  if defined $args->{charset};
+    $self->{MMFF_language} = $args->{language} if defined $args->{language};
 
-    $self->{MMFF_charset}  = $args{charset}  if defined $args{charset};
-    $self->{MMFF_language} = $args{language} if defined $args{language};
-
     $self->value($value)       if defined $value;
     $self->addComponent($attr) unless $attr eq $name;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Attribute.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,12 +4,17 @@
 Mail::Message::Field::Attribute - one attribute of a full field
 
 
+=head1 INHERITANCE
 
+ Mail::Message::Field::Attribute
+   is a Mail::Reporter
+
+
 =head1 SYNOPSIS
 
  my $field    = $msg->head->get('Content-Disposition') or return;
  my $full     = $field->study;   # full understanding in unicode
- my $filename = $full->attribute(filename)             or return;
+ my $filename = $full->attribute('filename')           or return;
 
  print ref $filename;     # this class name
  print $filename;         # the attributes content in utf-8
@@ -58,6 +63,8 @@
  Option             Defined in       Default      
  charset                             C<'us-ascii'>
  language                            undef        
+ log                L<Mail::Reporter>  C<'WARNINGS'>
+ trace              L<Mail::Reporter>  C<'WARNINGS'>
  use_continuations                   <true>       
 
 . charset STRING
@@ -82,6 +89,10 @@
 
 =back
 
+. log LEVEL
+
+. trace LEVEL
+
 . use_continuations BOOLEAN
 
 =over 4
@@ -123,9 +134,7 @@
 
 I<Example:> 
 
- my $param = Mail::Message::Field::Attribute
-               ->new('Content-Type');
-
+ my $param = Mail::Message::Field::Attribute->new;
  $param->addComponent("filename*=iso10646'nl-BE'%Re\47u");
 
 =back
@@ -211,8 +220,129 @@
 This class does not extend L<Mail::Reporter|Mail::Reporter> for obvious performance
 reasons: there is no logging or tracing available.
 
+$obj-E<gt>B<AUTOLOAD>
 
+=over 4
 
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<addReport>(OBJECT)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+Mail::Message::Field::Attribute-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<errors>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<log>([LEVEL [,STRINGS]])
+
+Mail::Message::Field::Attribute-E<gt>B<log>([LEVEL [,STRINGS]])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logPriority>(LEVEL)
+
+Mail::Message::Field::Attribute-E<gt>B<logPriority>(LEVEL)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logSettings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<notImplemented>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<report>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<reportAll>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<trace>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<warnings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+=head2 Cleanup
+
+
+$obj-E<gt>B<DESTROY>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+$obj-E<gt>B<inGlobalDestruction>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+
+
 =head1 DIAGNOSTICS
 
 I<Warning:> Illegal character in parameter name '$name'
@@ -221,6 +351,14 @@
 the RFCs.  You can better change the name into something which is accepted,
 or risk applications to corrupt or ignore the message.
 
+I<Error:> Package $package does not implement $method.
+
+Fatal error: the specific package (or one of its superclasses) does not
+implement this method where it should. This message means that some other
+related classes do implement this method however the class at hand does
+not.  Probably you should investigate this and probably inform the author
+of the package.
+
 I<Error:> Too late to merge: value already changed.
 
 
@@ -235,7 +373,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,12 +3,10 @@
 
 package Mail::Message::Field::Fast;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field';
 
-use Carp;
 
-
 #------------------------------------------
 #
 # The DATA is stored as:   [ NAME, FOLDED-BODY ]

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Fast.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -317,6 +317,14 @@
 
 =back
 
+$obj-E<gt>B<attributes>
+
+=over 4
+
+See L<Mail::Message::Field/"Access to the content">
+
+=back
+
 $obj-E<gt>B<comment>([STRING])
 
 =over 4
@@ -436,9 +444,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::Fast-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::Fast-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -579,7 +587,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Field::Flex;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Flex.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -291,6 +291,14 @@
 
 =back
 
+$obj-E<gt>B<attributes>
+
+=over 4
+
+See L<Mail::Message::Field/"Access to the content">
+
+=back
+
 $obj-E<gt>B<comment>([STRING])
 
 =over 4
@@ -410,9 +418,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::Flex-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::Flex-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -553,7 +561,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,17 +3,19 @@
 
 package Mail::Message::Field::Full;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field';
 
-use Mail::Message::Field::Attribute;
-
 use utf8;
 use Encode ();
 use MIME::QuotedPrint ();
 use Storable 'dclone';
 
-use Carp;
+use Mail::Message::Field::Structured;
+use Mail::Message::Field::Unstructured;
+use Mail::Message::Field::Addresses;
+use Mail::Message::Field::URIs;
+
 my $atext = q[a-zA-Z0-9!#\$%&'*+\-\/=?^_`{|}~];  # from RFC
 
 
@@ -34,6 +36,8 @@
    $implementation{$_} = 'URIs' foreach
       qw/list-help list-post list-subscribe list-unsubscribe list-archive
          list-owner/;
+   $implementation{$_} = 'Structured' foreach
+      qw/content-disposition content-type/;
 #  $implementation{$_} = 'Date' foreach
 #     qw/date resent-date/;
 }
@@ -57,9 +61,6 @@
     my $myclass = 'Mail::Message::Field::'
                 . ($implementation{lc $name} || 'Unstructured');
 
-    eval "require $myclass";
-    return if $@;
-
     $myclass->SUPER::new(%args, name => $name, body => $body);
 }
 
@@ -85,13 +86,6 @@
 
 #------------------------------------------
 
-sub length()
-{   my $self = shift;
-    croak;
-}
-
-#------------------------------------------
-
 sub name() { lc shift->{MMFF_name}}
 
 #------------------------------------------
@@ -116,7 +110,7 @@
 {   my ($self, $body) = (shift, shift);
 
     if(defined $body)
-    {    $self->foldedBody($self->fold($self->{MMFF_name}, $body));
+    {    $self->foldedBody(scalar $self->fold($self->{MMFF_name}, $body));
          return $body;
     }
 
@@ -384,6 +378,11 @@
 
 #------------------------------------------
 
+                                                                                
+sub produceBody() { die }
 
+#------------------------------------------
 
+
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Full.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -17,11 +17,9 @@
 
 =head1 SYNOPSIS
 
- !!
  !! UNDER CONSTRUCTION
  !! The details of this module are NOT FINISHED yet
- !! Some parts are already usable, however.  With care!
- !!
+ !! Most parts are already usable, however.  With care!
 
  # Getting to understand the complexity of a header field ...
 
@@ -407,6 +405,14 @@
 
 =back
 
+$obj-E<gt>B<attributes>
+
+=over 4
+
+See L<Mail::Message::Field/"Access to the content">
+
+=back
+
 $obj-E<gt>B<beautify>
 
 =over 4
@@ -694,10 +700,24 @@
 
 Get the detailed information from the STRING, and store the data found
 in the field object.  The accepted input is very field type dependent.
-Unstructured fields even do no parsing whatsoever.
+Unstructured fields do no parsing whatsoever.
 
 =back
 
+$obj-E<gt>B<produceBody>
+
+=over 4
+
+Produce the text for the field, based on the information stored within the
+field object.
+
+Usually, you wish the exact same line as was found in the input source
+of a message.  But when you have created a field yourself, it should get
+formatted.  You may call L<beautify()|Mail::Message::Field::Full/"Access to the content"> on a preformatted field to enforce
+a call to this method when the field is needed later.
+
+=back
+
 =head2 Error handling
 
 
@@ -717,9 +737,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::Full-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::Full-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -877,7 +897,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Field::Structured;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field::Full';
 
 use Mail::Message::Field::Attribute;
@@ -11,11 +11,12 @@
 
 sub init($)
 {   my ($self, $args) = @_;
+    $self->{MMFS_attrs} = {};
 
     $self->SUPER::init($args);
 
-    $self->addExtra($args->{extra})
-        if exists $args->{extra};
+    $self->datum($args->{datum})
+        if defined $args->{datum};
 
     my $attr = $args->{attributes} || [];
     $attr    = [ %$attr ] if ref $attr eq 'HASH';
@@ -26,8 +27,6 @@
         else          { $self->attribute($name, shift @$attr) }
     }
 
-    $self->{MMFS_attrs} = {};
-    $self->{MMFS_extra} = ();
     $self;
 }
 
@@ -70,4 +69,57 @@
 
 #------------------------------------------
 
+
+sub parse($)
+{   my ($self, $string) = @_;
+    my $datum = '';
+    while(length $string && substr($string, 0, 1) ne ';')
+    {   (undef, $string)  = $self->consumeComment($string);
+        $datum .= $1 if $string =~ s/^([^;(]+)//;
+    }
+    $self->datum($datum);
+
+    my $found = '';
+    while($string =~ m/\S/)
+    {   if($string =~ s/^\s*\;\s*// && length $found)
+        {   my $attr = Mail::Message::Field::Attribute->new($found);
+            $self->attribute($attr);
+            $found = '';
+        }
+
+        (undef, $string) = $self->consumeComment($string);
+        $string =~ s/^\n//;
+        (my $text, $string) = $self->consumePhrase($string);
+        $found .= $text if defined $text;
+    }
+
+    if(length $found)
+    {   my $attr = Mail::Message::Field::Attribute->new($found);
+        $self->attribute($attr);
+    }
+
+    1;
+}
+
+#------------------------------------------
+
+sub produceBody()
+{   my $self  = shift;
+    my $attrs = $self->{MMFS_attrs};
+    my $datum = $self->datum;
+
+    join '; '
+       , (defined $datum ? $datum : '')
+       , map {$_->string} @{$attrs}{sort keys %$attrs};
+}
+
+#------------------------------------------
+
+
+sub datum(;$)
+{   my $self = shift;
+    @_ ? ($self->{MMFS_datum} = shift) : $self->{MMFS_datum};
+}
+*body = \&datum;
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Structured.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -20,8 +20,6 @@
 
  my $f = Mail::Message::Field::Full
             ->new('Content-Type' => 'text/html');
- # $f is now a Mail::Message::Field::Structured
- # NOT READY YET!!!
 
  my @encode = (charset => 'jp', use_continuations => 1);
  $f->attribute('filename=passwd');
@@ -136,8 +134,8 @@
  Option      Defined in       Default      
  attributes                   C<[]>        
  charset     L<Mail::Message::Field::Full>  undef        
+ datum                        C<undef>     
  encoding    L<Mail::Message::Field::Full>  C<'q'>       
- extra                        undef        
  force       L<Mail::Message::Field::Full>  false        
  language    L<Mail::Message::Field::Full>  undef        
  log         L<Mail::Reporter>  C<'WARNINGS'>
@@ -156,16 +154,23 @@
 
 . charset STRING
 
-. encoding 'q'|'Q'|'b'|'B'
+. datum STRING
 
-. extra STRING
-
 =over 4
 
-Text which is appended after the line (preceded by a semicolon).
+The method name I<body> is very confusing, even in the RFC.  In MailBox,
+for historical reasons, L<body()|Mail::Message::Field/"Access to the body"> returns the past of the field contents
+before the first semi-colon.  L<foldedBody()|Mail::Message::Field/"Access to the body"> and L<unfoldedBody()|Mail::Message::Field/"Access to the body">
+address the whole field.
 
+There is no common name for the piece of data before the parameters
+(attributes) in the field-content mentioned in the RFCs, so let's call
+it B<datum>.
+
 =back
 
+. encoding 'q'|'Q'|'b'|'B'
+
 . force BOOLEAN
 
 . language STRING
@@ -556,6 +561,14 @@
 
 =back
 
+$obj-E<gt>B<datum>([VALUE])
+
+=over 4
+
+Equivalent to L<body()|Mail::Message::Field/"Access to the body">, but maybe less confusing.
+
+=back
+
 $obj-E<gt>B<parse>(STRING)
 
 =over 4
@@ -564,6 +577,14 @@
 
 =back
 
+$obj-E<gt>B<produceBody>
+
+=over 4
+
+See L<Mail::Message::Field::Full/"Parsing">
+
+=back
+
 =head2 Error handling
 
 
@@ -583,9 +604,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::Structured-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::Structured-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -743,7 +764,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,9 +1,8 @@
-use strict;
 use warnings;
 
 package Mail::Message::Field::URIs;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field::Structured';
 use Carp 'confess';
 
@@ -77,13 +76,4 @@
 #------------------------------------------
 
 
-sub addExtra($@)
-{   my $self = shift;
-    $self->log(ERROR => 'No extras in URI fields.');
-    $self;
-}
-
-#------------------------------------------
-
-
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/URIs.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -114,8 +114,8 @@
  Option      Defined in       Default      
  attributes  L<Mail::Message::Field::Structured>  <ignored>    
  charset     L<Mail::Message::Field::Full>  undef        
+ datum       L<Mail::Message::Field::Structured>  C<undef>     
  encoding    L<Mail::Message::Field::Full>  C<'q'>       
- extra       L<Mail::Message::Field::Structured>  <ignored>    
  force       L<Mail::Message::Field::Full>  false        
  language    L<Mail::Message::Field::Full>  undef        
  log         L<Mail::Reporter>  C<'WARNINGS'>
@@ -125,10 +125,10 @@
 
 . charset STRING
 
+. datum STRING
+
 . encoding 'q'|'Q'|'b'|'B'
 
-. extra STRING
-
 . force BOOLEAN
 
 . language STRING
@@ -312,14 +312,6 @@
 
 =back
 
-$obj-E<gt>B<addExtra>(...)
-
-=over 4
-
-Extras are not permitted in URI fields.
-
-=back
-
 $obj-E<gt>B<addURI>(URI)
 
 =over 4
@@ -542,6 +534,14 @@
 
 =back
 
+$obj-E<gt>B<datum>([VALUE])
+
+=over 4
+
+See L<Mail::Message::Field::Structured/"Parsing">
+
+=back
+
 $obj-E<gt>B<parse>(STRING)
 
 =over 4
@@ -550,6 +550,14 @@
 
 =back
 
+$obj-E<gt>B<produceBody>
+
+=over 4
+
+See L<Mail::Message::Field::Full/"Parsing">
+
+=back
+
 =head2 Error handling
 
 
@@ -569,9 +577,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::URIs-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::URIs-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -712,10 +720,6 @@
 Is is not possible to add attributes to URI fields: it is not permitted
 by the RFCs.
 
-I<Error:> No extras in URI fields.
-
-It is not permitted to have free-format text parts in URI fields.
-
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -738,7 +742,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,13 +3,17 @@
 
 package Mail::Message::Field::Unstructured;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Field::Full';
 
 
 sub init($)
 {   my ($self, $args) = @_;
 
+    if($args->{body} && ($args->{encoding} || $args->{charset}))
+    {   $args->{body} = $self->encode($args->{body}, %$args);
+    }
+
     $self->SUPER::init($args) or return;
 
     $self->log(WARNING=>"Attributes are not supported for unstructured fields")
@@ -24,4 +28,6 @@
 #------------------------------------------
 
 
+
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field/Unstructured.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -306,6 +306,14 @@
 
 =back
 
+$obj-E<gt>B<attributes>
+
+=over 4
+
+See L<Mail::Message::Field/"Access to the content">
+
+=back
+
 $obj-E<gt>B<beautify>
 
 =over 4
@@ -491,6 +499,14 @@
 
 =back
 
+$obj-E<gt>B<produceBody>
+
+=over 4
+
+See L<Mail::Message::Field::Full/"Parsing">
+
+=back
+
 =head2 Error handling
 
 
@@ -510,9 +526,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field::Unstructured-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field::Unstructured-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -670,7 +686,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Field;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Carp;
@@ -40,6 +40,8 @@
 #------------------------------------------
 
 
+sub length { length shift->folded }
+
 #------------------------------------------
 
 
@@ -49,7 +51,7 @@
      Resent-Date Resent-From Resent-Sender Resent-To Return-Path
      List-Help List-Post List-Unsubscribe Mailing-List
      Received References Message-ID In-Reply-To
-     Content-Length Content-Type
+     Content-Length Content-Type Content-Disposition
      Delivered-To
      Lines
      MIME-Version
@@ -74,7 +76,7 @@
 #------------------------------------------
 
 
-sub toString(;$) {my $self = shift;$self->string(@_)}
+sub toString(;$) {shift->string(@_)}
 sub string(;$)
 {   my $self  = shift;
     return $self->folded unless @_;
@@ -105,7 +107,7 @@
 #------------------------------------------
 
 
-sub size() {length shift->toString}
+*size = \&length;
 
 #------------------------------------------
 
@@ -119,7 +121,7 @@
 
 my %wf_lookup
   = qw/mime MIME  ldap LDAP  soap SOAP  swe SWE
-       bcc Bcc  cc Cc/;
+       bcc Bcc  cc Cc  id ID/;
 
 sub wellformedName(;$)
 {   my $thing = shift;
@@ -127,12 +129,14 @@
 
     join '-',
        map { $wf_lookup{lc $_} || ( /[aeiouyAEIOUY]/ ? ucfirst lc : uc ) }
-          split /\-/, $name;
+          split /\-/, $name, -1;
 }
 
 #------------------------------------------
 
 
+sub folded { shift->notImplemented }
+
 #------------------------------------------
 
 
@@ -148,6 +152,8 @@
 #------------------------------------------
 
 
+sub foldedBody { shift->notImplemented }
+
 #------------------------------------------
 
 
@@ -171,7 +177,7 @@
     while(@s)
     {   my $s = shift @s;
 
-           if(length $r && substr($r, -1) eq "\\") { $r .= $s } # esc'd special
+           if(CORE::length($r)&& substr($r, -1) eq "\\")  { $r .= $s }
         elsif($s eq '"')   { $in_dquotes = not $in_dquotes; $r .= $s }
         elsif($s eq '(' && !$in_dquotes) { $open_paren++ }
         elsif($s eq ')' && !$in_dquotes) { $open_paren-- }
@@ -201,7 +207,7 @@
     if(@_)
     {   my $comment = shift;
         $body    =~ s/\s*\;.*//;
-        $body   .= "; $comment" if defined $comment && length $comment;
+        $body   .= "; $comment" if defined $comment && CORE::length($comment);
         $self->unfoldedBody($body);
         return $comment;
     }
@@ -225,7 +231,7 @@
            $body =~ m/\b$attr\s*\=\s*
                        ( "( (?: [^"]|\\" )* )"
                        | '( (?: [^']|\\' )* )'
-                       | (\S*)
+                       | ([^;\s]*)
                        )
                   /xi ? $+ : undef;
     }
@@ -235,7 +241,7 @@
     {   for($body)
         {      s/\b$attr\s*=\s*'([^']|\\')*'//i
             or s/\b$attr\s*=\s*"([^"]|\\")*"//i
-            or s/\b$attr\s*=\s*\S*//i;
+            or s/\b$attr\s*=\s*[;\s]*//i;
         }
         $self->unfoldedBody($body);
         return undef;
@@ -245,7 +251,7 @@
     for($body)
     {       s/\b$attr\s*=\s*'([^']|\\')*'/$attr="$quoted"/i
          or s/\b$attr\s*=\s*"([^"]|\\")*"/$attr="$quoted"/i
-         or s/\b$attr\s*=\s*\S+/$attr="$quoted"/i
+         or s/\b$attr\s*=\s*[^;\s]+/$attr="$quoted"/i
          or do { $_ .= qq(; $attr="$quoted") }
     }
 
@@ -256,6 +262,26 @@
 #------------------------------------------
 
 
+sub attributes()
+{   my $self  = shift;
+    my $body  = $self->unfoldedBody;
+
+    my @attrs;
+    while($body =~ m/\b(\w+)\s*\=\s*
+                       ( "( (?: [^"]|\\" )* )"
+                       | '( (?: [^']|\\' )* )'
+                       | ([^;\s]*)
+                       )
+                    /xig)
+    {   push @attrs, $1 => $+;
+    }
+
+    @attrs;
+}
+
+#------------------------------------------
+
+
 sub toInt()
 {   my $self = shift;
     return $1 if $self->body =~ m/^\s*(\d+)\s*$/;
@@ -278,7 +304,7 @@
     my $time   = strftime($format, @time);
 
     # for C libs which do not (GNU compliantly) support %z
-    $time =~ s/ (\%z|[A-Z]+)$/_tz_offset($1)/e;
+    $time =~ s/ (\%z|[A-Z ]+)$/_tz_offset($1)/e;
 
     $time; 
 }
@@ -289,7 +315,7 @@
 
    my $diff = $zone eq '%z' ? Time::Zone::tz_local_offset()
            :                  Time::Zone::tz_offset($zone);
-   my $minutes = int((abs($diff)+0.01) / 60);     # float rounding errors :(
+   my $minutes = int((abs($diff)+0.01) / 60);     # float rounding errors
    my $hours   = int(($minutes+0.01) / 60);
    $minutes   -= $hours * 60;
    sprintf( ($diff < 0 ? " -%02d%02d" : " +%02d%02d"), $hours, $minutes);
@@ -354,7 +380,7 @@
         $body =~ s/[\012\015]+/\n/g;
         $body =~ s/^[ \t]*/ /;  # start with one blank, folding kept unchanged
 
-        $self->log(NOTICE => "Empty field: $name\n")
+        $self->log(NOTICE => "Empty field: $name")
            if $body eq " \n";
     }
 
@@ -398,8 +424,8 @@
 sub setWrapLength(;$)
 {   my $self = shift;
 
-    $self->[1] = $self->fold($self->[0],$self->unfoldedBody, @_)
-        if @_ || $self->[1] !~ m/\n$/;
+    $self->foldedBody(scalar $self->fold($self->Name, $self->unfoldedBody, @_))
+        if @_;
 
     $self;
 }
@@ -422,13 +448,13 @@
     my $wrap  = shift || $default_wrap_length;
 
     $line    =~ s/\n\s/ /gms;            # Remove accidental folding
-    return " \n" unless length $line;    # empty field
+    return " \n" unless CORE::length($line);  # empty field
 
     my @folded;
     while(1)
-    {  my $max = $wrap - (@folded ? 1 : length($name) + 2);
+    {  my $max = $wrap - (@folded ? 1 : CORE::length($name) + 2);
        my $min = $max >> 2;
-       last if length $line < $max;
+       last if CORE::length($line) < $max;
 
           $line =~ s/^ ( .{$min,$max}   # $max to 30 chars
                         [;,]            # followed at a ; or ,
@@ -445,7 +471,7 @@
        push @folded, " $1\n";
     }
 
-    push @folded, " $line\n" if length $line;
+    push @folded, " $line\n" if CORE::length($line);
     wantarray ? @folded : join('', @folded);
 }
 
@@ -455,7 +481,7 @@
 sub unfold($)
 {   my $string = $_[1];
     for($string)
-    {   s/\n//g;
+    {   s/\r?\n//gm;
         s/^ +//;
     }
     $string;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Field.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -201,7 +201,8 @@
 
 =over 4
 
-Returns the number of bytes needed to display this header-line.
+Returns the number of bytes needed to display this header-line, Same
+as L<length()|Mail::Message::Field/"The field">.
 
 =back
 
@@ -278,7 +279,7 @@
 
 Returns the body of the field.  When this field is structured, it will
 be B<stripped> from everything what is behind the first semi-color (C<;>).
-In aby case, the string is unfolded.  
+In any case, the string is unfolded.  
 Whether the field is structured is defined by L<isStructured()|Mail::Message::Field/"The field">.
 
 =back
@@ -376,7 +377,7 @@
 Get the value of an attribute, optionally after setting it to a new value.
 Attributes are part of some header lines, and hide themselves in the
 comment field.  If the attribute does not exist, then C<undef> is
-returned.
+returned.  The attribute is still encoded.
 
 I<Example:> 
 
@@ -397,6 +398,18 @@
 
 =back
 
+$obj-E<gt>B<attributes>
+
+=over 4
+
+Returns a list of key-value pairs, where the values are not yet decoded.
+
+I<Example:> 
+
+ my %attributes = $head->get('Content-Disposition')->attributes;
+
+=back
+
 $obj-E<gt>B<comment>([STRING])
 
 =over 4
@@ -531,13 +544,10 @@
 wrapping is performed with L<fold()|Mail::Message::Field/"Internals"> and the results stored within
 the field object.
 
-Without LENGTH, the message will be folded, unless it is already folded.
-Pre-folded lines are detected on a trailing new-line character.
+I<Example:> refolding the field
 
-I<Example:> 
 
  $field->setWrapLength(99);
- $field->setWrapLength;
 
 =back
 
@@ -579,9 +589,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Field-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Field-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -1097,7 +1107,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Head::Complete;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head';
 
 use Mail::Box::Parser;
@@ -24,10 +24,28 @@
 
 #------------------------------------------
 
+
 sub build(@)
 {   my $self = shift;
     my $head = $self->new;
-    $head->add(shift, shift) while @_;
+    while(@_)
+    {   my $name = shift;
+
+        if($name->isa('Mail::Message::Field'))
+        {   $head->add($name);
+            next;
+        }
+
+        my $content = shift;
+        if(ref $content && $content->isa('Mail::Message::Field'))
+        {   $self->log(WARNING => "Field objects have an implied name ($name)");
+            $head->add($content);
+            next;
+        }
+
+        $head->add($name, $content);
+    }
+
     $head;
 }
 
@@ -49,6 +67,14 @@
 #------------------------------------------
 
 
+sub wrap($)
+{   my ($self, $length) = @_;
+    $_->setWrapLength($length) foreach $self->orderedFields;
+}
+
+#------------------------------------------
+
+
 sub add(@)
 {   my $self = shift;
 
@@ -296,7 +322,32 @@
 
 #------------------------------------------
 
+                                                                                
+sub printSelected($@)
+{   my ($self, $fh) = (shift, shift);
 
+    foreach my $field ($self->orderedFields)
+    {   my $Name = $field->Name;
+        my $name = $field->name;
+
+        my $found;
+        foreach my $pattern (@_)
+        {   $found = ref $pattern?($Name =~ $pattern):($name eq lc $pattern);
+            last if $found;
+        }
+
+           if(!$found)           { ; }
+        elsif(ref $fh eq 'GLOB') { print $fh "\n" }
+        else                     { $fh->print("\n") }
+    }
+                                                                                
+    $self;
+}
+
+
+#------------------------------------------
+
+
 sub toString() {shift->string}
 sub string()
 {   my $self  = shift;
@@ -413,7 +464,7 @@
 
     my $stamp = Mail::Message::Field->dateToTimestamp($recvd->comment);
 
-    $self->{MMH_recvstamp} = $stamp > 0 ? $stamp : undef;
+    $self->{MMH_recvstamp} = defined $stamp && $stamp > 0 ? $stamp : undef;
 }
 
 #------------------------------------------
@@ -435,7 +486,7 @@
         }
     }
 
-    $self->{MMH_timestamp} = $stamp > 0 ? $stamp : undef;
+    $self->{MMH_timestamp} = defined $stamp && $stamp > 0 ? $stamp : undef;
 }
 
 #------------------------------------------
@@ -460,39 +511,53 @@
 
     my $from   = $self->get('from') || '';
     my $stamp  = $self->timestamp;
-    my $sender = $from =~ m/\<.*?\>/ ? $& : 'unknown';
+    my $sender = $from =~ m/(\<.*?\>)/ ? $1 : 'unknown';
     "From $sender ".(gmtime $stamp)."\n";
 }
 
 #------------------------------------------
 
 
-my $unique_id     = time;
-my $hostname;
+my $msgid_creator;
 
 sub createMessageId()
-{   my $mid = shift->messageIdPrefix . '-' . $unique_id++;
+{   $msgid_creator ||= $_[0]->messageIdPrefix;
+    $msgid_creator->(@_);
+}
 
+#------------------------------------------
+
+
+sub messageIdPrefix(;$$)
+{   my $thing = shift;
+    return $msgid_creator
+       unless @_ || !defined $msgid_creator;
+
+    return $msgid_creator = shift
+       if @_==1 && ref $_[0] eq 'CODE';
+
+    my $prefix   = shift || "mailbox-$$";
+
+    my $hostname = shift;
     unless(defined $hostname)
     {   require Sys::Hostname;
         $hostname = Sys::Hostname::hostname() || 'localhost';
     }
 
-    $mid . '@' . $hostname;
-}
+    eval {require Time::HiRes};
+    if(Time::HiRes->can('gettimeofday'))
+    {
+        return $msgid_creator
+          = sub { my ($sec, $micro) = Time::HiRes::gettimeofday();
+                  "$prefix-$sec-$micro\@$hostname";
+                };
+    }
 
-#------------------------------------------
-
-
-our $unique_prefix;
-
-sub messageIdPrefix(;$)
-{   my $self = shift;
-    return $unique_prefix if !@_ && defined $unique_prefix;
-
-    $unique_prefix = shift || "mailbox-$$";
+    my $unique_id = time;
+    $msgid_creator
+      = sub { $unique_id++;
+              "$prefix-$unique_id\@$hostname";
+            };
 }
 
-#------------------------------------------
-
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Complete.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -58,12 +58,10 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<build>(FIELDS)
+$obj-E<gt>B<build>([PAIR|FIELD]-LIST)
 
 =over 4
 
-See L<Mail::Message::Head/"Constructors">
-
 =back
 
 $obj-E<gt>B<clone>([FIELDS])
@@ -167,6 +165,20 @@
 
 =back
 
+$obj-E<gt>B<wrap>(INTEGER)
+
+=over 4
+
+Re-fold all fields from the header to contain at most INTEGER number of
+characters per line.
+
+I<Example:> re-folding a header
+
+
+ $msg->head->wrap(78);
+
+=back
+
 =head2 Access to the header
 
 
@@ -281,6 +293,7 @@
 Remove the field with the specified name.  If the header contained
 multiple lines with the same name, they will be replaced all together.
 This method simply calls L<reset()|Mail::Message::Head::Complete/"Access to the header"> without replacement fields.
+READ THE IMPORTANT WARNING IN L<removeField()|Mail::Message::Head::Complete/"Access to the header">
 
 =back
 
@@ -360,6 +373,22 @@
 
 =back
 
+$obj-E<gt>B<printSelected>(FILEHANDLE, (STRING|REGEXP)s)
+
+=over 4
+
+Like the usual L<print()|Mail::Message::Head::Complete/"Access to the header">, the header lines are printed to the specified
+FILEHANDLE.  In this case, however, only the fields with names as specified by
+STRING (case insensative) or REGEXP are printed.  They will stay the in-order
+of the source header.
+
+I<Example:> printing only a subset of the fields
+
+
+ $head->printSelected(STDOUT, qw/Subject From To/, qr/^x\-(spam|xyz)\-/i)
+
+=back
+
 $obj-E<gt>B<printUndisclosed>([FILEHANDLE])
 
 =over 4
@@ -392,6 +421,36 @@
 at the end of the name), which accepts a string or regular expression
 as argument to select the fields to be removed.
 
+WARNING WARNING WARNING: for performance reasons, the header administration
+uses weak references (see L<Scalar::Util> method weaken()> to figure-out
+which fields have been removed.  A header is a hash of field for fast search
+and an array of weak references to remember the order of the fields, required
+for printing.  If the field is removed from the hash, the weak-ref is set to
+undef and the field not printed.
+
+However... it is easy to disturb this process.  Example:
+ my $msg = ....;                 # subject ref-count = 1 + 0 = 1
+ $msg->head->delete('Subject');  # subject ref-count =     0 = 0: clean-up
+ $msg->print;                    # subject doesn't show: ok
+
+But
+ my $msg = ....;                 # subject ref-count = 1 + 0 = 1
+ my $s = $msg->head->get('subject'); # ref-count = 1 + 1 + 0 = 2
+ $msg->head->delete('Subject');  # subject ref-count = 1 + 0 = 1: no clean-up
+ $msg->print;                    # subject DOES show: not ok
+ undef $s;                       # ref-count becomes 0: clean-up
+ $msg->print;                    # subject doesn't show: ok
+
+To avoid the latter situation, do not catch the field object, but only
+the field content.  SAVE are all methods which return the text:
+ my $s = $msg->head->get('subject')->body;
+ my $s = $msg->head->get('subject')->unfoldedBody;
+ my $s = $msg->head->get('subject')->foldedBody;
+ my $s = $msg->head->get('subject')->foldedBody;
+ my $s = $msg->get('subject');
+ my $s = $msg->subject;
+ my $s = $msg->string;
+
 =back
 
 $obj-E<gt>B<removeFields>(STRING|REGEXP, [STRING|REGEXP, ...])
@@ -468,7 +527,7 @@
 
 Replace the values in the header fields named by NAME with the values
 specified in the list of FIELDS. A single name can correspond to multiple
-repeated fields.
+repeated fields.  READ THE IMPORTANT WARNING IN L<removeField()|Mail::Message::Head::Complete/"Access to the header">
 
 Removing fields which are part of one of the predefined field groups is
 not a smart idea.  You can better remove these fields as group, all
@@ -502,7 +561,7 @@
 
 The C<set> method is similar to the L<add()|Mail::Message::Head::Complete/"Access to the header"> method, and takes the same
 options. However, existing values for fields will be removed before a new
-value is added.
+value is added.  READ THE IMPORTANT WARNING IN L<removeField()|Mail::Message::Head::Complete/"Access to the header">
 
 =back
 
@@ -708,14 +767,44 @@
 
 =back
 
-$obj-E<gt>B<messageIdPrefix>([STRING])
+$obj-E<gt>B<messageIdPrefix>([PREFIX, [HOSTNAME]|CODE])
 
+Mail::Message::Head::Complete-E<gt>B<messageIdPrefix>([PREFIX, [HOSTNAME]|CODE])
+
 =over 4
 
-Sets/returns the message-id start.  The rest of the message-id is an
-integer which is derived from the current time and the local host.
-See L<createMessageId()|Mail::Message::Head::Complete/"Internals">.
+When options are provided, it sets a new way to create message-ids,
+as used by L<createMessageId()|Mail::Message::Head::Complete/"Internals">.  You have two choices: either by
+providing a PREFIX and optionally a HOSTNAME, or a CODE reference.
 
+The CODE reference will be called with the header as first argument.
+You must ensure yourself that the returned value is RFC compliant.
+
+The PREFIX defaults to C<mailbox-$$>, the HOSTNAME defaults to the
+return of L<Sys::Hostname>'s method C<hostname()>.  Inbetween the
+two, a nano-second time provided by L<Time::Hires> is used.  If that
+module is not available, C<time> is called at the start of the program,
+and incremented for each newly created id.
+
+In any case, a subroutine will be created to be used.  A reference
+to that will be returned.  When the method is called without arguments,
+but no subroutine is defined yet, one will be created.
+
+I<Example:> setting a message prefix
+
+
+  $head->messageIdPrefix('prefix');
+  Mail::Message::Head::Complete->messageIdPrefix('prefix');
+  my $code = $head->messageIdPrefix('mailbox', 'nohost');
+
+  sub new_msgid()
+  {   my $head = shift;
+      "myid-$$-${(rand 10000)}@example.com";
+  }
+
+  $many_msg->messageIdPrefix(\&new_msgid);
+  Mail::Message::Head::Complete->messageIdPrefix(&new_msgid);
+
 =back
 
 $obj-E<gt>B<moveLocation>(DISTANCE)
@@ -761,9 +850,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::Complete-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::Complete-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -876,6 +965,9 @@
 L<delete()|Mail::Message::Head::Complete/"Access to the header">, L<reset()|Mail::Message::Head::Complete/"Access to the header">, or L<set()|Mail::Message::Head::Complete/"Access to the header"> to do the job will not result
 in warnings: those methods check the existence of the field first.
 
+I<Warning:> Field objects have an implied name ($name)
+
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -898,7 +990,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Head::Delayed;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head';
 
 use Object::Realize::Later

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Delayed.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -159,7 +159,7 @@
 there is also no body.
 
 For messages in directory or network organized folders,
-L<Mail::Message::size()|Mail::Message/"The Message"> usually will give a figure for the whole message
+L<Mail::Message::size()|Mail::Message/"The message"> usually will give a figure for the whole message
 without much cost.  Subtract a few hundred bytes for the header, and
 you will get a good estimate.
 
@@ -262,9 +262,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::Delayed-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::Delayed-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -398,7 +398,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Message::Head::FieldGroup;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use strict;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/FieldGroup.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -304,9 +304,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::FieldGroup-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::FieldGroup-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -451,7 +451,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Message::Head::ListGroup;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head::FieldGroup';
 
 use strict;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ListGroup.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -292,9 +292,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::ListGroup-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::ListGroup-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -522,7 +522,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Head::Partial;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head::Complete';
 
 use Scalar::Util 'weaken';

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Partial.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -61,11 +61,11 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<build>(FIELDS)
+$obj-E<gt>B<build>([PAIR|FIELD]-LIST)
 
 =over 4
 
-See L<Mail::Message::Head/"Constructors">
+See L<Mail::Message::Head::Complete/"Constructors">
 
 =back
 
@@ -160,6 +160,14 @@
 
 =back
 
+$obj-E<gt>B<wrap>(INTEGER)
+
+=over 4
+
+See L<Mail::Message::Head::Complete/"The header">
+
+=back
+
 =head2 Access to the header
 
 
@@ -271,6 +279,14 @@
 
 =back
 
+$obj-E<gt>B<printSelected>(FILEHANDLE, (STRING|REGEXP)s)
+
+=over 4
+
+See L<Mail::Message::Head::Complete/"Access to the header">
+
+=back
+
 $obj-E<gt>B<printUndisclosed>([FILEHANDLE])
 
 =over 4
@@ -516,8 +532,10 @@
 
 =back
 
-$obj-E<gt>B<messageIdPrefix>([STRING])
+$obj-E<gt>B<messageIdPrefix>([PREFIX, [HOSTNAME]|CODE])
 
+Mail::Message::Head::Partial-E<gt>B<messageIdPrefix>([PREFIX, [HOSTNAME]|CODE])
+
 =over 4
 
 See L<Mail::Message::Head::Complete/"Internals">
@@ -567,9 +585,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::Partial-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::Partial-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -682,6 +700,9 @@
 L<delete()|Mail::Message::Head::Complete/"Access to the header">, L<reset()|Mail::Message::Head::Complete/"Access to the header">, or L<set()|Mail::Message::Head::Complete/"Access to the header"> to do the job will not result
 in warnings: those methods check the existence of the field first.
 
+I<Warning:> Field objects have an implied name ($name)
+
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -731,7 +752,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Head::ResentGroup;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head::FieldGroup';
 
 use Scalar::Util 'weaken';

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/ResentGroup.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -490,9 +490,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::ResentGroup-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::ResentGroup-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -641,7 +641,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,7 +1,7 @@
 
 package Mail::Message::Head::SpamGroup;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head::FieldGroup';
 
 use strict;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/SpamGroup.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -346,9 +346,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::SpamGroup-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::SpamGroup-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -529,7 +529,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Head::Subset;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head';
 
 use Object::Realize::Later

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head/Subset.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -61,7 +61,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<build>(FIELDS)
+$obj-E<gt>B<build>([PAIR|FIELD]-LIST)
 
 =over 4
 
@@ -266,9 +266,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head::Subset-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head::Subset-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -397,7 +397,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Head;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Message::Head::Complete;
@@ -161,7 +161,7 @@
 
 sub isMultipart()
 {   my $type = shift->get('Content-Type');
-    $type && $type->body =~ m[^multipart/]i;
+    $type && scalar $type->body =~ m[^multipart/]i;
 }
 
 #------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Head.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -80,21 +80,25 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<build>(FIELDS)
+$obj-E<gt>B<build>([PAIR|FIELD]-LIST)
 
 =over 4
 
 A fast way to construct a header with many lines.
-The FIELDS are (name, content) pairs of the header.   A
+The PAIRs are C<(name, content)> pairs of the header, but it is also possible
+to pass L<Mail::Message::Field|Mail::Message::Field> objects.   A
 L<Mail::Message::Head::Complete|Mail::Message::Head::Complete> header is created by simply calling
-L<Mail::Message::Head::Complete::build()|Mail::Message::Head/"Constructors">, and then each field
+L<Mail::Message::Head::Complete::build()|Mail::Message::Head::Complete/"Constructors">, and then each field
 is added.  Double field names are permitted.
 
 I<Example:> 
 
+ my $subject = Mail::Message::Full->new(Subject => 'xyz');
+
  my $head = Mail::Message::Head->build
   ( From     => 'me at example.com'
   , To       => 'you at anywhere.aq'
+  , $subject
   , Received => 'one'
   , Received => 'two'
   );
@@ -384,9 +388,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Head-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Head-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -601,7 +605,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,10 +3,11 @@
 
 package Mail::Message::Part;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message';
-use Scalar::Util 'weaken';
 
+use Scalar::Util    'weaken';
+
 use Carp;
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Part.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -52,7 +52,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -60,20 +60,6 @@
 
 =back
 
-Mail::Message::Part-E<gt>B<coerce>(BODY|MESSAGE, MULTIPART, HEADERS)
-
-=over 4
-
-Transforms a BODY or MESSAGE to a real message part.  The MULTIPART
-refers to the parental body.
-
-When ta BODY is specified, extra HEADERS can be supplied as well.
-Bodies are coerced into message parts by calling L<buildFromBody()|Mail::Message::Part/"METHODS">.
-If you specify a MESSAGE residing in a folder, this message will
-automatically be cloned.
-
-=back
-
 Mail::Message::Part-E<gt>B<new>(OPTIONS)
 
 =over 4
@@ -142,7 +128,7 @@
 
 =back
 
-Mail::Message::Part-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Message::Part-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -272,14 +258,14 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -287,7 +273,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -295,7 +281,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -303,7 +289,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -311,7 +297,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -319,7 +305,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -327,7 +313,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -335,7 +321,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -343,7 +329,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -607,7 +593,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -626,6 +612,28 @@
 =head2 Internals
 
 
+$obj-E<gt>B<clonedFrom>
+
+=over 4
+
+See L<Mail::Message/"Internals">
+
+=back
+
+Mail::Message::Part-E<gt>B<coerce>(BODY|MESSAGE, MULTIPART, HEADERS)
+
+=over 4
+
+Transforms a BODY or MESSAGE to a real message part.  The MULTIPART
+refers to the parental body.
+
+When ta BODY is specified, extra HEADERS can be supplied as well.
+Bodies are coerced into message parts by calling L<buildFromBody()|Mail::Message::Part/"METHODS">.
+If you specify a MESSAGE residing in a folder, this message will
+automatically be cloned.
+
+=back
+
 $obj-E<gt>B<isDelayed>
 
 =over 4
@@ -701,9 +709,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Part-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Part-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -855,10 +863,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message::Part/"METHODS">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -872,6 +888,14 @@
 Message parts can not be destructed per part: only whole messages can
 be forcefully freed from memory. Consider L<delete()|Mail::Message/"Flags"> or L<rebuild()|Mail::Message::Construct::Rebuild/"Constructing a message">.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -895,7 +919,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::Replace::MailHeader;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::Head::Complete';
 
 
@@ -176,7 +176,8 @@
 
 
 BEGIN
-{ *Mail::Header::new =
+{   no warnings;
+    *Mail::Header::new =
      sub { my $class = shift;
            Mail::Message::Replace::MailHeader->new(@_);
          }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailHeader.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -14,7 +14,7 @@
 
 =head1 SYNOPSIS
 
- !!! VERY ALPHA CODE !!!
+ !!! ALPHA CODE !!!
 
  # change
  use Mail::Internet;
@@ -62,11 +62,11 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<build>(FIELDS)
+$obj-E<gt>B<build>([PAIR|FIELD]-LIST)
 
 =over 4
 
-See L<Mail::Message::Head/"Constructors">
+See L<Mail::Message::Head::Complete/"Constructors">
 
 =back
 
@@ -199,6 +199,14 @@
 
 =back
 
+$obj-E<gt>B<wrap>(INTEGER)
+
+=over 4
+
+See L<Mail::Message::Head::Complete/"The header">
+
+=back
+
 =head2 Access to the header
 
 
@@ -296,6 +304,14 @@
 
 =back
 
+$obj-E<gt>B<printSelected>(FILEHANDLE, (STRING|REGEXP)s)
+
+=over 4
+
+See L<Mail::Message::Head::Complete/"Access to the header">
+
+=back
+
 $obj-E<gt>B<printUndisclosed>([FILEHANDLE])
 
 =over 4
@@ -520,8 +536,10 @@
 
 =back
 
-$obj-E<gt>B<messageIdPrefix>([STRING])
+$obj-E<gt>B<messageIdPrefix>([PREFIX, [HOSTNAME]|CODE])
 
+Mail::Message::Replace::MailHeader-E<gt>B<messageIdPrefix>([PREFIX, [HOSTNAME]|CODE])
+
 =over 4
 
 See L<Mail::Message::Head::Complete/"Internals">
@@ -563,9 +581,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Replace::MailHeader-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Replace::MailHeader-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -838,6 +856,9 @@
 L<delete()|Mail::Message::Replace::MailHeader/"Access to the header">, L<reset()|Mail::Message::Head::Complete/"Access to the header">, or L<set()|Mail::Message::Head::Complete/"Access to the header"> to do the job will not result
 in warnings: those methods check the existence of the field first.
 
+I<Warning:> Field objects have an implied name ($name)
+
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -860,7 +881,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::Replace::MailInternet;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message';
 
 use Mail::Box::FastScalar;
@@ -96,9 +96,6 @@
 }
 
 
-sub coerce() { confess }
-
-
 sub dup()
 {   my $self = shift;
     ref($self)->coerce($self->clone);
@@ -343,11 +340,13 @@
 }
 
 
-BEGIN { *Mail::Internet::new =
-          sub { my $class = shift;
-                Mail::Message::Replace::MailInternet->new(@_);
-              }
-      }
+BEGIN {
+ no warnings;
+ *Mail::Internet::new =
+    sub { my $class = shift;
+          Mail::Message::Replace::MailInternet->new(@_);
+        }
+}
 
 
 sub isa($)
@@ -357,5 +356,8 @@
 }
 
 
+sub coerce() { confess }
+
+
 1;
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Replace/MailInternet.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -13,7 +13,7 @@
 
 =head1 SYNOPSIS
 
- !!! VERY ALPHA CODE !!!
+ !!! BETA !!!
 
  # change
  use Mail::Internet;
@@ -30,7 +30,7 @@
 and many methods are added.
 
 Most methods will work without any change, but you may need to have
-a look at your L<smtpsend()|Mail::Message::Replace::MailInternet/"The body"> and L<send()|Mail::Message::Replace::MailInternet/"The Message"> calls.
+a look at your L<smtpsend()|Mail::Message::Replace::MailInternet/"The body"> and L<send()|Mail::Message::Replace::MailInternet/"The message"> calls.
 
 
 =head1 OVERLOADED
@@ -43,7 +43,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -51,16 +51,6 @@
 
 =back
 
-Mail::Message::Replace::MailInternet-E<gt>B<coerce>(MESSAGE)
-
-=over 4
-
-Coerce (adapt type) of the specified MESSAGE (anything
-L<Mail::Message::coerce()|Mail::Message/"Constructors"> accepts) into an Mail::Internet simulating
-object.
-
-=back
-
 $obj-E<gt>B<dup>
 
 =over 4
@@ -215,7 +205,7 @@
 
 =back
 
-Mail::Message::Replace::MailInternet-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Message::Replace::MailInternet-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -503,14 +493,14 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -518,7 +508,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -526,7 +516,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -534,7 +524,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -543,7 +533,7 @@
 =over 4
 
 Send an NNTP message (newsgroup message), which is equivalent to
-Mail::Transport::NNTP or L<Mail::Message::send()|Mail::Message/"The Message"> with C<via 'nntp'>.
+Mail::Transport::NNTP or L<Mail::Message::send()|Mail::Message/"The message"> with C<via 'nntp'>.
 
  Option  Defined in       Default           
  Debug                    <false>           
@@ -563,7 +553,7 @@
 =over 4
 
 Prints the whole message to the specified FILEHANDLE, which default to
-STDOUT.  This calls L<Mail::Message::print()|Mail::Message/"The Message">.
+STDOUT.  This calls L<Mail::Message::print()|Mail::Message/"The message">.
 
 =back
 
@@ -580,7 +570,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -588,7 +578,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -596,7 +586,7 @@
 
 =over 4
 
-See L<Mail::Message/"The Message">
+See L<Mail::Message/"The message">
 
 =back
 
@@ -903,7 +893,7 @@
 
 =over 4
 
-This method is calling L<Mail::Message::send()|Mail::Message/"The Message"> via C<smtp>, which is
+This method is calling L<Mail::Message::send()|Mail::Message/"The message"> via C<smtp>, which is
 implemented in L<Mail::Transport::SMTP|Mail::Transport::SMTP>.  The implementation is
 slightly different, so this method is not 100% compliant.
 
@@ -1047,7 +1037,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -1063,9 +1053,41 @@
 
 =back
 
+=head2 The nasty bits
+
+
+$obj-E<gt>B<isa>(CLASS)
+
+Mail::Message::Replace::MailInternet-E<gt>B<isa>(CLASS)
+
+=over 4
+
+Of course, the C<isa()> class inheritance check should not see our
+nasty trick.
+
+=back
+
 =head2 Internals
 
 
+$obj-E<gt>B<clonedFrom>
+
+=over 4
+
+See L<Mail::Message/"Internals">
+
+=back
+
+Mail::Message::Replace::MailInternet-E<gt>B<coerce>(MESSAGE)
+
+=over 4
+
+Coerce (adapt type) of the specified MESSAGE (anything
+L<Mail::Message::coerce()|Mail::Message/"Internals"> accepts) into an Mail::Internet simulating
+object.
+
+=back
+
 $obj-E<gt>B<isDelayed>
 
 =over 4
@@ -1141,9 +1163,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::Replace::MailInternet-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::Replace::MailInternet-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -1272,22 +1294,8 @@
 
 =back
 
-=head2 The nasty bits
 
 
-$obj-E<gt>B<isa>(CLASS)
-
-Mail::Message::Replace::MailInternet-E<gt>B<isa>(CLASS)
-
-=over 4
-
-Of course, the C<isa()> class inheritance check should not see our
-nasty trick.
-
-=back
-
-
-
 =head1 DIAGNOSTICS
 
 I<Error:> Cannot include forward source as $include.
@@ -1304,6 +1312,14 @@
 
 If a forward message is created, a destination address must be specified.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message::Replace::MailInternet/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -1312,6 +1328,14 @@
 not.  Probably you should investigate this and probably inform the author
 of the package.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Replace::MailInternet/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -1335,7 +1359,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::TransferEnc::Base64;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::TransferEnc';
 
 use MIME::Base64;
@@ -25,11 +25,7 @@
 sub decode($@)
 {   my ($self, $body, %args) = @_;
 
-    my $lines
-      = $body->isa('Mail::Message::Body::File')
-      ? $self->_decode_from_file($body)
-      : $self->_decode_from_lines($body);
-
+    my $lines = decode_base64($body->string);
     unless($lines)
     {   $body->transferEncoding('none');
         return $body;
@@ -47,21 +43,6 @@
      );
 }
 
-sub _decode_from_file($)
-{   my ($self, $body) = @_;
-    local $_;
-
-    my $in = $body->file || return;
-    my $unpacked = decode_base64(join '', $in->getlines);
-    $in->close;
-    $unpacked;
-}
-
-sub _decode_from_lines($)
-{   my ($self, $body) = @_;
-    join '', map { decode_base64($_) } $body->lines;
-}
-
 #------------------------------------------
 
 sub encode($@)

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Base64.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -124,9 +124,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::TransferEnc::Base64-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::TransferEnc::Base64-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -267,7 +267,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::TransferEnc::Binary;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::TransferEnc';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/Binary.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -112,9 +112,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::TransferEnc::Binary-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::TransferEnc::Binary-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -249,7 +249,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::TransferEnc::EightBit;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::TransferEnc';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/EightBit.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -123,9 +123,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::TransferEnc::EightBit-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::TransferEnc::EightBit-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -260,7 +260,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::TransferEnc::QuotedPrint;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::TransferEnc';
 
 use MIME::QuotedPrint;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/QuotedPrint.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -138,9 +138,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::TransferEnc::QuotedPrint-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::TransferEnc::QuotedPrint-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -275,7 +275,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::TransferEnc::SevenBit;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Message::TransferEnc';
 
 
@@ -34,7 +34,7 @@
     my $changes = 0;
 
     foreach ($body->lines)
-    {   $changes++ if s/[^\000-\127]/chr(ord($&) & 0x7f)/ge;
+    {   $changes++ if s/([^\000-\127])/chr(ord($1) & 0x7f)/ge;
         $changes++ if s/[\000\013]//g;
 
         $changes++ if length > 997;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc/SevenBit.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -124,9 +124,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::TransferEnc::SevenBit-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::TransferEnc::SevenBit-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -261,7 +261,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Message::TransferEnc;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/TransferEnc.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -186,9 +186,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message::TransferEnc-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message::TransferEnc-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -323,7 +323,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message::Wrapper::SpamAssassin;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::SpamAssassin::Message';
 
 use Carp;
@@ -32,7 +32,14 @@
 
 sub get_header($)
 {   my ($self, $name) = @_;
-    my $field = $self->get_mail_object->head->get($name);
+    my $head = $self->get_mail_object->head;
+
+    # Return all fields unfolded in list context
+    return map { $_->unfoldedBody } $head->get($name)
+        if wantarray;
+
+    # Only one field is expected
+    my $field = $head->get($name);
     defined $field ? $field->unfoldedBody : undef;
 }
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message/Wrapper/SpamAssassin.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -59,7 +59,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Message;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Mail::Message::Part;
@@ -15,6 +15,7 @@
 use Mail::Message::Body::Nested;
 
 use Carp;
+use Scalar::Util   'weaken';
 
 
 our $crlf_platform;
@@ -65,61 +66,23 @@
 #------------------------------------------
 
 
-my $mail_internet_converter;
-my $mime_entity_converter;
+sub clone(@)
+{   my ($self, %args) = @_;
 
-sub coerce($)
-{   my ($class, $message) = @_;
-
-    return bless $message, $class
-        if $message->isa(__PACKAGE__);
-
-    if($message->isa('MIME::Entity'))
-    {   unless($mime_entity_converter)
-        {   eval {require Mail::Message::Convert::MimeEntity};
-                confess "Install MIME::Entity" if $@;
-
-            $mime_entity_converter = Mail::Message::Convert::MimeEntity->new;
-        }
-
-        $message = $mime_entity_converter->from($message)
-            or return;
-    }
-
-    elsif($message->isa('Mail::Internet'))
-    {   unless($mail_internet_converter)
-        {   eval {require Mail::Message::Convert::MailInternet};
-            confess "Install Mail::Internet" if $@;
-
-           $mail_internet_converter = Mail::Message::Convert::MailInternet->new;
-        }
-
-        $message = $mail_internet_converter->from($message)
-            or return;
-    }
-
-    else
-    {   my $what = ref $message ? 'a'.ref($message).' object' : 'text';
-        confess "Cannot coerce $what into a ". __PACKAGE__." object.\n";
-    }
-
-    $message->{MM_modified}  ||= 0;
-    bless $message, $class;
-}
-
-#------------------------------------------
-
-
-sub clone()
-{   my $self  = shift;
-
     # First clone body, which may trigger head load as well.  If head is
     # triggered first, then it may be decided to be lazy on the body at
     # moment.  And then the body would be triggered.
 
+    my ($head, $body) = ($self->head, $self->body);
+    $head = $head->clone
+       unless $args{shallow} || $args{shallow_head};
+
+    $body = $body->clone
+       unless $args{shallow} || $args{shallow_body};
+
     my $clone = Mail::Message->new
-     ( body  => $self->body->clone
-     , head  => $self->head->clone
+     ( head  => $head
+     , body  => $body
      , $self->logSettings
      );
 
@@ -128,6 +91,10 @@
     delete $labels{deleted};
 
     $clone->{MM_labels} = \%labels;
+
+    $clone->{MM_cloned} = $self;
+    weaken($clone->{MM_cloned});
+
     $clone;
 }
 
@@ -197,11 +164,11 @@
 
     my %args = @_;
     if( ! $args{via} && defined $default_mailer )
-    {   $mailer = $default_mailer
+    {   $mailer = $default_mailer;
     }
     else
     {   my $via = delete $args{via} || 'sendmail';
-        $default_mailer = $mailer = Mail::Transport->new(via => $via);
+        $default_mailer = $mailer = Mail::Transport->new(via => $via, %args);
     }
 
     $mailer->send($self, %args);
@@ -228,7 +195,7 @@
         return undef;
     }
 
-    $self->log(INTERNAL => "wrong type of head for $self")
+    $self->log(INTERNAL => "wrong type of head for message $self")
         unless ref $head && $head->isa('Mail::Message::Head');
 
     $head->message($self);
@@ -248,7 +215,8 @@
 
 
 sub get($)
-{   my $field = shift->head->get(shift) || return undef;
+{   my $self  = shift;
+    my $field = $self->head->get(shift) || return undef;
     $field->body;
 }
 
@@ -263,7 +231,10 @@
 #-------------------------------------------
 
 
-sub from() { map {$_->addresses} shift->head->get('From') }
+sub from()
+{  my $from = shift->head->get('From') or return ();
+   map {$_->addresses} $from;
+}
 
 #-------------------------------------------
 
@@ -351,7 +322,7 @@
         return $body;
     }
 
-    $self->log(INTERNAL => "wrong type of body for $rawbody")
+    $self->log(INTERNAL => "wrong type of body for message $rawbody")
         unless ref $rawbody && $rawbody->isa('Mail::Message::Body');
 
     # Bodies of real messages must be encoded for safe transmission.
@@ -468,7 +439,7 @@
 #------------------------------------------
 
 
-sub label($;$)
+sub label($;$@)
 {   my $self   = shift;
     return $self->{MM_labels}{$_[0]} unless @_ > 1;
     my $return = $_[1];
@@ -568,6 +539,56 @@
 
 
 #------------------------------------------
+
+
+my $mail_internet_converter;
+my $mime_entity_converter;
+
+sub coerce($@)
+{   my ($class, $message) = @_;
+
+    return bless $message, $class
+        if $message->isa(__PACKAGE__);
+
+    if($message->isa('MIME::Entity'))
+    {   unless($mime_entity_converter)
+        {   eval {require Mail::Message::Convert::MimeEntity};
+                confess "Install MIME::Entity" if $@;
+
+            $mime_entity_converter = Mail::Message::Convert::MimeEntity->new;
+        }
+
+        $message = $mime_entity_converter->from($message)
+            or return;
+    }
+
+    elsif($message->isa('Mail::Internet'))
+    {   unless($mail_internet_converter)
+        {   eval {require Mail::Message::Convert::MailInternet};
+            confess "Install Mail::Internet" if $@;
+
+           $mail_internet_converter = Mail::Message::Convert::MailInternet->new;
+        }
+
+        $message = $mail_internet_converter->from($message)
+            or return;
+    }
+
+    else
+    {   my $what = ref $message ? 'a'.ref($message).' object' : 'text';
+        confess "Cannot coerce $what into a ". __PACKAGE__." object.\n";
+    }
+
+    $message->{MM_modified}  ||= 0;
+    bless $message, $class;
+}
+
+#------------------------------------------
+
+
+sub clonedFrom() { shift->{MM_cloned} }
+
+#------------------------------------------
 # All next routines try to create compatibility with release < 2.0
 sub isParsed()   { not shift->isDelayed }
 sub headIsRead() { not shift->head->isa('Mail::Message::Delayed') }
@@ -646,6 +667,7 @@
         , checked           => $self->{MM_trusted}
         , $self->logSettings
         );
+
         $body->contentInfoFrom($head);
     }
 
@@ -655,7 +677,7 @@
     $body->read
       ( $parser, $head, $getbodytype,
       , $size, (defined $lines ? int $lines->body : undef)
-      ) or return;
+      );
 }
 
 #------------------------------------------
@@ -715,10 +737,7 @@
 
 sub shortString()
 {   my $self    = shift;
-    my $subject = $self->head->get('subject') || '';
-    chomp $subject;
-
-    sprintf "%4s(%2d) %-30.30s", $self->shortSize, $subject;
+    sprintf "%4s %-30.30s", $self->shortSize, $self->subject;
 }
 
 #------------------------------------------

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Message.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -7,14 +7,14 @@
 =head1 INHERITANCE
 
  Mail::Message has extra code in
+   Mail::Message::Construct
+   Mail::Message::Construct::Rebuild
+   Mail::Message::Construct::Text
    Mail::Message::Construct::Forward
-   Mail::Message::Construct::Text
+   Mail::Message::Construct::Bounce
+   Mail::Message::Construct::Read
    Mail::Message::Construct::Build
-   Mail::Message::Construct::Rebuild
-   Mail::Message::Construct::Bounce
-   Mail::Message::Construct
    Mail::Message::Construct::Reply
-   Mail::Message::Construct::Read
 
  Mail::Message
    is a Mail::Reporter
@@ -70,7 +70,7 @@
 =head2 Constructors
 
 
-$obj-E<gt>B<clone>
+$obj-E<gt>B<clone>(OPTIONS)
 
 =over 4
 
@@ -87,56 +87,49 @@
 
 See also L<Mail::Box::Message::copyTo()|Mail::Box::Message/"The message"> and L<Mail::Box::Message::moveTo()|Mail::Box::Message/"The message">.
 
-I<Example:> 
+ Option        Defined in       Default
+ shallow                        <false>
+ shallow_body                   <false>
+ shallow_head                   <false>
 
- $copy = $msg->clone;
+. shallow BOOLEAN
 
+=over 4
+
+When a shallow clone is made, the header and body of the message will not
+be cloned, but shared.  This is quite dangerous: for instance in some
+folder types, the header fields are used to store folder flags.  When
+one of both shallow clones change the flags, that will update the header
+and thereby be visible in both.
+
+There are situations where a shallow clone can be used safely.  For instance,
+when L<Mail::Box::Message::moveTo()|Mail::Box::Message/"The message"> is used and you are sure that the
+original message cannot get undeleted after the move.
+
 =back
 
-Mail::Message-E<gt>B<coerce>(MESSAGE)
+. shallow_body BOOLEAN
 
 =over 4
 
-Coerce a MESSAGE into a Mail::Message.  In some
-occasions, for instance where you add a message to a folder, this
-coercion is automatically called to ensure that the correct message
-type is stored.
+A rather safe bet, because you are not allowed to modify the body of a
+message: you may only set a new body with L<body()|Mail::Message/"The body">.
 
-The coerced message is returned on success, otherwise C<undef>.  The
-coerced message may be a reblessed version of the original message
-or a new object.  In case the message has to be specialized, for
-instance from a general Mail::Message into a Mail::Box::Mbox::Message,
-no copy is needed.  However, to coerce a Mail::Internet object into
-a Mail::Message, a lot of copying and converting will take place.
+=back
 
-Valid MESSAGEs which can be coerced into Mail::Message objects
-are of type
+. shallow_head BOOLEAN
 
 =over 4
 
-=item * Any type of L<Mail::Box::Message|Mail::Box::Message>
+Only the head uses is reused, not the body.  This is probably a bad choice,
+because the header fields can be updated, for instance when labels change.
 
-=item * MIME::Entity's, using L<Mail::Message::Convert::MimeEntity|Mail::Message::Convert::MimeEntity>
-
-=item * Mail::Internet's, using L<Mail::Message::Convert::MailInternet|Mail::Message::Convert::MailInternet>
-
 =back
 
-L<Mail::Message::Part|Mail::Message::Part>'s, which are extensions of C<Mail::Message>'s,
-can also be coerced directly from a L<Mail::Message::Body|Mail::Message::Body>.
-
 I<Example:> 
 
- my $folder  = Mail::Box::Mbox->new;
- my $message = Mail::Message->build(...);
+ $copy = $msg->clone;
 
- my $coerced = Mail::Box::Mbox::Message->coerce($message);
- $folder->addMessage($coerced);
-
-Simpler replacement for the previous two lines:
-
- my $coerced = $folder->addMessage($message);
-
 =back
 
 Mail::Message-E<gt>B<new>(OPTIONS)
@@ -209,7 +202,7 @@
 
 Initial values of the labels.  In case of L<Mail::Box::Message|Mail::Box::Message>'s, this
 shall reflect the state the message is in.  For newly constructed
-L<Mail::Message|Mail::Message>'s, this may be anything you want, because L<coerce()|Mail::Message/"Constructors">
+L<Mail::Message|Mail::Message>'s, this may be anything you want, because L<coerce()|Mail::Message/"Internals">
 will take care of the folder specifics once the message is added to one.
 
 =back
@@ -261,7 +254,7 @@
 
 =back
 
-Mail::Message-E<gt>B<build>([MESSAGE|BODY], CONTENT)
+Mail::Message-E<gt>B<build>([MESSAGE|PART|BODY], CONTENT)
 
 =over 4
 
@@ -383,7 +376,7 @@
 
 =back
 
-=head2 The Message
+=head2 The message
 
 
 $obj-E<gt>B<container>
@@ -448,7 +441,7 @@
 
 Print the message to the FILE-HANDLE, which defaults to the selected
 filehandle, without the encapsulation sometimes required by a folder
-type, like L<write()|Mail::Message/"The Message"> does.
+type, like L<write()|Mail::Message/"The message"> does.
 
 I<Example:> 
 
@@ -496,8 +489,8 @@
 =over 4
 
 Returns an estimated size of the whole message in bytes.  In many occasions,
-the functions which process the message further, for instance L<send()|Mail::Message/"The Message">
-or L<print()|Mail::Message/"The Message"> will need to add/change header lines or add CR characters,
+the functions which process the message further, for instance L<send()|Mail::Message/"The message">
+or L<print()|Mail::Message/"The message"> will need to add/change header lines or add CR characters,
 so the size is only an estimate with a few percent margin of the real
 result.
 
@@ -527,7 +520,7 @@
 FILEHANDLE, with all surrounding information which is needed to put
 it correctly in a folder file.
 
-In most cases, the result of C<write> will be the same as with L<print()|Mail::Message/"The Message">.
+In most cases, the result of C<write> will be the same as with L<print()|Mail::Message/"The message">.
 The main exception is for Mbox folder messages, which will get printed
 with their leading 'From ' line and a trailing blank.  Each line of
 their body which starts with 'From ' will have an 'E<gt>' added in front.
@@ -583,13 +576,14 @@
 
 =over 4
 
-Returns the address of the sender.  It is possible to have more than
-one address specified in the C<From> field of the message. Therefore a
-list of Mail::Address objects is returned, which usually has
-length 1.
+Returns the addresses from the senders.  It is possible to have more than
+one address specified in the C<From> field of the message, according
+to the specification. Therefore a list of Mail::Address objects is
+returned, which usually has length 1.
 
-If you need one address of a sender, for instance to create a reply to,
-then use L<sender()|Mail::Message/"The header">.
+If you need only one address from a sender, for instance to create a
+"original message by" line in constructed forwarded message body, then use
+L<sender()|Mail::Message/"The header">.
 
 I<Example:> using from() to get all sender addresses
 
@@ -735,8 +729,8 @@
 
 To start, the received headers are tried for a date (see
 L<Mail::Message::Head::Complete::recvstamp()|Mail::Message::Head::Complete/"About the body">) and only then the C<Date>
-field.  When no date was found, C<undef> will be returned.  This may be
-very usual, because MailBox message constructors add a Date automatically.
+field.  In very rare cases, only with some locally produced messages,
+no stamp can be found.
 
 =back
 
@@ -1066,7 +1060,7 @@
 
 =back
 
-$obj-E<gt>B<printStructure>([FILEHANDLE][, INDENT])
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
 
 =over 4
 
@@ -1085,6 +1079,61 @@
 =head2 Internals
 
 
+$obj-E<gt>B<clonedFrom>
+
+=over 4
+
+Returns the MESSAGE which is the source of this message, which was
+created by a L<clone()|Mail::Message/"Constructors"> operation.
+
+=back
+
+Mail::Message-E<gt>B<coerce>(MESSAGE, OPTIONS)
+
+=over 4
+
+Coerce a MESSAGE into a Mail::Message.  In some
+occasions, for instance where you add a message to a folder, this
+coercion is automatically called to ensure that the correct message
+type is stored.
+
+The coerced message is returned on success, otherwise C<undef>.  The
+coerced message may be a reblessed version of the original message
+or a new object.  In case the message has to be specialized, for
+instance from a general Mail::Message into a Mail::Box::Mbox::Message,
+no copy is needed.  However, to coerce a Mail::Internet object into
+a Mail::Message, a lot of copying and converting will take place.
+
+Valid MESSAGEs which can be coerced into Mail::Message objects
+are of type
+
+=over 4
+
+=item * Any type of L<Mail::Box::Message|Mail::Box::Message>
+
+=item * MIME::Entity's, using L<Mail::Message::Convert::MimeEntity|Mail::Message::Convert::MimeEntity>
+
+=item * Mail::Internet's, using L<Mail::Message::Convert::MailInternet|Mail::Message::Convert::MailInternet>
+
+=back
+
+L<Mail::Message::Part|Mail::Message::Part>'s, which are extensions of C<Mail::Message>'s,
+can also be coerced directly from a L<Mail::Message::Body|Mail::Message::Body>.
+
+I<Example:> 
+
+ my $folder  = Mail::Box::Mbox->new;
+ my $message = Mail::Message->build(...);
+
+ my $coerced = Mail::Box::Mbox::Message->coerce($message);
+ $folder->addMessage($coerced);
+
+Simpler replacement for the previous two lines:
+
+ my $coerced = $folder->addMessage($message);
+
+=back
+
 $obj-E<gt>B<isDelayed>
 
 =over 4
@@ -1183,9 +1232,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Message-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Message-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -1269,8 +1318,9 @@
 
 =over 4
 
-Convert the message header to a short string, representing the most
-important facts (for debugging purposes only).
+Convert the message header to a short string (without trailing newline),
+representing the most important facts (for debugging purposes only).  For
+now, it only reports size and subject.
 
 =back
 
@@ -1355,10 +1405,18 @@
 
 I<Error:> No default mailer found to send message.
 
-The message L<send()|Mail::Message/"The Message"> mechanism had not enough information to automatically
+The message L<send()|Mail::Message/"The message"> mechanism had not enough information to automatically
 find a mail transfer agent to sent this message.  Specify a mailer
 explicitly using the C<via> options.
 
+I<Error:> Only build() Mail::Message's; they are not in a folder yet
+
+You may wish to construct a message to be stored in a some kind
+of folder, but you need to do that in two steps.  First, create a
+normal L<Mail::Message|Mail::Message>, and then add it to the folder.  During this
+L<Mail::Box::addMessage()|Mail::Box/"The folder"> process, the message will get L<coerce()|Mail::Message/"Internals">-d
+into the right message type, adding storage information and the like.
+
 I<Error:> Package $package does not implement $method.
 
 Fatal error: the specific package (or one of its superclasses) does not
@@ -1367,6 +1425,14 @@
 not.  Probably you should investigate this and probably inform the author
 of the package.
 
+I<Error:> bounce requires To, Cc, or Bcc
+
+The message L<bounce()|Mail::Message::Construct::Bounce/"Constructing a message"> method forwards a received message off to someone
+else without modification; you must specified it's new destination.
+If you have the urge not to specify any destination, you probably
+are looking for L<reply()|Mail::Message::Construct::Reply/"Constructing a message">. When you wish to modify the content, use
+L<forward()|Mail::Message::Construct::Forward/"Constructing a message">.
+
 I<Error:> forwardAttach requires a preamble object
 
 
@@ -1544,6 +1610,11 @@
 be set by MailBox, because it would probably conflict with the user's
 idea of what is old.
 
+=item * passed
+
+Not often used or kept, this flag indicates that the message was bounced
+or forwarded to someone else.
+
 =item * replied
 
 The user (or application) has sent a message back to the sender of
@@ -1589,7 +1660,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Reporter;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 
 use Carp;
 use Scalar::Util 'dualvar';
@@ -23,9 +23,7 @@
     (bless {}, $class)->init({@_});
 }
 
-my $default_log   = $levelprio{WARNINGS};
-my $default_trace = $levelprio{WARNINGS};
-
+my($default_log, $default_trace, $trace_callback);
 sub init($)
 {   my ($self, $args) = @_;
     $self->{MR_log}   = $levelprio{$args->{log}   || $default_log};
@@ -36,26 +34,45 @@
 #------------------------------------------
 
 
+sub _trace_warn($$$)
+{   my ($who, $level, $text) = @_;
+    warn "$level: $text\n";
+}
+
 sub defaultTrace(;$$)
 {   my $thing = shift;
 
-    if(@_)
-    {   my ($log, $trace) = @_==1 ? ($_[0], $_[0]) : @_;
+    return ($default_log, $default_trace)
+        unless @_;
 
-        $default_log   = $levelprio{$log}
-           or croak "Undefined log level $log";
+    my $level = shift;
+    my $prio  = $thing->logPriority($level)
+        or croak "Unknown trace-level $level.";
 
-        $default_trace = $levelprio{$trace}
-           or croak "Undefined trace level $trace";
+    if( ! @_)
+    {   $default_log    = $default_trace = $prio;
+        $trace_callback = \&_trace_warn;
     }
+    elsif(ref $_[0])
+    {   $default_log    = $thing->logPriority('NONE');
+        $default_trace  = $prio;
+        $trace_callback = shift;
+    }
+    else
+    {   $default_log    = $prio;
+        $default_trace  = $thing->logPriority(shift);
+        $trace_callback = \&_trace_warn;
+    }
 
-    ( $thing->logPriority($default_log), $thing->logPriority($default_trace) );
+    ($default_log, $default_trace);
 }
 
+__PACKAGE__->defaultTrace('WARNINGS');
+
 #------------------------------------------
 
 
-sub trace(;$)
+sub trace(;$$)
 {   my $self = shift;
 
     return $self->logPriority($self->{MR_trace})
@@ -71,9 +88,9 @@
 #------------------------------------------
 
 
-# Implementation detail: the C code avoids calls back to Perl by
-# checking the trace-level itself.  In the perl code of this module
-# however, just always call the log() method, and let it check
+# Implementation detail: the Mail::Box::Parser::C code avoids calls back
+# to Perl by checking the trace-level itself.  In the perl code of this
+# module however, just always call the log() method, and let it check
 # whether or not to display it.
 
 sub log(;$@)
@@ -87,12 +104,11 @@
         my $prio  = $levelprio{$level}
             or croak "Unknown log-level $level";
 
-        return $thing->{MR_log} = $prio unless @_;
+        return $thing->{MR_log} = $prio
+            unless @_;
 
         my $text    = join '', @_;
-        $text      .= "\n" unless (substr $text, -1) eq "\n";
-
-        warn "$level: $text"
+        $trace_callback->($thing, $level, $text)
             if $prio >= $thing->{MR_trace};
 
         push @{$thing->{MR_report}[$prio]}, $text
@@ -103,12 +119,8 @@
         my $prio  = $levelprio{$level}
             or croak "Unknown log-level $level";
 
-        return $thing unless $prio >= $default_trace;
-
-        my $text    = join '', @_;
-        $text      .= "\n" unless (substr $text, -1) eq "\n";
-
-        warn "$level: $text";
+        $trace_callback->($thing, $level, join('', at _)) 
+           if $prio >= $default_trace;
     }
 
     $thing;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Reporter.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -96,33 +96,52 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Reporter-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Reporter-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
-Reports the default trace and log LEVEL which is used for object as list
+Reports the default log and trace level which is used for object as list
 of two elements.  When not explicitly set, both are set to C<WARNINGS>.
-Two values are returned: the first is the log level, the second represents
-the trace level.  Both are special variables: in numeric context they
-deliver a value (the internally used value), and in string context the
-string name.  Be warned that the string is always singular!
 
-You may specify one or two arguments.  In case of one argument, the
-default log and trace levels will both be set to that value.  When two
-levels are specified, the first represent the default log-level and
-the second the default trace level.
+This method has three different uses. When one argument is specified, that
+LEVEL is set for both loglevel as tracelevel.
 
-I<Example:> 
+With two arguments, the second determines which configuration you like.  If
+the second argument is a CODE reference, you install a CALLBACK.  The loglevel
+will be set to NONE, and all warnings produced in your program will get
+passed to the CALLBACK function.  That function will get the problem level,
+the object or class which reports the problem, and the problem text passed
+as arguments.
 
+In any case two values are returned: the first is the log level, the
+second represents the trace level.  Both are special variables: in numeric
+context they deliver a value (the internally used value), and in string
+context the string name.  Be warned that the string is always in singular
+form!
+
+I<Example:> setting loglevels
+
+
  my ($loglevel, $tracelevel) = Mail::Reporter->defaultTrace;
  Mail::Reporter->defaultTrace('NOTICES');
 
  my ($l, $t) = Mail::Reporter->defaultTrace('WARNINGS', 'DEBUG');
  print $l;     # prints "WARNING"  (no S!)
  print $l+0;   # prints "4"
+ print "Auch" if $l >= $self->logPriority('ERROR');
 
+ Mail::Reporter->defaultTrace('NONE');  # silence all reports
+
+ $folder->defaultTrace('DEBUG');   # Still set as global default!
+ $folder->trace('DEBUG');          # local default
+
+I<Example:> installing a callback
+
+
+ Mail::Reporter->defaultTrace
+
 =back
 
 $obj-E<gt>B<errors>
@@ -338,7 +357,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,289 @@
+
+use strict;
+use warnings;
+
+package Mail::Server::IMAP4::Fetch;
+use vars '$VERSION';
+$VERSION = '2.060';
+
+use Date::Parse;
+use Digest::MD5   qw/md5_base64/;
+
+
+sub new($)
+{   my ($class, $part, %args) = @_;
+
+    my $head  = $part->head;
+    my $body  = $part->body;
+    
+    my $type  = $body->type;
+
+    my $self  = bless
+      { type        => $type->body
+      , typeattr    => [ $type->attributes ]
+      , charset     => $body->charset
+      , bodylines   => $body->nrLines
+      , bodysize    => $body->size
+      }, $class;
+
+    $self->{headbegin} = ($head->fileLocation)[0];
+    @{$self}{qw/bodybegin bodyend/} = $body->fileLocation;
+
+    # The fields use the defined() check, to avoid accidental expensive
+    # stringification by the field objects.
+
+    my ($field, $value);
+    $self->{date}         = $field->unfoldedBody
+        if defined($field = $head->get('Date'));
+
+    $self->{subject}      = $field->unfoldedBody
+        if defined($field = $head->get('Subject'));
+
+    $self->{description}  = $field->unfoldedBody
+        if defined($field = $head->get('Content-Description'));
+
+    $self->{language}     = $field->unfoldedBody
+        if defined($field = $head->get('Content-Language'));
+
+    $self->{filename}     = $value
+        if defined($value = $body->dispositionFilename);
+
+    $self->{bodyMD5}      = md5_base64($body->string)
+        if $args{md5checksums};
+
+    if(defined($field = $body->transferEncoding))
+    {   my $tf            = $field->unfoldedBody;
+        $self->{transferenc} = $tf unless $tf eq 'none';
+    }
+
+# Should become:
+#   $self->{disposition} = [ $field->body, $field->study->attributes ]
+    if(defined($field = $body->disposition))
+    {   my $how = $field->body;
+        $how = $body->isText ? 'inline' : 'attachment' if $how eq 'none';
+        $self->{disposition} = [ $how, $field->attributes ];
+    }
+    else
+    {   $self->{disposition} = [ ($body->isText ? 'inline' : 'attachment') ];
+    }
+
+    my $id = $head->get('Content-Message-ID') || $head->get("Message-ID");
+    if(defined $id)
+    {   my $msgid = $id->unfoldedBody;
+        $msgid =~ s/^\<*/</;
+        $msgid =~ s/\>*$/>/;
+        $self->{messageid} = $msgid if length $msgid;
+    }
+
+    foreach my $addr ( qw/to from sender reply-to cc bcc/ )
+    {   my $addrs = $head->study($addr) or next;
+        foreach my $group ($addrs->groups)
+        {   my @addrs = map { [ $_->phrase, $_->username, $_->domain ] }
+               $group->addresses;
+
+            push @{$self->{$addr}}, [ $group->name, @addrs ];
+        }
+    }
+
+    if($body->isMultipart)
+    {   $self->{parts} = [ map { $class->new($_) } $body->parts ];
+    }
+    elsif($body->isNested)
+    {   $self->{nest}  = $class->new($body->nested);
+    }
+
+    $self;
+}
+
+#------------------------------------------
+
+
+sub headLocation() { @{ (shift) }{ qw/headbegin bodybegin/ } }
+sub bodyLocation() { @{ (shift) }{ qw/bodybegin bodyend/ } }
+sub partLocation() { @{ (shift) }{ qw/headbegin bodyend/ } }
+
+#------------------------------------------
+
+
+sub fetchBody($)
+{   my ($self, $extended) = @_;
+
+    my $type = uc $self->{type};
+    my ($mediatype, $subtype) = split m[/], $type;
+
+    if($self->{parts})
+    {   # Multipart message
+        # WARNING: no blanks between part descriptions
+        my $parts  = join '', map {$_->fetchBody($extended)} @{$self->{parts}};
+        my @fields = (\$parts, $subtype || 'MIXED');
+
+        if($extended)     # only included when any valid info
+        {   my @attr;     # don't know what to include here
+            my @disp;     # don't know about this either
+
+            push @fields, \@attr, \@disp, $self->{language}
+                if @attr || @disp || defined $self->{language};
+        }
+
+        return $self->_imapList(@fields);
+    }
+
+    #
+    # Simple message
+    #
+
+    my @fields = ( ($mediatype || 'TEXT')
+                 , ($subtype   || 'PLAIN')
+                 , $self->{typeattr}
+                 , $self->{messageid}
+                 , $self->{description}
+                 , uc($self->{transferenc} || '8BIT')
+                 , \($self->{bodysize})
+                 );
+
+    if(my $nest = $self->{nest})
+    {   # type MESSAGE (message/rfc822 encapsulated)
+        push @fields, \$nest->fetchEnvelope,
+                    , \$nest->fetchBody($extended);
+    }
+
+    push @fields, \$self->{bodylines};
+
+    if(   $extended
+       && ($self->{bodyMD5} || $self->{disposition} || $self->{language})
+      )
+    {   push @fields, @{$self}{ qw/bodyMD5 disposition language/ };
+    }
+
+    $self->_imapList(@fields);
+}
+
+#------------------------------------------
+
+
+sub fetchEnvelope()
+{   my $self   = shift;
+    my @fields = ($self->{date}, $self->{subject});
+
+    foreach my $addr ( qw/from sender reply-to to cc bcc/ )
+    {   unless($self->{$addr})
+        {   push @fields, undef;  # NIL
+            next;
+        }
+
+        # For now, group information is ignored... RFC2060 is very
+        # unclear about it... and seems incompatible with RFC2822
+        my $addresses = '';
+        foreach my $group (@{$self->{$addr}})
+        {   my ($name, @addr) = @$group;
+
+            # addr_adl is obsoleted by rfc2822
+            $addresses .= $self->_imapList($_->[0], undef, $_->[1], $_->[2])
+               foreach @addr;
+        }
+
+        push @fields, \$addresses;
+    }
+
+    push @fields, $self->{'in-reply-to'}, $self->{messageid};
+
+    $self->_imapList(@fields);
+}
+
+#------------------------------------------
+
+
+sub fetchSize() { shift->{bodysize} }
+
+#------------------------------------------
+
+
+sub part(;$)
+{   my $self = shift;
+    my $nr   = shift or return $self;
+
+    my @nrs  = split /\./, $nr;
+    while(@nrs)
+    {   my $take = shift @nrs;
+        if(exists $self->{nest} && $take==1)
+	{   $self = $self->{nest} }
+	elsif(exists $self->{parts} && @{$self->{parts}} >= $take)
+	{   $self = $self->{parts}[$take-1] }
+	else { return undef }
+    }
+
+    $self;
+}
+
+#------------------------------------------
+
+
+sub printStructure(;$$)
+{   my $self    = shift;
+
+    my $fh      = @_ ? shift : select;
+    my $number  = @_ ? shift : '';
+
+    my $buffer;   # only filled if filehandle==undef
+    open $fh, '>', \$buffer unless defined $fh;
+
+    my $type    = $self->{type};
+    my $subject = $self->{subject} || '';
+    my $text    = "$number $type: $subject\n";
+
+    my $hbegin  = $self->{headbegin} || 0;
+    my $bbegin  = $self->{bodybegin} || '?';
+    my $bodyend = $self->{bodyend}   || '?';
+    my $size    = defined $self->{bodysize}  ? $self->{bodysize}  : '?';
+    my $lines   = defined $self->{bodylines} ? $self->{bodylines} : '?';
+
+    $text      .= ' ' x (length($number) + 1);
+    $text      .= "@ $hbegin-$bbegin-$bodyend, $size bytes, $lines lines\n";
+
+    ref $fh eq 'GLOB' ? (print $fh $text) : $fh->print($text);
+
+    if($self->{nest})
+    {   $self->{nest}->printStructure($fh, length($number) ? $number.'.1' :'1');
+    }
+    elsif($self->{parts})
+    {   my $count = 1;
+        $number  .= '.' if length $number;
+        $_->printStructure($fh, $number.$count++)
+           foreach @{$self->{parts}};
+    }
+
+    $buffer;
+}
+
+#------------------------------------------
+
+
+# Concatenate the elements of a list, as the IMAP protocol does.
+# ARRAYS are included a sublist, and normal strings get quoted.
+# Pass a ref-scalar if something needs to be included without
+# quoting.
+
+sub _imapList(@)
+{   my $self = shift;
+    my @f;
+
+    foreach (@_)
+    {      if(ref $_ eq 'ARRAY')  { push @f, $self->_imapList(@$_) }
+        elsif(ref $_ eq 'SCALAR') { push @f, ${$_} }
+        elsif(!defined $_)        { push @f, 'NIL' }
+        else
+        {    my $copy = $_;
+             $copy =~ s/\\/\\\\/g;
+             $copy =~ s/\"/\\"/g;
+             push @f, qq#"$_"#;
+        }
+    }
+
+    local $" = ' ';
+    "(@f)";
+}
+
+#------------------------------------------
+
+
+1;

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Fetch.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,166 @@
+
+=head1 NAME
+
+Mail::Server::IMAP4::Fetch - message info for IMAP protocol speed-up
+
+
+
+=head1 SYNOPSIS
+
+ my $imap = Mail::Server::IMAP4::Fetch->new($msg);
+ print $imap->fetchBody(1);   # for FETCH BODYSTRUCTURE
+ print $imap->fetchBody;      # for FETCH BODY
+ print $imap->fetchEnvelope;  # for FETCH ENVELOPE
+ print $imap->fetchSize;
+
+
+=head1 DESCRIPTION
+
+Create a new object hierarchy, which contains information to capture
+the most important details about the message.  The object can be used
+to speed-up IMAP-server implementations, as L<Mail::Box::Netzwert>.
+
+The object used here is a simplified representation of a
+L<Mail::Box::Message|Mail::Box::Message> object.  It does not maintain headers and does
+not refer to the folder.  It only works with messages stored in a file.
+Therefore, this object can be frozen by L<Storable> if you want to.
+
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Server::IMAP4::Fetch-E<gt>B<new>(MESSAGE|PART, OPTIONS)
+
+=over 4
+
+ Option        Defined in  Default
+ md5checksums              0      
+
+. md5checksums BOOLEAN
+
+=back
+
+=head2 Attributes
+
+
+$obj-E<gt>B<bodyLocation>
+
+=over 4
+
+=back
+
+$obj-E<gt>B<headLocation>
+
+=over 4
+
+=back
+
+$obj-E<gt>B<partLocation>
+
+=over 4
+
+=back
+
+=head2 IMAP Commands
+
+
+$obj-E<gt>B<fetchBody>(EXTENDED)
+
+=over 4
+
+Returns one string, representing the message's structure as defined by
+the IMAP protocol.  The boolean argument indicates whether you like to
+have the EXTENDED information, as the imap command 'FETCH BODYSTRUCTURE'
+defines or the limited information of 'FETCH BODY'.
+
+=back
+
+$obj-E<gt>B<fetchEnvelope>
+
+=over 4
+
+Returns a string representation of some header information.
+
+=back
+
+$obj-E<gt>B<fetchSize>
+
+=over 4
+
+Returns the size of the message body.
+
+=back
+
+$obj-E<gt>B<part>([PARTNR])
+
+=over 4
+
+The partnummer is a list of dot-separated positive integers, numbering
+(nested) parts in multi-part message bodies.  By default, the info of
+the main message is returned.
+
+I<Example:> 
+
+ my $partinfo = $msg->info->part('1.2.1');
+ print $msg->info->part('3.3')->fetchBody;
+
+=back
+
+$obj-E<gt>B<printStructure>([FILEHANDLE|undef, [NUMBER]])
+
+=over 4
+
+Print the structure of the fetch data to the specified FILEHANDLE or the
+selected filehandle.  When explicitly C<undef> is specified as handle,
+then the output will be returned as string.  
+Only a limited set of the information is displayed.
+
+I<Example:> 
+
+ my $imap = ...;
+ $imap->printStructure(\*OUTPUT);
+ $imap->printStructure;
+ my $struct = $imap->printStructure(undef);
+
+=back
+
+=head2 Internals
+
+
+
+
+
+=head1 DETAILS
+
+See
+
+=over 4
+
+=item RFC2060: "Internet Message Access Protocol IMAP4v1" section 7.4.2
+
+=item RFC2045: "MIME Part One: Format of Internet Message Bodies".
+=back
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,118 @@
+
+use strict;
+use warnings;
+
+package Mail::Server::IMAP4::List;
+use vars '$VERSION';
+$VERSION = '2.060';
+
+
+sub new($)
+{   my ($class, %args) = @_;
+
+    my $self = bless {}, $class;
+
+    my $user = $self->{MSIL_user}  = $args{user};
+    $self->{MSIL_folders} = $args{folders};
+    $self->{MSIL_inbox}   = $args{inbox};
+    $self->{MSIL_delim}   = exists $args{delimiter} ? $args{delimiter} : '/';
+    $self;
+}
+
+#------------------------------------------
+
+
+sub delimiter(;$)
+{   my $delim = shift->{MSIL_delim};
+    ref $delim ? $delim->(shift) : $delim;
+}
+
+#------------------------------------------
+
+
+sub user() { shift->{MSIL_user} }
+
+#------------------------------------------
+
+
+sub folders()
+{   my $self = shift;
+    $self->{MSIL_folders} || $self->user->topfolder;
+}
+
+#------------------------------------------
+
+
+sub inbox()
+{   my $self = shift;
+    $self->{MSIL_inbox} || $self->user->inbox;
+}
+
+#------------------------------------------
+
+
+sub list($$)
+{   my ($self, $base, $pattern) = @_;
+    
+    return [ '(\Noselect)', $self->delimiter($base), '' ]
+       if $pattern eq '';
+
+    my $delim  = $self->delimiter($base);
+    my @path   = split $delim, $base;
+    my $folder = $self->folders;
+
+    while(@path && defined $folder)
+    {   $folder = $folder->folder(shift @path);
+    }
+    defined $folder or return ();
+
+    my @pattern = split $delim, $pattern;
+    return $self->_list($folder, $delim, @pattern);
+}
+
+sub _list($$@)
+{   my ($self, $folder, $delim) = (shift, shift, shift);
+
+    if(!@_)
+    {   my @flags;
+        push @flags, '\Noselect'
+           if $folder->onlySubfolders || $folder->deleted;
+
+        push @flags, '\Noinferiors' unless $folder->inferiors;
+        my $marked = $folder->marked;
+        push @flags, ($marked ? '\Marked' : '\Unmarked')
+            if defined $marked;
+
+        local $" = ' ';
+
+        # This is not always correct... should compose the name from the
+        # parts... but in nearly all cases, the following is sufficient.
+        my $name = $folder->fullname;
+        for($name)
+        {    s/^=//;
+             s![/\\]!$delim!g;
+        }
+        return [ "(@flags)", $delim, $name ];
+    }
+
+    my $pat = shift;
+    if($pat eq '%')
+    {   my $subs = $folder->subfolders
+             or return $self->_list($folder, $delim);
+        return map { $self->_list($_, $delim, @_) } $subs->sorted;
+    }
+
+    if($pat eq '*')
+    {   my @own = $self->_list($folder, $delim, @_);
+        my $subs = $folder->subfolders or return @own;
+        return @own, map { $self->_list($_, $delim, '*', @_) } $subs->sorted;
+    }
+
+    $folder = $folder->find(subfolders => $pat) or return ();
+    $self->_list($folder, $delim, @_);
+}
+
+#------------------------------------------
+
+
+1;

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/List.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,199 @@
+
+=head1 NAME
+
+Mail::Server::IMAP4::List - folder related IMAP4 answers
+
+
+
+=head1 SYNOPSIS
+
+ my $imap = Mail::Server::IMAP4::List->new
+   ( folders   => $folders   # Mail::Box::Identity
+   , inbox     => $inbox     # Mail::Box
+   , delimiter => '#'
+   );
+
+ my $imap = Mail::Server::IMAP4::List->new(user => $user);
+ print $imap->list(...);        # for LIST command
+
+
+=head1 DESCRIPTION
+
+
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Server::IMAP4::List-E<gt>B<new>(USER)
+
+=over 4
+
+Create a (temporary) object to handle the LIST requests for
+a certain user, based upon a set of folders.  The data is kept by
+L<Mail::Box::Identity|Mail::Box::Identity> and L<Mail::Box::Collection|Mail::Box::Collection> objects, which
+mean that the folders will not be opened to answer these questions.
+
+ Option     Defined in       Default    
+ delimeter                   '/'        
+ folders                     <from user>
+ inbox                       <from user>
+ user                        <undef>    
+
+. delimeter STRING|CODE
+
+=over 4
+
+Either the constant delimiter, or a code reference which will get passed
+a folder name and should return the delimiter string used in that name.
+If that folder name is empty, the default delimiter must be reported.
+See L<delimiter()|Mail::Server::IMAP4::List/"Attributes"> for an example.
+
+=back
+
+. folders OBJECT
+
+=over 4
+
+You need to specify either a set of folders explicitly or via the
+user. Some L<Mail::Box::Identity|Mail::Box::Identity> OBJECT is needed.
+
+=back
+
+. inbox BOOLEAN
+
+=over 4
+
+For now, only used to see whether there is an inbox, so a truth value will
+do.  This may change in the future.  By default, the flag is set if
+C<$user->inbox> is defined.
+
+=back
+
+. user OBJECT
+
+=over 4
+
+A L<Mail::Box::Manage::User|Mail::Box::Manage::User> OBJECT, representing the user who's folders
+must get reported.
+
+=back
+
+=back
+
+=head2 Attributes
+
+
+$obj-E<gt>B<delimiter>([FOLDERNAME])
+
+=over 4
+
+Returns the delimiter string.  The foldername is only required when a
+CODE reference was specified at initiation.
+
+I<Example:> setting-up an IMAP4 delimeter
+
+
+ sub delim($)
+ {   my $path = shift;
+     my ($delim, $root)
+       = $path =~ m/^(#news\.)/ ? ('.', $1)
+       = $path =~ m!^/!         ? ('/', '/')
+       :                          ('/', '');
+
+     wantarray ? ($delim, $root) : $delim;
+ }
+
+ my $list = Mail::Server::IMAP4::List->new(delimiter => \&delim, ...);
+ print $list->delimiter('abc/xyz');      # returns a / (slash) and ''
+ print $list->delimiter('#news.feed');   # returns a . (dot)   and $news.
+ print $list->delimiter('');             # returns default delimiter
+
+=back
+
+$obj-E<gt>B<folders>
+
+=over 4
+
+Returns the L<Mail::Box::Identity|Mail::Box::Identity> of the toplevel folder.
+
+=back
+
+$obj-E<gt>B<inbox>
+
+=over 4
+
+Returns the L<Mail::Box|Mail::Box> or filename of the INBOX.
+
+=back
+
+$obj-E<gt>B<user>
+
+=over 4
+
+Returns the L<Mail::Box::Manage::User|Mail::Box::Manage::User> object, if defined.
+
+=back
+
+=head2 IMAP Commands
+
+
+$obj-E<gt>B<list>(BASE, PATTERN)
+
+=over 4
+
+IMAP's LIST command.  The request must be partially decoded, the answer
+will need to be encoded.
+
+I<Example:> using IMAP list
+
+
+ my $imap  = Mail::Server::IMAP4::List->new(delimiter => \&delim, ...);
+ local $"  = ';';
+
+ my @lines = $imap->list('', '');  # returns the default delimiter
+ print ">@{$lines[0]}<";           #  >(\Noselect);/;<
+
+ my @lines = $imap->list('#news',''); # specific delimiter
+ print ">@{$lines[0]}<";           #  >(\Noselect);.;<
+
+ my @lines = $imap->list('top/x/', '%');
+ print ">@$_<," foreach @lines;    #  >();/;/tmp/x/y<,>(\Marked);/;/tmp/x/z<
+
+=back
+
+
+
+
+=head1 DETAILS
+
+See
+
+=over 4
+=item RFC2060: "Internet Message Access Protocol IMAP4v1"
+
+sections 6.3.8 (LIST question) and 7.2.2 (LIST answer)
+=back
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,18 @@
+
+use strict;
+use warnings;
+
+package Mail::Server::IMAP4::Search;
+use vars '$VERSION';
+$VERSION = '2.060';
+use base 'Mail::Box::Search';
+
+
+sub init($)
+{   my ($self, $args) = @_;
+    $self->notImplemented;
+}
+
+#-------------------------------------------
+
+1;

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4/Search.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,285 @@
+
+=head1 NAME
+
+Mail::Server::IMAP4::Search - select messages within a IMAP folder (not completed)
+
+
+=head1 INHERITANCE
+
+ Mail::Server::IMAP4::Search
+   is a Mail::Box::Search
+   is a Mail::Reporter
+
+
+=head1 SYNOPSIS
+
+ use Mail::Box::Manager;
+ my $mgr    = Mail::Box::Manager->new;
+ my $folder = $mgr->open('imap4:Inbox');
+
+ my $filter = Mail::Server::IMAP4::Search->new
+    (  ...to be defined...
+    );
+
+ my @msgs   = $filter->search($folder);
+ if($filter->search($message)) {...}
+
+
+=head1 DESCRIPTION
+
+THIS PACKAGES IS NOT IMPLEMENTED YET...  (it's waiting for a volunteer)
+
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Server::IMAP4::Search-E<gt>B<new>(OPTIONS)
+
+=over 4
+
+ Option      Defined in       Default      
+ binaries    L<Mail::Box::Search>  <false>      
+ decode      L<Mail::Box::Search>  <true>       
+ delayed     L<Mail::Box::Search>  <true>       
+ deleted     L<Mail::Box::Search>  <false>      
+ deliver     L<Mail::Box::Search>  undef        
+ in          L<Mail::Box::Search>  C<'BODY'>    
+ label       L<Mail::Box::Search>  undef        
+ limit       L<Mail::Box::Search>  C<0>         
+ log         L<Mail::Reporter>  C<'WARNINGS'>
+ logical     L<Mail::Box::Search>  C<'REPLACE'> 
+ multiparts  L<Mail::Box::Search>  <true>       
+ trace       L<Mail::Reporter>  C<'WARNINGS'>
+
+. binaries BOOLEAN
+
+. decode BOOLEAN
+
+. delayed BOOLEAN
+
+. deleted BOOLEAN
+
+. deliver undef|CODE|'DELETE'
+
+. in 'HEAD'|'BODY'|'MESSAGE'
+
+. label STRING
+
+. limit NUMBER
+
+. log LEVEL
+
+. logical 'REPLACE'|'AND'|'OR'|'NOT'|'AND NOT'|'OR NOT'
+
+. multiparts BOOLEAN
+
+. trace LEVEL
+
+=back
+
+=head2 Searching
+
+
+$obj-E<gt>B<inBody>(PART, BODY)
+
+=over 4
+
+See L<Mail::Box::Search/"Searching">
+
+=back
+
+$obj-E<gt>B<inHead>(PART, HEAD)
+
+=over 4
+
+See L<Mail::Box::Search/"Searching">
+
+=back
+
+$obj-E<gt>B<search>(FOLDER|THREAD|MESSAGE|ARRAY-OF-MESSAGES)
+
+=over 4
+
+See L<Mail::Box::Search/"Searching">
+
+=back
+
+$obj-E<gt>B<searchPart>(PART)
+
+=over 4
+
+See L<Mail::Box::Search/"Searching">
+
+=back
+
+=head2 The Results
+
+
+$obj-E<gt>B<printMatch>([FILEHANDLE], HASH)
+
+=over 4
+
+See L<Mail::Box::Search/"The Results">
+
+=back
+
+=head2 Error handling
+
+
+$obj-E<gt>B<AUTOLOAD>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<addReport>(OBJECT)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+Mail::Server::IMAP4::Search-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<errors>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<log>([LEVEL [,STRINGS]])
+
+Mail::Server::IMAP4::Search-E<gt>B<log>([LEVEL [,STRINGS]])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logPriority>(LEVEL)
+
+Mail::Server::IMAP4::Search-E<gt>B<logPriority>(LEVEL)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logSettings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<notImplemented>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<report>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<reportAll>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<trace>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<warnings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+=head2 Cleanup
+
+
+$obj-E<gt>B<DESTROY>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+$obj-E<gt>B<inGlobalDestruction>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+
+
+=head1 DIAGNOSTICS
+
+I<Error:> Package $package does not implement $method.
+
+Fatal error: the specific package (or one of its superclasses) does not
+implement this method where it should. This message means that some other
+related classes do implement this method however the class at hand does
+not.  Probably you should investigate this and probably inform the author
+of the package.
+
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,22 +1,19 @@
 
-package Mail::Box::Search::IMAP;
-use vars '$VERSION';
-$VERSION = '2.055';
-use base 'Mail::Box::Search';
-
 use strict;
 use warnings;
 
-use Carp;
+package Mail::Server::IMAP4;
+use vars '$VERSION';
+$VERSION = '2.060';
+use base 'Mail::Server';
 
-#-------------------------------------------
+use Mail::Server::IMAP4::List;
+use Mail::Server::IMAP4::Fetch;
+use Mail::Server::IMAP4::Search;
+use Mail::Transport::IMAP4;
 
 
-sub init($)
-{   my ($self, $args) = @_;
-    $self->notImplemented;
-}
-
 #-------------------------------------------
 
+
 1;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server/IMAP4.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,133 +1,64 @@
 
 =head1 NAME
 
-Mail::Box::Search::IMAP - select messages within a IMAP folder
+Mail::Server::IMAP4 - IMAP4 server implementation (not completed)
 
 
 =head1 INHERITANCE
 
- Mail::Box::Search::IMAP
-   is a Mail::Box::Search
+ Mail::Server::IMAP4
+   is a Mail::Server
    is a Mail::Reporter
 
 
 =head1 SYNOPSIS
 
- use Mail::Box::Manager;
- my $mgr    = Mail::Box::Manager->new;
- my $folder = $mgr->open('imap4:Inbox');
+ !!!Partially implemented!!!!
+ my $server = Mail::Server::IMAP4->new($msg);
 
- my $filter = Mail::Box::Search::IMAP->new
-    (  ...to be defined...
-    );
 
- my @msgs   = $filter->search($folder);
- if($filter->search($message)) {...}
-
-
 =head1 DESCRIPTION
 
-THIS PACKAGES IS NOT IMPLEMENTED YET: it waits for
-L<Mail::Transport::IMAP4|Mail::Transport::IMAP4> to be available.
+This module is a place-holder, which can be used to grow code which
+is needed to implement a full IMAP4 server.
 
+Although the server is not implemented, parts of this server are
+already available.
 
-
-=head1 METHODS
-
-
-=head2 Constructors
-
-
-Mail::Box::Search::IMAP-E<gt>B<new>(OPTIONS)
-
 =over 4
 
- Option      Defined in       Default      
- binaries    L<Mail::Box::Search>  <false>      
- decode      L<Mail::Box::Search>  <true>       
- delayed     L<Mail::Box::Search>  <true>       
- deleted     L<Mail::Box::Search>  <false>      
- deliver     L<Mail::Box::Search>  undef        
- in          L<Mail::Box::Search>  C<'BODY'>    
- label       L<Mail::Box::Search>  undef        
- limit       L<Mail::Box::Search>  C<0>         
- log         L<Mail::Reporter>  C<'WARNINGS'>
- logical     L<Mail::Box::Search>  C<'REPLACE'> 
- multiparts  L<Mail::Box::Search>  <true>       
- trace       L<Mail::Reporter>  C<'WARNINGS'>
+=item * L<Mail::Server::IMAP4::Fetch|Mail::Server::IMAP4::Fetch>
 
-. binaries BOOLEAN
+used to capture "FETCH" related information from a message, and produce
+server-side FETCH answers.
 
-. decode BOOLEAN
+=item * L<Mail::Server::IMAP4::List|Mail::Server::IMAP4::List>
 
-. delayed BOOLEAN
+produce LIST reponses about existing folders.  This works
+in combination with a L<Mail::Box::Manage::User|Mail::Box::Manage::User> object.
 
-. deleted BOOLEAN
+=item * L<Mail::Server::IMAP4::Search|Mail::Server::IMAP4::Search>
 
-. deliver undef|CODE|'DELETE'
 
-. in 'HEAD'|'BODY'|'MESSAGE'
-
-. label STRING
-
-. limit NUMBER
-
-. log LEVEL
-
-. logical 'REPLACE'|'AND'|'OR'|'NOT'|'AND NOT'|'OR NOT'
-
-. multiparts BOOLEAN
-
-. trace LEVEL
-
+the SEARCH request.  Not implemented yet... looking for a volunteer.
 =back
 
-=head2 Searching
 
 
-$obj-E<gt>B<inBody>(PART, BODY)
+=head1 METHODS
 
-=over 4
 
-See L<Mail::Box::Search/"Searching">
+=head2 Constructors
 
-=back
 
-$obj-E<gt>B<inHead>(PART, HEAD)
+Mail::Server::IMAP4-E<gt>B<new>(OPTIONS)
 
 =over 4
 
-See L<Mail::Box::Search/"Searching">
+See L<Mail::Reporter/"Constructors">
 
 =back
 
-$obj-E<gt>B<search>(FOLDER|THREAD|MESSAGE|ARRAY-OF-MESSAGES)
-
-=over 4
-
-See L<Mail::Box::Search/"Searching">
-
-=back
-
-$obj-E<gt>B<searchPart>(PART)
-
-=over 4
-
-See L<Mail::Box::Search/"Searching">
-
-=back
-
-=head2 The Results
-
-
-$obj-E<gt>B<printMatch>([FILEHANDLE], HASH)
-
-=over 4
-
-See L<Mail::Box::Search/"The Results">
-
-=back
-
 =head2 Error handling
 
 
@@ -147,9 +78,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Box::Search::IMAP-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Server::IMAP4-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -167,7 +98,7 @@
 
 $obj-E<gt>B<log>([LEVEL [,STRINGS]])
 
-Mail::Box::Search::IMAP-E<gt>B<log>([LEVEL [,STRINGS]])
+Mail::Server::IMAP4-E<gt>B<log>([LEVEL [,STRINGS]])
 
 =over 4
 
@@ -177,7 +108,7 @@
 
 $obj-E<gt>B<logPriority>(LEVEL)
 
-Mail::Box::Search::IMAP-E<gt>B<logPriority>(LEVEL)
+Mail::Server::IMAP4-E<gt>B<logPriority>(LEVEL)
 
 =over 4
 
@@ -265,17 +196,26 @@
 of the package.
 
 
+=head1 DETAILS
 
+See
 
+=over 4
 
+=item RFC2060: "Internet Message Access Protocol IMAP4v1"
+=back
 
+
+
+
+
 =head1 REFERENCES
 
 See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,11 @@
+
+use strict;
+use warnings;
+
+package Mail::Server;
+use vars '$VERSION';
+$VERSION = '2.060';
+use base 'Mail::Reporter';
+
+
+1;

Added: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Server.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,212 @@
+
+=head1 NAME
+
+Mail::Server - Base class for email servers in MailBox
+
+
+=head1 INHERITANCE
+
+ Mail::Server
+   is a Mail::Reporter
+
+ Mail::Server is extended by
+   Mail::Server::IMAP4
+
+
+=head1 SYNOPSIS
+
+ my $server = Mail::Server::IMAP4->new($msg);
+ my $server = Mail::Server::POP3->new($msg);
+
+
+=head1 DESCRIPTION
+
+This module is a place-holder, logical in the class hierarchy.  On the
+moment, no full server has been implemented, but some parts of IMAP4
+exist.
+
+Servers:
+
+=over 4
+
+=item * L<Mail::Server::IMAP4|Mail::Server::IMAP4>
+
+
+Partial IMAP4 implementation.
+=back
+
+
+
+=head1 METHODS
+
+
+=head2 Constructors
+
+
+Mail::Server-E<gt>B<new>(OPTIONS)
+
+=over 4
+
+See L<Mail::Reporter/"Constructors">
+
+=back
+
+=head2 Error handling
+
+
+$obj-E<gt>B<AUTOLOAD>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<addReport>(OBJECT)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+Mail::Server-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<errors>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<log>([LEVEL [,STRINGS]])
+
+Mail::Server-E<gt>B<log>([LEVEL [,STRINGS]])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logPriority>(LEVEL)
+
+Mail::Server-E<gt>B<logPriority>(LEVEL)
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<logSettings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<notImplemented>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<report>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<reportAll>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<trace>([LEVEL])
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+$obj-E<gt>B<warnings>
+
+=over 4
+
+See L<Mail::Reporter/"Error handling">
+
+=back
+
+=head2 Cleanup
+
+
+$obj-E<gt>B<DESTROY>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+$obj-E<gt>B<inGlobalDestruction>
+
+=over 4
+
+See L<Mail::Reporter/"Cleanup">
+
+=back
+
+
+
+=head1 DIAGNOSTICS
+
+I<Error:> Package $package does not implement $method.
+
+Fatal error: the specific package (or one of its superclasses) does not
+implement this method where it should. This message means that some other
+related classes do implement this method however the class at hand does
+not.  Probably you should investigate this and probably inform the author
+of the package.
+
+
+=head1 DETAILS
+
+
+
+
+
+
+=head1 REFERENCES
+
+See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
+
+=head1 COPYRIGHTS
+
+Distribution version 2.060.
+Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
+other contributors.
+
+Copyright (c) 2001-2003 by the author(s). All rights reserved.
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::Exim;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Send';
 
 use Carp;
@@ -32,14 +32,14 @@
 {   my ($self, $message, %args) = @_;
 
     my $from = $args{from} || $message->sender;
-    $from    = $from->address if $from->isa('Mail::Address');
+    $from    = $from->address if ref $from && $from->isa('Mail::Address');
     my @to   = map {$_->address} $self->destinations($message, $args{to});
 
     my $program = $self->{MTS_program};
     if(open(MAILER, '|-')==0)
     {   { exec $program, '-i', '-f', $from, @to; }  # {} to avoid warning
         $self->log(NOTICE => "Errors when opening pipe to $program: $!");
-        return 0;
+        exit 1;
     }
 
     $self->putContent($message, \*MAILER, undisclosed => 1);

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Exim.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -158,9 +158,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::Exim-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::Exim-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -311,7 +311,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Transport::IMAP4;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Receive';
 
 use Digest::HMAC_MD5;   # only availability check for CRAM_MD5
@@ -36,8 +36,8 @@
     {   $imap = $self->createImapClient($imap) or return undef;
     }
  
-    $self->imapClient($imap);
-    $self->login or return undef;
+    $self->imapClient($imap) or return undef;
+    $self->login             or return undef;
 }
 
 #------------------------------------------
@@ -65,22 +65,37 @@
         $ntml_installed = ! $@;
     }
 
+    # What the client wants to use to login
+
     if(@types == 1 && $types[0] eq 'AUTO')
     {   @types = ('CRAM-MD5', ($ntml_installed ? 'NTLM' : ()), 'PLAIN');
     }
 
-    my @auth;
+    my @clientside;
     foreach my $auth (@types)
-    {   push @auth,
-             ref $auth eq 'ARRAY' ? $auth
+    {   push @clientside
+           , ref $auth eq 'ARRAY' ? $auth
            : $auth eq 'NTLM'      ? [NTLM  => \&Authen::NTLM::ntlm ]
            :                        [$auth => undef];
     }
 
-    $self->log(WARNING => 'module Authen::NTLM is not installed')
-        if grep { !ref $_ &&  $_ eq 'NTLM' } @auth;
+    my %clientside = map { ($_->[0] => $_) } @clientside;;
 
+    # What does the server support? in its order of preference.
+
+    my $imap = $self->imapClient or return ();
+    my @serverside = map { m/^AUTH=(\w+)/ ? uc($1) : () }
+                        $imap->capability;
+
+    my @auth;
+    if(@serverside)  # server list auth capabilities
+    {   @auth = map { $clientside{$_->[0]} ? delete $clientside{$_->[0]} : () }
+             @serverside;
+    }
+    @auth = @clientside unless @auth;  # fallback to client's preference
+
     $self->{MTI_auth} = \@auth;
+    @auth;
 }
 
 #------------------------------------------
@@ -235,13 +250,19 @@
 
 
 # Explanation in Mail::Box::IMAP4::Message chapter DETAILS
+
 my %flags2labels =
- ( '\Seen'     => [seen     => 1]
+ ( # Standard IMAP4 labels
+   '\Seen'     => [seen     => 1]
  , '\Answered' => [replied  => 1]
  , '\Flagged'  => [flagged  => 1]
  , '\Deleted'  => [deleted  => 1]
  , '\Draft'    => [draft    => 1]
  , '\Recent'   => [old      => 0]
+
+   # For the Netzwert extension (Mail::Box::Netzwert), some labels were
+   # added.  You'r free to support them as well.
+ , '\Spam'     => [spam     => 1]
  );
 
 my %labels2flags;
@@ -254,23 +275,25 @@
 
 sub getFlags($$)
 {   my ($self, $id) = @_;
-    my $imap  = $self->imapClient or return ();
+    my $imap   = $self->imapClient or return ();
+    my $labels = $self->flagsToLabels(SET => $imap->flags($id));
 
-    my %flags;
-    $flags{$_}++ foreach $imap->flags($id);
-
-    my @labels;
-    while(my ($k, $v) = each %flags2labels)
-    {   my ($label, $positive) = @$v;
-        push @labels, $label => (exists $flags{$k} ? $positive : !$positive);
+    # Add default values for missing flags
+    foreach  my $s (values %flags2labels)
+    {   $labels->{$_->[0]} = not $_->[1] unless exists $labels->{$_->[0]};
     }
 
-    @labels;
+    $labels;
 }
 
 #------------------------------------------
 
 
+sub listFlags() { keys %flags2labels }
+
+#------------------------------------------
+
+
 # Mail::IMAPClient can only set one value a time, however we do more...
 sub setFlags($@)
 {   my ($self, $id) = (shift, shift);
@@ -320,12 +343,43 @@
         }
     }
 
-    join(" ", @set);
+    join " ", sort @set;
 }
 
 #------------------------------------------
 
 
+sub flagsToLabels($@)
+{   my ($thing, $what) = (shift, shift);
+    my %labels;
+
+    my $clear = $what eq 'CLEAR';
+
+    foreach my $f (@_)
+    {   if(my $lab = $flags2labels{$f})
+        {   $labels{$lab->[0]} = $clear ? not($lab->[1]) : $lab->[1];
+        }
+        else
+        {   (my $lab = $f) =~ s,^\\,,;
+            $labels{$lab}++;
+        }
+    }
+
+    if($what eq 'REPLACE')
+    {   my %found = map { ($_ => 1) } @_;
+        foreach my $f (keys %flags2labels)
+        {   next if $found{$f};
+            my $lab = $flags2labels{$f};
+            $labels{$lab->[0]} = not $lab->[1];
+        }
+    }
+
+    wantarray ? %labels : \%labels;
+}
+
+#------------------------------------------
+
+
 sub getFields($@)
 {   my ($self, $id) = (shift, shift);
     my $imap   = $self->imapClient or return ();
@@ -420,6 +474,14 @@
 #------------------------------------------
 
 
+sub deleteFolder($)
+{   my $imap = shift->imapClient or return ();
+    $imap->delete(shift);
+}
+
+#------------------------------------------
+
+
 sub DESTROY()
 {   my $self = shift;
     my $imap = $self->imapClient;
@@ -430,18 +492,14 @@
 
 #------------------------------------------
 
-package Mail::IMAPClient::Debug;
-use vars '$VERSION';
-$VERSION = '2.055';
-
 # Tied filehandle translates IMAP's debug system into Mail::Reporter
 # calls.
-sub TIEHANDLE($)
+sub  Mail::IMAPClient::Debug::TIEHANDLE($)
 {   my ($class, $logger) = @_;
     bless \$logger, $class;
 }
 
-sub PRINT(@)
+sub  Mail::IMAPClient::Debug::PRINT(@)
 {   my $logger = ${ (shift) };
     $logger->log(DEBUG => @_);
 }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/IMAP4.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -21,7 +21,7 @@
 
 =head1 DESCRIPTION
 
-****** UNDER DEVELOPMENT *****, cannot be used (yet)
+****** UNDER DEVELOPMENT *****, please help testing
 
 The IMAP4 protocol is quite complicated: it is feature rich and allows
 verious asynchronous actions.  The main document describing IMAP is
@@ -190,22 +190,19 @@
 The settings are used by L<login()|Mail::Transport::IMAP4/"Protocol [internals]"> to get server access.  The initial
 value origins from L<new(authenticate)|Mail::Transport::IMAP4/"METHODS">, but may be changed later.
 
-Available basic TYPES are C<CRAM-MD5> and C<PLAIN>.  The latter is sending
-username and password in plain text, and is therefore tried as last
-resort.
+Available basic TYPES are C<CRAM-MD5>, C<NTLM>, and C<PLAIN>.  With
+C<AUTO>, all available types will be tried.  When the Authen::NTLM
+is not installed, the C<NTLM> option will silently be skipped.  Be warned
+that, because of C<PLAIN>, erroneous username/password combinations will
+be passed readible as last attempt!
 
 The C<NTLM> authentication requires Authen::NTLM to be installed.  Other
 methods may be added later.  Besides, you may also specify a CODE
 reference which implements some authentication.
 
-When C<AUTO> is given, then C<CRAM-MD5>, C<NTLM> and C<PLAIN> are tried,
-in that specific order.  When the Authen::NTLM is not installed it
-will silently be skipped.  Be warned that, because of C<PLAIN>, erroneous
-username/password combinations will be passed readible as last attempt!
-
 An ARRAY as TYPE can be used to specify both mechanism as callback.  When
 no array is used, callback of the pair is set to C<undef>.  See
-L<Mail::IMAPCleint/authenticate> for the gory details.
+L<Mail::IMAPClient/authenticate> for the gory details.
 
 I<Example:> 
 
@@ -252,6 +249,14 @@
 
 =back
 
+$obj-E<gt>B<deleteFolder>(NAME)
+
+=over 4
+
+Remove one folder.
+
+=back
+
 $obj-E<gt>B<destroyDeleted>
 
 =over 4
@@ -279,6 +284,30 @@
 
 =back
 
+$obj-E<gt>B<flagsToLabels>(WHAT|FLAGS)
+
+Mail::Transport::IMAP4-E<gt>B<flagsToLabels>(WHAT|FLAGS)
+
+=over 4
+
+In SCALAR context, a hash with labels is returned.  In LIST context, pairs
+are returned.
+
+The WHAT parameter can be C<'SET'>, C<'CLEAR'>, or C<'REPLACE'>.  With the
+latter, all standard imap flags do not appear in the list will be ignored:
+their value may either by set or cleared.  See L<getFlags()|Mail::Transport::IMAP4/"Protocol [internals]">
+
+Unknown flags in LIST are stripped from their backslash and lower-cased.
+For instance, '\SomeWeirdFlag' will become `someweirdflag => 1'.
+
+I<Example:> translating IMAP4 flags into MailBox flags
+
+
+ my @flags  = ('\Seen', '\Flagged');
+ my $labels = Mail::Transport::IMAP4->flags2labels(SET => @flags);
+
+=back
+
 $obj-E<gt>B<folder>([FOLDERNAME])
 
 =over 4
@@ -314,9 +343,11 @@
 
 Returns the values of all flags which are related to the message with the
 specified ID.  These flags are translated into the names which are
-standard for the MailBox suite.  Names which do not appear will also provide
-a value in the return list: the negative for the value is it was present.
+standard for the MailBox suite.
 
+A HASH is returned.  Names which do not appear will also provide
+a value in the returned: the negative for the value is it was present.
+
 =back
 
 $obj-E<gt>B<getMessageAsString>(MESSAGE|UID)
@@ -359,6 +390,14 @@
 
 =back
 
+$obj-E<gt>B<listFlags>
+
+=over 4
+
+Returns all predefined flags as list.
+
+=back
+
 $obj-E<gt>B<login>
 
 =over 4
@@ -399,9 +438,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::IMAP4-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::IMAP4-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -549,7 +588,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::Mailx;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Send';
 
 use Carp;
@@ -54,7 +54,7 @@
     {   close STDOUT;
         { exec $program, @options, @to }
         $self->log(NOTICE => "Cannot start contact to $program: $!");
-        return 0;
+        exit 1;
     }
  
     $self->putContent($message, \*MAILER, body_only => 1);

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Mailx.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -181,9 +181,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::Mailx-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::Mailx-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -334,7 +334,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -4,7 +4,7 @@
 
 package Mail::Transport::POP3;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Receive';
 
 use IO::Socket  ();
@@ -184,7 +184,7 @@
 {   my $self = shift;
 
     my $socket = $self->_connection;
-    return $socket if $socket;
+    return $socket if defined $socket;
 
     if(exists $self->{MTP_nouidl})
     {   $self->log(ERROR =>
@@ -230,7 +230,7 @@
     return unless OK($response);
 
     my @list;
-    local $_; # make sure we don't spoil it for the outside world
+    local $_; # make sure we don't spoil $_ for the outside world
     while(<$socket>)
     {   last if m#^\.\r?\n#s;
         s#^\.##;
@@ -256,8 +256,10 @@
 
 sub _connection(;$)
 {   my $self = shift;
-    my $socket = $self->{MTP_socket} or return undef;
 
+    my $socket = $self->{MTP_socket};
+    defined $socket or return undef;
+
     # Check if we (still) got a connection
     eval {print $socket "NOOP$CRLF"};
     if($@ || ! <$socket> )
@@ -276,7 +278,7 @@
 
 # Check if we can make a TCP/IP connection
 
-    local $_; # make sure we don't spoil it for the outside world
+    local $_; # make sure we don't spoil $_ for the outside world
     my ($interval, $retries, $timeout) = $self->retry;
     my ($host, $port, $username, $password) = $self->remoteHost;
     unless($username && $password)
@@ -306,9 +308,8 @@
     if($authenticate eq 'AUTO' || $authenticate eq 'APOP')
     {   if($welcome =~ m#^\+OK .*(<\d+\.\d+\@[^>]+>)#)
         {   my $md5 = Digest::MD5::md5_hex($1.$password);
-            my $response = $self->send($socket, "APOP $username $md5$CRLF")
-	        or return;
-            $connected = OK($response);
+            my $response = $self->send($socket, "APOP $username $md5$CRLF");
+            $connected = OK($response) if $response;
         }
     }
 
@@ -366,11 +367,14 @@
     if(OK($uidl))
     {   my @n2uidl;
         $n2uidl[$self->{MTP_messages}] = undef; # optimization, sets right size
+
+        local $_;    # protect global $_
         while(<$socket>)
         {   last if substr($_, 0, 1) eq '.';
-            s#\r?\n$##; m#^(\d+) (.+)#;
-            $n2uidl[$1] = $2;
+            s#\r?\n$##;
+            $n2uidl[$1] = $2 if m#^(\d+) (.+)#;
         }
+
         shift @n2uidl; # make message 1 into index 0
         $self->{MTP_n2uidl} = \@n2uidl;
         delete $self->{MTP_n2length};

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/POP3.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -354,9 +354,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::POP3-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::POP3-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -535,7 +535,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::Qmail;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Send';
 
 use Carp;
@@ -34,7 +34,7 @@
     if(open(MAILER, '|-')==0)
     {   { exec $program; }
         $self->log(NOTICE => "Errors when opening pipe to $program: $!");
-        return 0;
+        exit 1;
     }
  
     $self->putContent($message, \*MAILER, undisclosed => 1);

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Qmail.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -154,9 +154,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::Qmail-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::Qmail-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -307,7 +307,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::Receive;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport';
 
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Receive.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -113,9 +113,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::Receive-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::Receive-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -252,7 +252,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::SMTP;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Send';
 
 use Net::SMTP;
@@ -148,14 +148,14 @@
 
         defined $server or next;
 
-        $self->log(PROGRESS => "Opened SMTP connection to $host.\n");
+        $self->log(PROGRESS => "Opened SMTP connection to $host.");
 
         if(defined $username)
         {   if($server->auth($username, $password))
-            {    $self->log(PROGRESS => "$host: Authentication succeeded.\n");
+            {    $self->log(PROGRESS => "$host: Authentication succeeded.");
             }
             else
-            {    $self->log(ERROR => "Authentication failed.\n");
+            {    $self->log(ERROR => "Authentication failed.");
                  return undef;
             }
         }

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/SMTP.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -259,9 +259,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::SMTP-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::SMTP-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -410,7 +410,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::Send;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport';
 
 use Carp;
@@ -13,7 +13,8 @@
 
 sub new(@)
 {   my $class = shift;
-    return $class->SUPER::new(@_) if $class ne __PACKAGE__;
+    return $class->SUPER::new(@_)
+       if $class ne __PACKAGE__;
 
     require Mail::Transport::Sendmail;
     Mail::Transport::Sendmail->new(@_);

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Send.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -255,9 +255,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::Send-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::Send-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -408,7 +408,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport::Sendmail;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Transport::Send';
 
 use Carp;
@@ -34,9 +34,9 @@
     my $program = $self->{MTS_program};
     if(open(MAILER, '|-')==0)
     {   my $options = $args{sendmail_options} || [];
-        { exec $program, '-it', @{$self->{MTS_opts}}; }  # {} to avoid warning
+        { exec $program, '-ti', @{$self->{MTS_opts}}; }  # {} to avoid warning
         $self->log(NOTICE => "Errors when opening pipe to $program: $!");
-        return 0;
+        exit 1;
     }
  
     $self->putContent($message, \*MAILER, undisclosed => 1);

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport/Sendmail.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -170,9 +170,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport::Sendmail-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport::Sendmail-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -323,7 +323,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -3,7 +3,7 @@
 
 package Mail::Transport;
 use vars '$VERSION';
-$VERSION = '2.055';
+$VERSION = '2.060';
 use base 'Mail::Reporter';
 
 use Carp;

Modified: packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pod
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pod	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/lib/Mail/Transport.pod	2005-03-30 17:42:04 UTC (rev 839)
@@ -219,9 +219,9 @@
 
 =back
 
-$obj-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
-Mail::Transport-E<gt>B<defaultTrace>([LEVEL, [LEVEL])
+Mail::Transport-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
 
 =over 4
 
@@ -358,7 +358,7 @@
 
 =head1 COPYRIGHTS
 
-Distribution version 2.055.
+Distribution version 2.060.
 Written by Mark Overmeer (mark at overmeer.net).  See the ChangeLog for
 other contributors.
 

Modified: packages/libmail-box-perl/branches/upstream/current/scripts/mailbox2html
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/scripts/mailbox2html	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/scripts/mailbox2html	2005-03-30 17:42:04 UTC (rev 839)
@@ -241,7 +241,7 @@
     my $subject      = $message->head->get('subject') || '&lt;no subject&gt;';
     chomp $subject;
 
-    $message->setLabel
+    $message->label
      ( clean_id => $clean_id
      , filename => $filename
      , subject  => $subject

Modified: packages/libmail-box-perl/branches/upstream/current/test.pl
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/test.pl	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/test.pl	2005-03-30 17:42:04 UTC (rev 839)
@@ -6,9 +6,11 @@
 use File::Spec;
 use File::Basename;
 
-use lib 'tests';
+use lib qw/tests lib/;
+
 use Config;
 use Tools;             # test tools
+use Mail::Reporter;    # to avoid 'too late for INIT'
 
 use IO::Dir;
 use Test::Harness qw($verbose);

Modified: packages/libmail-box-perl/branches/upstream/current/tests/10reporter/10errors.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/10reporter/10errors.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/10reporter/10errors.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -T
 #
-# Test reporting warnings, errors and family.
+# Test producing warnings, errors and family.
 #
 
 use strict;
@@ -9,7 +9,7 @@
 use lib qw(. .. tests);
 use Tools;
 
-use Test::More tests => 85;
+use Test::More tests => 41;
 
 use Mail::Reporter;
 
@@ -38,10 +38,26 @@
 ok(!defined $e);
 
 #
+# Initial default trace
+#
+
+my ($l, $t) = Mail::Reporter->defaultTrace;
+ok(defined $l);
+ok(defined $t);
+
+is($l, 'WARNING',                   'string log level');
+cmp_ok($l, '==',  4,                'numeric log level');
+
+is($t, 'WARNING',                   'string trace level');
+cmp_ok($t, '==',  4,                'string trace level');
+
+
+
+#
 # Set default trace
 #
 
-my ($l, $t) = Mail::Reporter->defaultTrace('DEBUG', 'ERRORS');
+($l, $t) = Mail::Reporter->defaultTrace('DEBUG', 'ERRORS');
 ok(defined $l);
 ok(defined $t);
 
@@ -66,11 +82,10 @@
 cmp_ok($t, '==',  4,                'string trace level');
 
 #
-# Reporting levels
+# Reporting levels based on objects
 #
 
 my $rep = Mail::Reporter->new;
-
 ok(defined $rep);
 is($rep->log, 'WARNING',            'Default log-level');
 cmp_ok($rep->log, '==', 4);
@@ -85,78 +100,3 @@
 cmp_ok($t, '==', 4);
 
 cmp_ok($rep->trace('ERROR'), '==', 5,   'Check error level numbers');
-
-my $catch;
-{  local $SIG{__WARN__} = sub { $catch = shift };
-   $rep->log(ERROR => 'a test');   # \n will be added
-}
-is($catch, "ERROR: a test\n",           'Stored one error text');
-cmp_ok($rep->report('ERRORS'), '==', 1, 'Counts one error');
-is(($rep->report('ERRORS'))[0], "a test\n", 'Correctly stored text');
-
-undef $catch;
-{  local $SIG{__WARN__} = sub { $catch = shift };
-   $rep->log(WARNING => "filter\n");
-}
-ok(!defined $catch,                       'No visible warnings');
-cmp_ok($rep->report('WARNING'), '==', 1,  'Count logged warnings');
-cmp_ok($rep->report('ERROR'), '==', 1,    'Count logged errors');
-cmp_ok($rep->report, '==', 2,             'Count all logged messages');
-is(($rep->report('WARNINGS'))[0], "filter\n", 'Just one \n');
-
-my @reps = $rep->report;
-is($reps[0][0], 'WARNING',                'Checking report()');
-is($reps[0][1], "filter\n");
-is($reps[1][0], 'ERROR');
-is($reps[1][1], "a test\n");
-
- at reps = $rep->reportAll;
-is($reps[0][0], $rep,                     'Checking reportAll()');
-is($reps[0][1], 'WARNING');
-is($reps[0][2], "filter\n");
-is($reps[1][0], $rep);
-is($reps[1][1], 'ERROR');
-is($reps[1][2], "a test\n");
-
-cmp_ok($rep->errors, '==', 1,             'Check errors() short-cut');
-cmp_ok($rep->warnings, '==', 1,           'Check warnings() short-cut');
-
-#
-# Check merging reports
-#
-
-my $r2 = Mail::Reporter->new(trace => 'NONE', log => 'DEBUG');
-ok(defined $r2,                           'Another traceable object');
-isa_ok($r2, 'Mail::Reporter');
-ok($r2->log(WARNING => 'I warn you!'));
-ok($r2->log(ERROR => 'You are in error'));
-ok($r2->log(ERROR => 'I am sure!!'));
-ok($r2->log(NOTICE => 'Don\'t notice me'));
-$rep->addReport($r2);
-
- at reps = $rep->reportAll;
-cmp_ok(@{$reps[0]}, '==', 3);
-is($reps[0][0], $rep,                     'Checking reportAll()');
-is($reps[0][1], 'NOTICE');
-is($reps[0][2], "Don't notice me\n");
-cmp_ok(@{$reps[1]}, '==', 3);
-is($reps[1][0], $rep);
-is($reps[1][1], 'WARNING');
-is($reps[1][2], "filter\n");
-cmp_ok(@{$reps[2]}, '==', 3);
-is($reps[2][0], $rep);
-is($reps[2][1], 'WARNING');
-is($reps[2][2], "I warn you!\n");
-cmp_ok(@{$reps[3]}, '==', 3);
-is($reps[3][0], $rep);
-is($reps[3][1], 'ERROR');
-is($reps[3][2], "a test\n");
-cmp_ok(@{$reps[4]}, '==', 3);
-is($reps[4][0], $rep);
-is($reps[4][1], 'ERROR');
-is($reps[4][2], "You are in error\n");
-cmp_ok(@{$reps[5]}, '==', 3);
-is($reps[5][0], $rep);
-is($reps[5][1], 'ERROR');
-is($reps[5][2], "I am sure!!\n");
-

Added: packages/libmail-box-perl/branches/upstream/current/tests/10reporter/20reports.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/10reporter/20reports.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/10reporter/20reports.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,94 @@
+#!/usr/bin/perl -T
+#
+# Test reporting warnings and errors
+#
+
+use strict;
+use warnings;
+
+use lib qw(. .. tests);
+use Tools;
+
+use Test::More tests => 51;
+
+use Mail::Reporter;
+
+my $rep = Mail::Reporter->new;
+ok(defined $rep);
+
+my $catch;
+{  local $SIG{__WARN__} = sub { $catch = shift };
+   $rep->log(ERROR => 'a test');   # \n will be added
+}
+
+is($catch, "ERROR: a test\n",           'Stored one error text');
+cmp_ok($rep->report('ERRORS'), '==', 1, 'Counts one error');
+is(($rep->report('ERRORS'))[0], "a test", 'Correctly stored text');
+
+undef $catch;
+{  local $SIG{__WARN__} = sub { $catch = shift };
+   $rep->log(WARNING => "filter");
+}
+
+ok(defined $catch,                        'No visible warnings');
+cmp_ok($rep->report('WARNING'), '==', 1,  'Count logged warnings');
+cmp_ok($rep->report('ERROR'), '==', 1,    'Count logged errors');
+cmp_ok($rep->report, '==', 2,             'Count all logged messages');
+is(($rep->report('WARNINGS'))[0], "filter", 'No \n added');
+
+my @reps = $rep->report;
+is($reps[0][0], 'WARNING',                'Checking report()');
+is($reps[0][1], "filter");
+is($reps[1][0], 'ERROR');
+is($reps[1][1], "a test");
+
+ at reps = $rep->reportAll;
+is($reps[0][0], $rep,                     'Checking reportAll()');
+is($reps[0][1], 'WARNING');
+is($reps[0][2], "filter");
+is($reps[1][0], $rep);
+is($reps[1][1], 'ERROR');
+is($reps[1][2], "a test");
+
+cmp_ok($rep->errors, '==', 1,             'Check errors() short-cut');
+cmp_ok($rep->warnings, '==', 1,           'Check warnings() short-cut');
+
+#
+# Check merging reports
+#
+
+my $r2 = Mail::Reporter->new(trace => 'NONE', log => 'DEBUG');
+ok(defined $r2,                           'Another traceable object');
+isa_ok($r2, 'Mail::Reporter');
+ok($r2->log(WARNING => 'I warn you!'));
+ok($r2->log(ERROR => 'You are in error'));
+ok($r2->log(ERROR => 'I am sure!!'));
+ok($r2->log(NOTICE => 'Don\'t notice me'));
+$rep->addReport($r2);
+
+ at reps = $rep->reportAll;
+cmp_ok(@{$reps[0]}, '==', 3);
+is($reps[0][0], $rep,                     'Checking reportAll()');
+is($reps[0][1], 'NOTICE');
+is($reps[0][2], "Don't notice me");
+cmp_ok(@{$reps[1]}, '==', 3);
+is($reps[1][0], $rep);
+is($reps[1][1], 'WARNING');
+is($reps[1][2], "filter");
+cmp_ok(@{$reps[2]}, '==', 3);
+is($reps[2][0], $rep);
+is($reps[2][1], 'WARNING');
+is($reps[2][2], "I warn you!");
+cmp_ok(@{$reps[3]}, '==', 3);
+is($reps[3][0], $rep);
+is($reps[3][1], 'ERROR');
+is($reps[3][2], "a test");
+cmp_ok(@{$reps[4]}, '==', 3);
+is($reps[4][0], $rep);
+is($reps[4][1], 'ERROR');
+is($reps[4][2], "You are in error");
+cmp_ok(@{$reps[5]}, '==', 3);
+is($reps[5][0], $rep);
+is($reps[5][1], 'ERROR');
+is($reps[5][2], "I am sure!!");
+

Added: packages/libmail-box-perl/branches/upstream/current/tests/10reporter/30callback.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/10reporter/30callback.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/10reporter/30callback.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -T
+#
+# Test installing a log callback
+#
+
+use strict;
+use warnings;
+
+use lib qw(. .. tests);
+use Tools;
+
+use Test::More tests => 13;
+use Mail::Reporter;
+
+my ($thing, $level, @text);
+sub callback($$@) { ($thing, $level, @text) = @_ }
+
+my ($l, $t) = Mail::Reporter->defaultTrace(PROGRESS => \&callback);
+ok(defined $l);
+ok(defined $t);
+
+is($l, 'NONE',                      'string log level');
+cmp_ok($l, '==',  6,                'numeric log level');
+
+is($t, 'PROGRESS',                  'string trace level');
+cmp_ok($t, '==',  3,                'string trace level');
+
+Mail::Reporter->log(ERROR => 'one', 'two');
+
+is($thing, 'Mail::Reporter',        'class call');
+is($level, 'ERROR',                 'string trace level');
+cmp_ok(@text, '==', 1,              'text');
+is($text[0], "onetwo");
+
+($thing, $level, @text) = ();
+Mail::Reporter->log(NOTICE => 'three');
+ok(!defined $thing,                 'too low level, nothing');
+ok(!defined $level,                 'no level');
+cmp_ok(@text, '==', 0,              'no text');
+

Modified: packages/libmail-box-perl/branches/upstream/current/tests/10reporter/Definition.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/10reporter/Definition.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/10reporter/Definition.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -1,5 +1,5 @@
 
-package MailBox::Test::10report::Definition;
+package MailBox::Test::10reporter::Definition;
 
 sub name     {"Mail::Report; general base class"}
 sub critical {1}

Modified: packages/libmail-box-perl/branches/upstream/current/tests/11field/20fast.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/11field/20fast.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/11field/20fast.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -11,7 +11,7 @@
 use lib qw(. .. tests);
 use Tools;
 
-use Test::More tests => 68;
+use Test::More tests => 72;
 
 use Mail::Message::Field::Fast;
 use Mail::Address;
@@ -143,6 +143,12 @@
 is($p->attribute('newfield'), 'bull');
 is($p->comment, 'charset="us-ascii"; format="newform"; newfield="bull"');
 
+my %attrs = $p->attributes;
+cmp_ok(keys %attrs, '==', 3, "list of attributes");
+is($attrs{charset}, 'us-ascii');
+is($attrs{format}, 'newform');
+is($attrs{newfield}, 'bull');
+
 my $q = Mail::Message::Field::Fast->new('Content-Type: text/plain');
 is($q->toString, "Content-Type: text/plain\n");
 is($q->attribute(charset => 'iso-10646'), 'iso-10646');

Added: packages/libmail-box-perl/branches/upstream/current/tests/11field/40wrap.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/11field/40wrap.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/11field/40wrap.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,121 @@
+#!/usr/bin/perl -T
+#
+# Test the refolding of fields
+#
+
+use strict;
+use warnings;
+
+use lib qw(. .. tests);
+use Tools;
+
+use Test::More tests => 32;
+
+use Scalar::Util      qw/refaddr/;
+
+#
+# FAST FIELDS
+#
+
+use Mail::Message::Field::Fast;
+my $fast = 'Mail::Message::Field::Fast';
+
+my $fast1 = $fast->new(Name => 'body');
+ok(defined $fast1,                                    'fast field created');
+isa_ok($fast1, $fast);
+is($fast1->unfoldedBody, 'body');
+is($fast1->foldedBody, " body\n");
+
+my $fast2 = $fast1->setWrapLength;
+is(refaddr $fast1, refaddr $fast2,                       'empty wrap');
+is($fast2->unfoldedBody, 'body');
+is($fast2->foldedBody, " body\n");
+
+my $fast3 = $fast1->setWrapLength(34);
+is(refaddr $fast1, refaddr $fast3,                       'wrap much longer');
+is($fast3->unfoldedBody, 'body');
+is($fast3->foldedBody, " body\n");
+
+my $long = 'this is very long field, which has no folding yet';
+my $fast4 = $fast->new(Name => $long);
+is($fast4->unfoldedBody, $long);
+is($fast4->foldedBody, " $long\n",                    'long folding');
+
+my $llong = 'this line is longer than the default fold of 78 characters. It should get folded more than once. Wow, 78 characters it quite a lot, you know!  Are we on the third line already?';
+
+my $fast5 = $fast->new(Name => $llong);
+is($fast5->unfoldedBody, $llong);
+is($fast5->foldedBody, <<__LLONG,                     'llong folding');
+ this line is longer than the default fold of 78 characters. It should
+ get folded more than once. Wow, 78 characters it quite a lot,
+ you know!  Are we on the third line already?
+__LLONG
+
+$fast5->setWrapLength(30);
+is($fast5->foldedBody, <<__LLONG,                     'llong folding at 30');
+ this line is longer than
+ the default fold of 78
+ characters. It should get
+ folded more than once. Wow,
+ 78 characters it quite a lot,
+ you know!  Are we on the
+ third line already?
+__LLONG
+
+$fast5->setWrapLength(100);
+is($fast5->foldedBody, <<__LLONG,                     'llong folding at 100');
+ this line is longer than the default fold of 78 characters. It should get folded more than
+ once. Wow, 78 characters it quite a lot, you know!  Are we on the third line already?
+__LLONG
+
+#
+# FLEX FIELDS
+#
+
+use Mail::Message::Field::Flex;
+my $flex = 'Mail::Message::Field::Flex';
+
+my $flex1 = $flex->new(Name => 'body');
+ok(defined $flex1,                                    'flex field created');
+isa_ok($flex1, $flex);
+is($flex1->unfoldedBody, 'body');
+is($flex1->foldedBody, " body\n");
+
+my $flex2 = $flex1->setWrapLength;
+is(refaddr $flex1, refaddr $flex2,                       'empty wrap');
+is($flex2->unfoldedBody, 'body');
+is($flex2->foldedBody, " body\n");
+
+my $flex3 = $flex1->setWrapLength(34);
+is(refaddr $flex1, refaddr $flex3,                       'wrap much longer');
+is($flex3->unfoldedBody, 'body');
+is($flex3->foldedBody, " body\n");
+
+my $flex4 = $flex->new(Name => $long);
+is($flex4->unfoldedBody, $long);
+is($flex4->foldedBody, " $long\n",                    'long folding');
+
+my $flex5 = $flex->new(Name => $llong);
+is($flex5->unfoldedBody, $llong);
+is($flex5->foldedBody, <<__LLONG,                     'llong folding');
+ this line is longer than the default fold of 78 characters. It should
+ get folded more than once. Wow, 78 characters it quite a lot,
+ you know!  Are we on the third line already?
+__LLONG
+
+$flex5->setWrapLength(30);
+is($flex5->foldedBody, <<__LLONG,                     'llong folding at 30');
+ this line is longer than
+ the default fold of 78
+ characters. It should get
+ folded more than once. Wow,
+ 78 characters it quite a lot,
+ you know!  Are we on the
+ third line already?
+__LLONG
+
+$flex5->setWrapLength(100);
+is($flex5->foldedBody, <<__LLONG,                     'llong folding at 100');
+ this line is longer than the default fold of 78 characters. It should get folded more than
+ once. Wow, 78 characters it quite a lot, you know!  Are we on the third line already?
+__LLONG

Modified: packages/libmail-box-perl/branches/upstream/current/tests/13body/40multip.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/13body/40multip.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/13body/40multip.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -44,7 +44,7 @@
 cmp_ok($p1->body($b1) , "==",  $b1);
 is($p1->get('Content-Type'), 'text/html');
 is($p1->get('Content-Transfer-Encoding'), '8bit');
-ok(!defined $p1->get('Content-Disposition'));
+ok(! defined $p1->get('Content-Disposition'));
 
 my $h2 = Mail::Message::Head::Complete->new;
 

Modified: packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/10full.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/10full.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/10full.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -222,4 +222,3 @@
     my $utf8_to = decode('iso-8859-1', $to);
     is($d->decode($from), $utf8_to);
 }
-

Modified: packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/30unstr.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/30unstr.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/30unstr.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -26,7 +26,7 @@
        exit 0;
    }
    else
-   {   plan tests => 28;
+   {   plan tests => 30;
    }
 }
 
@@ -88,16 +88,14 @@
 
 my $d = $mmfu->new("d", "a\x{E4}b", charset => 'iso-8859-1');
 ok(defined $d,                          "Created d with included stranger");
-isa_ok($c, $mmfu);
+isa_ok($d, $mmfu);
 is($d->name, 'd',                       "Name of d");
 
-# encoding/decoding work in progress
-# is($d->unfoldedBody, '=?iso-8859-1?q?a=E4b?=', "Unfolded body d");
+is($d->unfoldedBody, '=?iso-8859-1?q?a=E4b?=', "Unfolded body d");
 
 my @dl = $d->foldedBody;
 cmp_ok(@dl, '==', 1,                    "Folded body of d");
 
-# encoding/decoding work in progress
-# is($dl[0], " =?iso-8859-1?q?a=E4b?=\n", "Folded d line 0");
+is($dl[0], " =?iso-8859-1?q?a=E4b?=\n", "Folded d line 0");
 
 is($d->decodedBody, "a\x{E4}b");

Added: packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/31struct.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/31struct.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/14fieldu/31struct.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,143 @@
+#!/usr/bin/perl -T
+#
+# Test processing of general structured fields
+#
+
+use strict;
+use warnings;
+
+package Mail::Message::Field::Structured;
+package main;
+
+use lib qw(. .. tests);
+use Tools;
+
+use Test::More;
+
+BEGIN {
+   if($] < 5.007003)
+   {   plan skip_all => "Requires module Encode which requires Perl 5.7.3";
+       exit 0;
+   }
+
+   eval 'require Mail::Message::Field::Structured';
+   if($@)
+   {   plan skip_all => 'Extended attributes not available (install Encode?)';
+       exit 0;
+   }
+   else
+   {   plan tests => 52;
+   }
+}
+
+my $mmff = 'Mail::Message::Field::Full';
+my $mmfs = 'Mail::Message::Field::Structured';
+my $mmfa = 'Mail::Message::Field::Attribute';
+
+#
+# Test construction with simple body
+#
+
+my $a = $mmfs->new('a', 'new');
+ok(defined $a,                          "Created simplest version");
+isa_ok($a, $mmfs);
+isa_ok($a, $mmff);
+is($a->name, 'a',                       "Name of a");
+
+is($a->unfoldedBody, 'new',             "Unfolded body a");
+my @al = $a->foldedBody;
+cmp_ok(@al, '==', 1,                    "Folded body of a");
+is($al[0], " new\n");
+
+my $b = $mmfs->new('b');
+ok(defined $b,                          "No body specified: later");
+
+#
+# LINE without new lines (no folds)
+#
+
+$b = $mmfs->new('b: new');
+ok(defined $b,                          "Created b with body split");
+isa_ok($b, $mmfs);
+isa_ok($b, $mmff);
+is($b->name, 'b',                       "Name of b");
+
+is($b->unfoldedBody, 'new',             "Unfolded body b");
+my @bl = $b->foldedBody;
+cmp_ok(@bl, '==', 1,                    "Folded body of b");
+is($bl[0], " new\n");
+
+#
+# LINE with new-lines (folds)
+#
+
+my $c = $mmfs->new("c: new\n line\n");
+ok(defined $c,                          "Created c with body split");
+isa_ok($c, $mmfs);
+isa_ok($c, $mmff);
+is($c->name, 'c',                       "Name of c");
+
+is($c->unfoldedBody, 'new line',        "Unfolded body c");
+my @cl = $c->foldedBody;
+cmp_ok(@cl, '==', 2,                    "Folded body of c");
+is($cl[0], " new\n",                    "Folded c line 1");
+is($cl[1], " line\n",                   "Folded c line 2");
+
+#
+# Constructing
+#
+
+my $d = $mmfs->new('d');
+ok(defined $d,                          "Created d");
+is($d->unfoldedBody, "",                "Empty body");
+is($d->foldedBody, " \n",               "Empty body");
+
+is($d->datum('text/html'), 'text/html', "Set datum");
+$d->beautify;  # required to re-generate
+is($d->produceBody, "text/html",        "Check datum");
+is($d->unfoldedBody, "text/html");
+is($d->foldedBody, " text/html\n");
+
+ok(! defined $d->attribute('unknown'),  "No attributes yet");
+cmp_ok(scalar $d->attributes, '==', 0);
+
+my $da = $d->attribute(filename => 'virus.exe');
+isa_ok($da, 'Mail::Message::Field::Attribute');
+is($d->produceBody, 'text/html; filename="virus.exe"');
+is($d->unfoldedBody, 'text/html; filename="virus.exe"');
+is($d->foldedBody, qq# text/html; filename="virus.exe"\n#);
+
+#
+# Parsing
+#
+
+my $body = "(comment1)bod(aa)y(comment2); (comment3)attr1=aaa(comment4); attr2=\"b\"; attr3='c'";
+
+my $e = $mmfs->new("e: $body\n");
+ok(defined $e, "field with attributes");
+is($e->datum, 'body',                   "Check datum");
+
+my @attrs = $e->attributes;
+cmp_ok(scalar @attrs, '==', 3,          "All attributes");
+
+ok(defined $e->attribute('attr1'),      "attr1 exists");
+isa_ok($e->attribute('attr1'), $mmfa);
+is($e->attribute('attr1')->value, 'aaa',"attr1 value");
+
+ok(defined $e->attribute('attr2'),      "attr2 exists");
+isa_ok($e->attribute('attr2'), $mmfa);
+is($e->attribute('attr2')->value, 'b',  "attr2 value");
+
+ok(defined $e->attribute('attr3'),      "attr3 exists");
+isa_ok($e->attribute('attr3'), $mmfa);
+is($e->attribute('attr3')->value, 'c',  "attr3 value");
+
+is($e->unfoldedBody, "$body",           "unfolded not changed");
+is($e->foldedBody, " $body\n",          "folded not changed");
+
+$e->beautify;
+is($e->unfoldedBody, "body; attr1=aaa; attr2=b; attr3='c'",
+                                        "unfolded beautyfied");
+is($e->foldedBody, " body; attr1=aaa; attr2=b; attr3='c'\n",
+                                        "folded beautyfied");
+

Modified: packages/libmail-box-perl/branches/upstream/current/tests/40mbox/50create.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/40mbox/50create.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/40mbox/50create.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -180,11 +180,11 @@
 die unless defined $folder;
 
 ok(-f File::Spec->catfile($top, "f4"),        'folder-file found');
-$folder->delete;                             # remove folder contents
-$folder->close;
+$folder->delete(recurse=>1);                  # remove folder contents
+$folder->close if defined $folder;
 
 ok(! -f File::Spec->catfile($top, "f4"),      'empty folder clean-up'); 
-ok(! -d File::Spec->catfile($top, "f4.d"),    'empty subfolder clean-up'); 
+ok(! -d File::Spec->catfile($top, "f4.d"),    'subfolder dir clean-up'); 
 
 #
 # Write a folder, but at the same place is a subdir.  The subdir should

Added: packages/libmail-box-perl/branches/upstream/current/tests/44imap/30flags.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/44imap/30flags.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/44imap/30flags.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,133 @@
+#!/usr/bin/perl -T
+#
+# Test flags conversion of IMAP4 folders.
+
+use strict;
+use warnings;
+
+use lib qw(. .. tests);
+use Tools;
+
+use Test::More;
+use Mail::Transport::IMAP4;
+
+my $mti = 'Mail::Transport::IMAP4';
+
+BEGIN
+{   eval { require Mail::IMAPClient };
+    if($@ =~ m/Can't locate/)
+    {   plan skip_all => 'requires Mail::IMAPClient';
+        exit(0);
+    }
+    
+    eval { require Digest::HMAC_MD5 };
+    if($@ =~ m/Can't locate/)
+    {   plan skip_all => 'requires Digest::HMAC_MD5';
+        exit(0);
+    }
+
+    plan tests => 65;
+}
+
+###
+### Checking labels2flags
+###
+
+sub expect_flags($$$)
+{   my ($got, $expect, $text) = @_;
+    my $errors = 0;
+
+    my %got;
+    $got{$_}++ for split " ", $got;
+
+    if(grep {$_ > 1} values %got)
+    {   $errors++;
+        ok(0, "found double, $text");
+    }
+    else
+    {   ok(1, $text);
+    }
+
+    foreach my $e (split " ", $expect)
+    {   if(delete $got{$e}) { ok(1, "found $e")   }
+        else { $errors++;     ok(0, "missing $e") }
+    }
+
+    if(keys %got)
+    {   ok(0, "got too much: ".join(" ", keys %got));
+        $errors++;
+    }
+    else
+    {   ok(1, "exact match");
+    }
+
+    if($errors)
+    {   warn "$errors errors, expected '$expect' got '$got'\n";
+    }
+}
+
+my $flags = $mti->labelsToFlags();
+expect_flags($flags, '', "Empty set");
+
+$flags = $mti->labelsToFlags(seen => 1, flagged => 1, old => 1);
+expect_flags($flags, '\Seen \Flagged', "No old");
+
+$flags = $mti->labelsToFlags( {seen => 1, flagged => 1, old => 1} );
+expect_flags($flags, '\Seen \Flagged', "No old as hash");
+
+$flags = $mti->labelsToFlags(seen => 1, flagged => 1, old => 0);
+expect_flags($flags, '\Seen \Flagged \Recent', "No old");
+
+$flags = $mti->labelsToFlags( {seen => 1, flagged => 1, old => 0} );
+expect_flags($flags, '\Seen \Flagged \Recent', "No old as hash");
+
+$flags = $mti->labelsToFlags(seen => 1, replied => 1, flagged => 1,
+  deleted => 1, draft => 1, old => 0, spam => 1);
+expect_flags($flags, '\Seen \Answered \Flagged \Deleted \Draft \Recent \Spam',
+   "show all flags");
+
+$flags = $mti->labelsToFlags(seen => 0, replied => 0, flagged => 0,
+  deleted => 0, draft => 0, old => 1, spam => 0);
+expect_flags($flags, '', "show no flags");
+
+###
+### Checking flagsToLabels
+###
+
+sub expect_labels($$$)
+{   my ($got, $expect, $text) = @_;
+
+    my $gotkeys = join " ", %$got;
+    my $expkeys = join " ", %$expect;
+# warn "expected '$expkeys' got '$gotkeys'\n";
+
+    # depends on predefined labels
+    cmp_ok(scalar keys %$got, '==', 7, "$text; nr fields");
+
+    foreach my $k (keys %$got)
+    {   cmp_ok($got->{$k}, '==', $expect->{$k}, "got $k");
+    }
+
+    foreach my $k (keys %$expect)
+    {   cmp_ok($got->{$k}, '==', $expect->{$k}, "expect $k");
+    }
+}
+
+my $labels = $mti->flagsToLabels('REPLACE');
+expect_labels $labels, {old => 1}, "flagsToLabels: Empty set";
+
+$labels = $mti->flagsToLabels(REPLACE => qw[\Seen \Flagged] );
+expect_labels $labels
+            , {old => 1, seen => 1, flagged => 1}
+            , "flagsToLabels: Empty set";
+
+$labels = $mti->flagsToLabels(REPLACE =>
+              qw[\Seen \Answered \Flagged \Deleted \Draft \Recent \Spam] );
+
+expect_labels $labels
+            , { seen => 1, replied => 1, flagged => 1, deleted => 1
+              , draft => 1, spam => 1
+              }
+            , "show all labels";
+
+exit 0;

Modified: packages/libmail-box-perl/branches/upstream/current/tests/52manager/10open.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/52manager/10open.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/52manager/10open.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -19,7 +19,7 @@
 
 my $manager = Mail::Box::Manager->new
  ( log      => 'NOTICES'
- , trace    => 'ERRORS'
+ , trace    => 'NONE'
  );
 
 my $folder  = $manager->open
@@ -37,12 +37,12 @@
  );
 
 ok(!defined $second,                             'open same folder fails');
-my @warnings = $manager->report('WARNINGS');
-cmp_ok(@warnings, "==", 1,                       'mgr noticed double');
+my @errors = $manager->report('ERRORS');
+cmp_ok(@errors, "==", 1,                       'mgr noticed double');
 
-$warnings[-1] =~ s#\\mbox\.win#/mbox.src#g;  # Windows
+$errors[-1] =~ s#\\mbox\.win#/mbox.src#g;  # Windows
 
-is($warnings[-1], "Folder folders/mbox.src is already open.\n");
+is($errors[-1], "Folder folders/mbox.src is already open.");
 cmp_ok($manager->openFolders, "==", 1,           'only one folder open');
 
 undef $second;
@@ -57,10 +57,10 @@
 ok(! -f $new,                                   'folder file does not exist');
 ok(! defined $n,                                'open non-ex does not succeed');
 
- at warnings = $manager->report('WARNINGS');
-cmp_ok(@warnings, "==", 2,                      'new warning');
+my @warnings = $manager->report('WARNINGS');
+cmp_ok(@warnings, "==", 1,                      'new warning');
 $warnings[-1] =~ s#\\#/#g;  # Windows
-is($warnings[-1], "Folder does not exist, failed opening mbox folder folders/create.\n");
+is($warnings[-1], "Folder does not exist, failed opening mbox folder folders/create.");
 
 $manager->log('WARNINGS');  # back to default reporting.
 $manager->trace('WARNINGS');

Added: packages/libmail-box-perl/branches/upstream/current/tests/52manager/20user.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/52manager/20user.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/52manager/20user.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,36 @@
+#!/usr/bin/perl -T
+#
+# Test the user manager, which extends the normal manager
+
+use strict;
+use warnings;
+
+use Test::More;
+use Tools;
+
+use lib qw(. .. tests);
+use Mail::Box::Manage::User;
+
+BEGIN
+{   plan tests => 11;
+}
+
+my $id   = User::Identity->new('markov');
+ok(defined $id,                              "Identity created");
+isa_ok($id, 'User::Identity');
+
+my $user = Mail::Box::Manage::User->new(identity => $id);
+
+ok(defined $user,                            "User manager created");
+isa_ok($user, "Mail::Box::Manager");
+isa_ok($user, "Mail::Box::Manage::User");
+
+my $i   = $user->identity;
+ok(defined $i,                               "Identity defined");
+isa_ok($i, 'User::Identity');
+cmp_ok($id->name, 'eq', $i->name,            "Same id object");
+
+my $f   = $user->topfolder;
+ok(defined $f,                               "Folder structure created");
+isa_ok($f, 'Mail::Box::Identity');
+isa_ok($f, 'User::Identity::Item');

Added: packages/libmail-box-perl/branches/upstream/current/tests/52manager/30collect.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/52manager/30collect.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/52manager/30collect.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,198 @@
+#!/usr/bin/perl -T
+#
+# Collecting folders, without opening them
+
+use strict;
+use warnings;
+
+use Test::More;
+use Tools;
+
+use lib qw(. .. tests);
+use Mail::Box::Manage::User;
+use Mail::Box::MH;
+
+BEGIN
+{   plan tests => 72;
+}
+
+my @boxes =
+ qw( a1
+     a1/b1
+     a1/b2
+     a1/b2/c1
+     a1/b2/c2
+     a1/b2/c3
+     a1/b2/c3/d1
+     a1/b2/c3/d2
+     a1/b3
+     a2
+     a3
+   );
+
+# Create the directory hierarchy
+
+my $top = 'collect-test.tmp';
+clean_dir($top);
+mkdir $top or die "$top: $!";
+
+foreach my $box (@boxes)
+{   my $dir = "$top/$box";
+    mkdir $dir or die "$dir: $!";
+}
+
+# Now create the user
+
+my $id   = User::Identity->new('markov');
+ok(defined $id,                              "Identity created");
+isa_ok($id, 'User::Identity');
+
+my $user = Mail::Box::Manage::User->new
+ ( folderdir           => $top
+ , identity            => $id
+ , default_folder_type => 'mh'
+ );
+
+ok(defined $user,                            "User manager created");
+isa_ok($user, "Mail::Box::Manager");
+isa_ok($user, "Mail::Box::Manage::User");
+
+is($user->defaultFolderType, 'Mail::Box::MH');
+
+# Let's check the list of folders
+my $f = $user->topfolder;
+isa_ok($f, 'Mail::Box::Identity');
+
+is($f->folderType, 'Mail::Box::MH');
+is($f->location, $top);
+is($f->manager, $user);
+ok(! $f->onlySubfolders,                     "MH toplevel");
+
+ok(!defined $f->collection('subfolders'),    "Laziness");
+
+my @subnames = sort $f->subfolderNames;
+ok(defined $f->collection('subfolders'),     "loaded");
+
+cmp_ok(scalar(@subnames), '==', 3,           "Subfolder names found");
+is($subnames[0], 'a1');
+is($subnames[1], 'a2');
+is($subnames[2], 'a3');
+
+my @subs = sort {$a->name cmp $b->name} $f->subfolders;
+cmp_ok(scalar(@subs), '==', 3,               "Subfolders found");
+
+my $a1 = $subs[0];
+isa_ok($a1, 'Mail::Box::Identity');
+is($a1->name, 'a1');
+is($a1->fullname, '=/a1');
+is($a1->location, "$top/a1");
+
+is($subs[1]->name, 'a2');
+is($subs[1]->fullname, '=/a2');
+
+is($subs[2]->name, 'a3');
+is($subs[2]->fullname, '=/a3');
+
+isa_ok($f, 'User::Identity::Item');
+
+# One nested
+
+ok(!defined $a1->collection('subfolders'),    "Laziness of a1");
+my @a1names = sort $a1->subfolderNames;
+
+ok(defined $a1->collection('subfolders'),     "loaded");
+cmp_ok(scalar(@a1names), '==', 3,             "Subfolders a1 found");
+is($a1names[0], 'b1');
+is($a1names[1], 'b2');
+is($a1names[2], 'b3');
+
+my @a1subs = sort {$a->name cmp $b->name} $a1->subfolders;
+cmp_ok(scalar(@a1subs), '==', 3,               "Subfolders found");
+is($a1subs[1]->fullname, '=/a1/b2');
+
+my @a1subs2 = $a1->subfolders->sorted;
+ok(eq_array(\@a1subs, \@a1subs2),              "Auto-sort");
+
+# get a subfolder at once
+
+my $l0 = $f->folder();
+ok(defined $l0,                                "Subfolder top");
+isa_ok($l0, 'Mail::Box::Identity');
+is($l0->fullname, "=");
+is($l0->topfolder->name, '=');
+
+my $l1 = $f->folder('a2');
+ok(defined $l1,                                "Subfolder level 1");
+isa_ok($l1, 'Mail::Box::Identity');
+is($l1->fullname, "=/a2");
+is($l1->topfolder->name, '=');
+
+ok(!defined $f->folder('xx'),               "Subfolder level 1 fail");
+
+my $l2 = $f->folder('a1', 'b3');
+ok(defined $l2,                                "Subfolder level 2");
+is($l2->fullname, "=/a1/b3");
+is($l2->topfolder->name, '=');
+
+my $l4 = $f->folder('a1', 'b2', 'c3', 'd1');
+ok(defined $l4,                                "Subfolder level 4");
+isa_ok($l4, 'Mail::Box::Identity');
+is($l4->fullname, "=/a1/b2/c3/d1");
+is($l4->topfolder->name, '=');
+
+ok(! defined$f->folder('a1', 'b3', 'xx', 'yy'), "Subfolder level 3 fail");
+
+# Walk the tree
+
+my $count = 0;
+$f->foreach( sub {$count++} );
+cmp_ok($count, '==', @boxes+1,                 "Walk the tree");
+                    # +1 for top folder
+
+my @all;
+sub catch_fn($)
+{   my $fn = $_[0]->fullname;
+    return if $fn eq '=';
+    $fn =~ s!^\=/!!;
+    push @all, $fn;
+}
+$f->foreach(\&catch_fn);
+ok(eq_array(\@all, \@boxes),                   "Walk alphabetically");
+
+#
+# Test remove
+#
+
+my $c3 = $f->folder('a1', 'b2')->remove('c3');
+ok(defined $c3,                                "Remove c3, found");
+isa_ok($c3, 'Mail::Box::Identity');
+is($c3->name, "c3");
+
+my $c3d = $f->folder('a1', 'b2', 'c3');
+ok(!defined $c3d);
+
+my @a1b2names = sort $f->folder('a1', 'b2')->subfolderNames;
+cmp_ok(scalar(@a1b2names), '==', 2,            "parent still exists");
+is($a1b2names[0], 'c1');
+is($a1b2names[1], 'c2');
+
+#
+# Test rename
+#
+
+my $x = $f->folder('a1', 'b2', 'c1');
+ok(defined $x,                                "a1/b2/c1 exists");
+my $dest = $f->folder('a3');
+ok(defined $dest,                             "a3 exists");
+my $y = $x->rename($dest, 'b8');
+ok(defined $y,                                "rename successful");
+isa_ok($y, 'Mail::Box::Identity');
+is($y->name, 'b8');
+is($x->name, 'b8');
+is($y->parent->parent->name, 'a3');
+is($y->fullname, '=/a3/b8');
+is($y->fullname('#'), '=#a3#b8');
+is($y->location, "$top/a3/b8");
+
+
+clean_dir($top);

Added: packages/libmail-box-perl/branches/upstream/current/tests/60imap/10fetch.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/60imap/10fetch.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/60imap/10fetch.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,219 @@
+#!/usr/bin/perl -T
+#
+# Test body-structure capturing for IMAP servers
+
+use strict;
+use warnings;
+
+use Test::More;
+use Tools;
+
+use lib qw(. .. tests);
+use Mail::Message;
+use Mail::Message::Body::Lines;
+use Mail::Server::IMAP4::Fetch;
+
+my $msif = 'Mail::Server::IMAP4::Fetch';
+
+BEGIN
+{   plan tests => 44;
+}
+
+my $msg = Mail::Message->build
+ ( From    => 'I myself and me <me at localhost>'
+ , To      => 'you at example.com'
+ , Date    => 'now'
+ , Subject => 'Life of Brian'
+ , 'Message-ID' => 'unique'
+
+ , data    => [ "two\n", "lines\n" ]
+ );
+
+ok($msg, "First, simple message built");
+
+my $f = $msif->new($msg);
+isa_ok($f, $msif);
+ok($f->part() == $f);
+ok(!defined $f->part('1'));
+
+#use Data::Dumper;
+#print Dumper $f;
+
+is($f->fetchBody(0)."\n", <<__BODY, '...body');
+("TEXT" "PLAIN" () "<unique>" NIL "8BIT" 10 2)
+__BODY
+
+is($f->fetchBody(1)."\n", <<__BODYSTRUCT, '...bodystruct');
+("TEXT" "PLAIN" () "<unique>" NIL "8BIT" 10 2 NIL ("inline") NIL)
+__BODYSTRUCT
+
+is($f->fetchEnvelope."\n", <<__ENVELOPE, '...envelope');
+("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "<unique>")
+__ENVELOPE
+
+#
+# Simple multipart
+#
+
+my $data = Mail::Message::Body::Lines->new
+ ( mime_type => 'audio/mpeg3'
+ , transfer_encoding => 'base64'
+ , charset   => 'utf8'
+ , data      => "ABBA\n"
+ );
+
+my $mp = Mail::Message->build
+ ( From      => 'me'
+ , Date      => 'now'
+ , Subject   => 'multi'
+ , 'Message-ID' => 'unique'
+
+ , data      => [ "two\n", "lines\n" ]
+ , attach    => $data
+ );
+
+ok(defined $mp, "Simple multipart");
+
+$f = $msif->new($mp);
+isa_ok($f, $msif);
+
+ok($f->part() == $f);
+
+is($f->fetchBody(0)."\n", <<__BODY, '...body');
+(("TEXT" "PLAIN" () NIL NIL "8BIT" 10 2)("AUDIO" "MPEG3" ("charset" "utf8") NIL NIL "BASE64" 5 1) "MIXED")
+__BODY
+
+is($f->fetchBody(1)."\n", <<__BODYSTRUCT, '...bodystruct');
+(("TEXT" "PLAIN" () NIL NIL "8BIT" 10 2 NIL ("inline") NIL)("AUDIO" "MPEG3" ("charset" "utf8") NIL NIL "BASE64" 5 1 NIL ("attachment") NIL) "MIXED")
+__BODYSTRUCT
+
+is($f->fetchEnvelope."\n", <<__ENVELOPE, '...envelope');
+("now" "multi" NIL NIL NIL NIL NIL NIL NIL "<unique>")
+__ENVELOPE
+
+ok($f->part('1'), "Has two parts");
+ok($f->part('2'));
+ok(!$f->part('3'));
+ok(!$f->part('1.1'));
+
+my $g = $f->part('2');
+isa_ok($g, $msif);
+
+is($g->fetchBody(0)."\n", <<__BODY, '...body');
+("AUDIO" "MPEG3" ("charset" "utf8") NIL NIL "BASE64" 5 1)
+__BODY
+
+is($g->fetchBody(1)."\n", <<__BODYSTRUCT, '...bodystruct');
+("AUDIO" "MPEG3" ("charset" "utf8") NIL NIL "BASE64" 5 1 NIL ("attachment") NIL)
+__BODYSTRUCT
+
+is($g->fetchEnvelope."\n", <<__ENVELOPE, '...envelope');
+(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)
+__ENVELOPE
+
+#
+# All fields in an envelope
+#
+
+                                                                                
+my $a = Mail::Message->build
+ ( From => 'FROM <from at from.home>'
+ , To   => 'TO <to at to.home>'
+ , Cc   => 'CC <cc at cc.home>'
+ , Bcc  => 'BCC <bcc at bcc.home>'
+ , Sender => 'SENDER <sender at sender.home>'
+ , 'Reply-To' => 'RT <replyto at rt.home>'
+ , Date => 'today'
+ , Subject => 'subject'
+ , 'Content-Type' => 'video/vhs; charset="utf8"'
+ , 'Content-Disposition' => 'attachment; filename="private-video.ras"; size=100'
+ , 'Content-Language' =>  'nl-NL, nl-BE'
+ , 'Content-Description' => 'blue movie'
+ , 'Message-ID' => 'unique-id-123'
+ , data => "BINARY data for video"
+ );
+
+ok(defined $a, "Full envelope");
+#$a->print(\*STDERR);
+
+##### get should become study
+## my $s = $a->study('Content-Disposition');
+## isa_ok($s, 'Mail::Message::Field::Structured');
+
+my $s = $a->head->get('Content-Disposition');
+isa_ok($s, 'Mail::Message::Field');
+
+is($s->attribute('filename'), 'private-video.ras', '...one attr');
+my %attrs = $s->attributes;
+cmp_ok(keys %attrs, '==', 2, '...nr attrs');
+is($attrs{filename}, 'private-video.ras', '...filename');
+is($attrs{size}, 100, '...size');
+
+$f = $msif->new($a);
+isa_ok($f, $msif);
+
+is($f->fetchBody(0)."\n", <<__BODY, "...body");
+("VIDEO" "VHS" ("charset" "utf8") "<unique-id-123>" "blue movie" "BASE64" 29 1)
+__BODY
+
+is($f->fetchBody(1)."\n", <<__BODYSTRUCT, "...bodystruct");
+("VIDEO" "VHS" ("charset" "utf8") "<unique-id-123>" "blue movie" "BASE64" 29 1 NIL ("attachment" "filename" "private-video.ras" "size" "100") "nl-NL, nl-BE")
+__BODYSTRUCT
+
+is($f->fetchEnvelope."\n", <<__ENVELOPE, "...envelope");
+("today" "subject" ("FROM" NIL "from" "from.home") ("SENDER" NIL "sender" "sender.home") ("RT" NIL "replyto" "rt.home") ("TO" NIL "to" "to.home") ("CC" NIL "cc" "cc.home") ("BCC" NIL "bcc" "bcc.home") NIL "<unique-id-123>")
+__ENVELOPE
+
+#
+# Nested
+#
+
+my $b = Mail::Message->build
+ ( To => 'someelse at somewhere.aq'
+ , 'Message-Id' => 'newid'
+ , Date   => 'tomorrow'
+ , attach => $msg
+ );
+
+ok(defined $b, "Constructed nested message");
+
+isa_ok($b, 'Mail::Message');
+ok($b->isNested, 'check structure');
+
+$f = $msif->new($b);
+isa_ok($f, $msif);
+
+#$b->print(\*STDERR);
+
+is($f->fetchBody(0)."\n", <<__BODY, "...body");
+("MESSAGE" "RFC822" () "<newid>" NIL "8BIT" 223 ("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "<unique>") ("TEXT" "PLAIN" () "<unique>" NIL "8BIT" 10 2) 13)
+__BODY
+
+is($f->fetchBody(1)."\n", <<__BODYSTRUCT, "...bodystruct");
+("MESSAGE" "RFC822" () "<newid>" NIL "8BIT" 223 ("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "<unique>") ("TEXT" "PLAIN" () "<unique>" NIL "8BIT" 10 2 NIL ("inline") NIL) 13 NIL ("inline") NIL)
+__BODYSTRUCT
+
+is($f->fetchEnvelope."\n", <<__ENVELOPE, "...envelope");
+("tomorrow" NIL NIL NIL NIL (NIL NIL "someelse" "somewhere.aq") NIL NIL NIL "<newid>")
+__ENVELOPE
+
+#$b->print(\*STDERR);
+
+$g = $f->part('1');
+ok(defined $g, "nested info");
+
+isa_ok($g, $msif);
+ok($f != $g);
+
+is($g->fetchBody(0)."\n", <<__BODY, "...body");
+("TEXT" "PLAIN" () "<unique>" NIL "8BIT" 10 2)
+__BODY
+
+is($g->fetchBody(1)."\n", <<__BODYSTRUCT, "...bodystruct");
+("TEXT" "PLAIN" () "<unique>" NIL "8BIT" 10 2 NIL ("inline") NIL)
+__BODYSTRUCT
+
+is($g->fetchEnvelope."\n", <<__ENVELOPE, "...envelope");
+("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "<unique>")
+__ENVELOPE
+

Added: packages/libmail-box-perl/branches/upstream/current/tests/60imap/20list.t
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/60imap/20list.t	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/60imap/20list.t	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,279 @@
+#!/usr/bin/perl -T
+# Test list command for IMAP servers
+#
+# A lot of the basic administration handling is tested in 52manager/30collect.t
+
+use strict;
+use warnings;
+
+use Test::More;
+use Tools;
+
+use lib qw(. .. tests);
+use Mail::Server::IMAP4::List;
+use Mail::Box::MH;
+use Mail::Box::Identity;
+
+my $msil = 'Mail::Server::IMAP4::List';
+my $mbi  = 'Mail::Box::Identity';
+
+BEGIN
+{   plan tests => 41;
+}
+
+my @boxes =
+ qw( a1
+     a1/b1
+     a1/b2
+     a1/b2/c1
+     a1/b2/c2
+     a1/b2/c3
+     a1/b2/c3/d1
+     a1/b2/c3/d2
+     a1/b3
+     a2
+     a3
+   );
+
+# Create the directory hierarchy
+
+my $top = '60imap-test';
+clean_dir($top);
+mkdir $top or die "$top: $!";
+
+foreach my $box (@boxes)
+{   my $dir = "$top/$box";
+    mkdir $dir or die "$dir: $!";
+}
+
+
+# Create the top object
+
+my $folders = $mbi->new
+ ( name        => '='
+ , folder_type => 'Mail::Box::MH'
+ , only_subs   => 1
+ );
+
+ok(defined $folders,                        "Created the top folder");
+isa_ok($folders, $mbi);
+
+
+# Load the structure
+
+my $count = 0;
+sub setloc($)
+{   my $node = shift;
+    my $full = $node->fullname;
+    $full =~ s/^\=/$top/;
+    $node->location($full);
+    $count++;
+}
+
+$folders->foreach(\&setloc);
+
+cmp_ok($count, '==', @boxes+1,              "Succesfully expanded");
+ok($folders->onlySubfolders,                "top without msgs");
+my $a1 =  $folders->folder('a1');
+ok(defined $a1,                             "found $a1");
+ok(!$a1->onlySubfolders,                    "other with msgs");
+
+#
+# Let's do the simple LIST check.
+#
+
+sub str(@)
+{   return '' unless @_;
+    my @lines;
+    foreach my $record (@_)
+    {   my($flags, $delim, $rest) = @$record;
+        $rest = '""' unless length $rest;
+        push @lines, "$flags \"$delim\" $rest\n";
+    }
+    join '', @lines;
+}
+
+my $imap = $msil->new(folders => $folders, delimiter => '#');
+isa_ok($imap, $msil);
+
+is(str($imap->list('', '')), <<'__DELIM',   'as for delim');
+(\Noselect) "#" ""
+__DELIM
+
+is(str($imap->list('#', 'a1')), <<'__DELIM');
+() "#" #a1
+__DELIM
+
+$folders->folder('a1')->deleted(1);
+is(str($imap->list('#', 'a1')), <<'__DELIM');
+(\Noselect) "#" #a1
+__DELIM
+
+$folders->folder('a1')->deleted(0);
+is(str($imap->list('#', 'a1')), <<'__DELIM');
+() "#" #a1
+__DELIM
+
+$folders->folder('a1')->onlySubfolders(1);
+is(str($imap->list('#', 'a1')), <<'__DELIM');
+(\Noselect) "#" #a1
+__DELIM
+
+$folders->folder('a1')->marked(1);
+is(str($imap->list('#', 'a1')), <<'__DELIM', 'marked');
+(\Noselect \Marked) "#" #a1
+__DELIM
+
+$folders->folder('a1')->marked(0);
+is(str($imap->list('#', 'a1')), <<'__DELIM', 'unmarked');
+(\Noselect \Unmarked) "#" #a1
+__DELIM
+
+$folders->folder('a1')->marked(undef);
+is(str($imap->list('#', 'a1')), <<'__DELIM', 'not marked');
+(\Noselect) "#" #a1
+__DELIM
+
+is(str($imap->list('a1', 'b1')), <<'__DELIM', 'straight forward');
+() "#" #a1#b1
+__DELIM
+
+is(str($imap->list('a1', 'none')), <<'__DELIM', 'missing');
+__DELIM
+
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'stacking');
+() "#" #a1#b2#c3
+__DELIM
+
+#
+# Flags
+#
+
+my $abc = $folders->folder('a1', 'b2', 'c3');
+ok(defined $abc,                                  'got abc');
+
+$abc->marked(1);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc marked');
+(\Marked) "#" #a1#b2#c3
+__DELIM
+
+$abc->marked(0);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc unmarked');
+(\Unmarked) "#" #a1#b2#c3
+__DELIM
+
+$abc->marked(undef);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc undef marked');
+() "#" #a1#b2#c3
+__DELIM
+
+$abc->inferiors(0);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc no inferiors');
+(\Noinferiors) "#" #a1#b2#c3
+__DELIM
+
+$abc->inferiors(1);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc inferiors');
+() "#" #a1#b2#c3
+__DELIM
+
+$abc->inferiors(0);
+$abc->marked(1);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc inferiors');
+(\Noinferiors \Marked) "#" #a1#b2#c3
+__DELIM
+
+$abc->inferiors(1);
+$abc->marked(1);
+is(str($imap->list('a1#b2', 'c3')), <<'__DELIM',  'abc inferiors');
+(\Marked) "#" #a1#b2#c3
+__DELIM
+
+#
+# Now for some real searching
+#
+
+is(str($imap->list('a1#none', '%')), <<'__DELIM', 'find none %');
+__DELIM
+
+is(str($imap->list('a1#none', '*')), <<'__DELIM', 'find none *');
+__DELIM
+
+is(str($imap->list('a1#b1', '%')), <<'__DELIM', 'find here %');
+() "#" #a1#b1
+__DELIM
+
+is(str($imap->list('a1#b1', '*')), <<'__DELIM', 'find here *');
+() "#" #a1#b1
+__DELIM
+
+is(str($imap->list('a1#b2', '%')), <<'__DELIM', 'find none %');
+() "#" #a1#b2#c1
+() "#" #a1#b2#c2
+(\Marked) "#" #a1#b2#c3
+__DELIM
+
+is(str($imap->list('a1#b2', '*')), <<'__DELIM', 'find none *');
+() "#" #a1#b2
+() "#" #a1#b2#c1
+() "#" #a1#b2#c2
+(\Marked) "#" #a1#b2#c3
+() "#" #a1#b2#c3#d1
+() "#" #a1#b2#c3#d2
+__DELIM
+
+is(str($imap->list('a1', '%#b3')), <<'__DELIM', 'find inside %');
+__DELIM
+
+is(str($imap->list('a1', '*#b3')), <<'__DELIM', 'find inside *');
+() "#" #a1#b3
+__DELIM
+
+is(str($imap->list('a1', 'b2#*')), <<'__DELIM', 'find inside *');
+() "#" #a1#b2
+() "#" #a1#b2#c1
+() "#" #a1#b2#c2
+(\Marked) "#" #a1#b2#c3
+() "#" #a1#b2#c3#d1
+() "#" #a1#b2#c3#d2
+__DELIM
+
+is(str($imap->list('a1', '*#c2')), <<'__DELIM', 'find inside *');
+() "#" #a1#b2#c2
+__DELIM
+
+is(str($imap->list('a1', '*#d2')), <<'__DELIM', 'find inside *');
+() "#" #a1#b2#c3#d2
+__DELIM
+
+#
+# Complicated delimiter, as defined by the RFC.  Examples in 6.3.8
+#
+
+sub combi_delim($)
+{   my $path = shift;
+    my ($delim, $root)
+      = $path =~ m/^(#news\.)/ ? ('.', $1)
+      : $path =~ m!^/!         ? ('/', '/')
+      :                          ('/', '');
+    wantarray ? ($delim, $root) : $delim;
+}
+
+$folders->onlySubfolders(0);
+ok(! $folders->onlySubfolders);
+
+$imap = $msil->new(folders => $folders, delimiter => \&combi_delim);
+
+is(str($imap->list('', '')), <<'__DELIM',   'combi delim');
+(\Noselect) "/" ""
+__DELIM
+
+is(str($imap->list('#news.comp.mail.misc', '')), <<'__DELIM');
+(\Noselect) "." #news.
+__DELIM
+
+is(str($imap->list('/usr/staff/jones', '')), <<'__DELIM');
+(\Noselect) "/" /
+__DELIM
+
+clean_dir($top);

Added: packages/libmail-box-perl/branches/upstream/current/tests/60imap/Definition.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/60imap/Definition.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/60imap/Definition.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -0,0 +1,8 @@
+
+package MailBox::Test::60imap::Definition;
+
+sub name     {"Mail::Server::IMAP; imap server"}
+sub critical {0}
+sub skip     { undef }
+
+1;

Modified: packages/libmail-box-perl/branches/upstream/current/tests/Tools.pm
===================================================================
--- packages/libmail-box-perl/branches/upstream/current/tests/Tools.pm	2005-03-30 17:41:50 UTC (rev 838)
+++ packages/libmail-box-perl/branches/upstream/current/tests/Tools.pm	2005-03-30 17:42:04 UTC (rev 839)
@@ -229,6 +229,7 @@
 
 sub compare_lists($$)
 {   my ($first, $second) = @_;
+#warn "[@$first]==[@$second]\n";
     return 0 unless @$first == @$second;
     for(my $i=0; $i<@$first; $i++)
     {   return 0 unless $first->[$i] eq $second->[$i];




More information about the Pkg-perl-cvs-commits mailing list