* Daniel Westermann-Clark via RT (bug-Mail-Box@rt.cpan.org) [120917 05:17]:
Show quoted text> Mon Sep 17 01:17:00 2012: Request 79680 was acted upon.
> Transaction: Ticket created by DANIELTWC
> Queue: Mail-Box
> Subject: Add internaldate support to Mail::Transport::IMAP4
> Broken in: 2.106
> Severity: (no value)
> Owner: Nobody
> Requestors: danieltwc@cpan.org
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=79680 >
>
> I'm importing mail into an IMAP server using Mail::Box and found that the
> server was reporting the time each message was appended to the folder as
> when it was received.
Good idea. The implementation needs some work, for instance because the
Mail::Box::IMAP4 implementation is not complete.
So, to integrate this with Mail::Box, we should
. implement appendMessage() in Mail::Box::IMAP4 (as all other backends
have) Simple to implement, but I have no IMAP4 server myself to
test it (and enough other projects on my hands)
. try to extract the default date from the fromLine when available
(the separator line in Mbox files) However, this may not be
available, because the message get's coerced into a IMAP message
before appendMessage is called. On the other hand, we may need
to add this date into into the Mail::Box::IMAP4::Message object
as well.
. as fallback, try to extract the date from the Received headers
automatically. Something like
my @rgs = $msg->resentGroups;
my $date = @rgs ? $rgs[0]->received : undef;
I like the library to do the best thing, not to lazily depend on the
main program to understand the World.
Show quoted text> sub appendMessage($$)
> -{ my ($self, $message, $foldername) = @_;
> +{ my ($self, $message, $foldername, $date) = @_;
> my $imap = $self->imapClient or return ();
>
> $imap->append_string
> ( $foldername, $message->string
> , $self->labelsToFlags($message->labels)
> + , $date
> );
> }
This patch is taken. I have updated the docs as well.
I hope you have to time to spend on above additions.
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net