Hi Mark,
Per RFC 3501, Section 2.3.2. Flags Message Attribute:
Note: The \Recent system flag is a special case of a
session flag. \Recent can not be used as an argument in a
STORE or APPEND command, and thus can not be changed at
all.
As you have discovered, the server controls the \Recent flag. That is why the
code, per the RFC, tries to ensure we do not attempt to set that flag. That is
also why your attempts to set it fail. This is an IMAP thing, I just wouldn't
worry about \Recent too much because of this protocol limitation.
I will close this bug as invalid. Although I will try to add a note to the
documentation regarding this flag (and the migrate docs are *really* bad/wrong
anyway).
As for why $peer->LastError() doesn't return any error info on the APPEND failure,
well... it appears that the code is appending to $self instead of $peer! I'll
release a patch for this soon. Here's a diff in case you want to test:
[ppearl@vmwork mail-imapclient]$ git diff
diff --git a/lib/Mail/IMAPClient.pm b/lib/Mail/IMAPClient.pm
index b1fe956..3618c41 100644
--- a/lib/Mail/IMAPClient.pm
+++ b/lib/Mail/IMAPClient.pm
@@ -7,7 +7,7 @@ use strict;
use warnings;
package Mail::IMAPClient;
-our $VERSION = '3.26';
+our $VERSION = '3.27_01';
use Mail::IMAPClient::MessageSet;
@@ -876,7 +876,7 @@ sub migrate {
$self->message_to_file( \$msg, $mid )
or return undef;
- my $newid = $self->append_file( $dfolder, \$msg, undef, $flags, $date );
+ my $newid = $peer->append_file( $dfolder, \$msg, undef, $flags, $date );
unless ( defined $newid ) {
$self->LastError(