The GetRestURL command extracts all of the metadata as well. If you look at the .tgz or .zip file it creates, there is a .meta file for each email, and "unread" is one of the flags (which corresponds to the IMAP "seen" flag).
On the IMAP note, one thing you can do is extract the crypted password from the previously mentioned commands, set the password to a generic one that your script is aware of to access the account with IMAP, and then reset it back to the crypted password when the IMAP process is complete. |