Greetings,
I am trying to migrate mail folders from standard mbox format into
IMAP. I would like to preserve their flags if possible (replied,
forwarded, etc.). I have been able to preserve replied, but I have not
been able to preserve forwarded.
First, I'm confident that my server supports forwarded:
* FLAGS ($Forwarded \Answered \Flagged \Deleted \Draft \Seen)
* OK [PERMANENTFLAGS ($Forwarded \* \Answered \Flagged \Deleted \Draft \Seen)]
Permanent flags
and even on other mailboxes that don't have a forwarded message, \* is
defined in PERMANENTFLAGS, so I think I'm good to go.
Now, in my migration code (a python script) I log into the IMAP
reading one message at a time. I log into the IMAP server,
then parse a mbox and read one message at a time. I have not SELECTed
a particular mailbox, but I'm not sure I have to. I'm then using the
APPEND command to append the message to the mailbox. APPEND takes the
mailbox name as an argument, and also the flag list and the message.
I can set that flag list to \Answered and it works fine:
\Answered
('OK', ['APPEND completed'])
But I can't set it to $Forwarded:
$Forwarded
('NO', ['APPEND failed: Unknown flag: $Forwarded'])
and I'm at a loss as to what to do. I believe this has something to do
with $Forwarded being a keyword, but I don't know how to set a
keyword. I'd like to at least try to use STORE to set the flag
manually, but I don't have the UID for the message I just APPENDed.
Since I'm an IMAP rookie, I'm happy to have help from this community;
if you could a) offer suggestions to fix what I've done wrong so I can
store $Forwarded, and b) offer suggestions as to how you'd accomplish
this task in a better way than I've designed, I'd be much obliged.
Thanks!
JDO
--
-----------------------------------------------------------------
For information about this mailing list, and its archives, see:
http://www.washington.edu/imap/imap-list.html
-----------------------------------------------------------------