rewind (fp);
imap_munge_mbox_name (mbox, sizeof (mbox), mailbox);
- snprintf (buf, sizeof (buf), "APPEND %s (\\Seen%s%s) {%lu}", mbox,
- msg->flags.replied ? " \\Answered" : "",
- msg->flags.flagged ? " \\Flagged" : "",
+ snprintf (buf, sizeof (buf), "APPEND %s (%s%s%s%s%s) {%lu}", mbox,
+ msg->flags.read ? "\\Seen" : "",
+ msg->flags.read && (msg->flags.replied || msg->flags.flagged) ? " " : "",
+ msg->flags.replied ? "\\Answered" : "",
+ msg->flags.replied && msg->flags.flagged ? " " : "",
+ msg->flags.flagged ? "\\Flagged" : "",
(unsigned long) len);
imap_cmd_start (idata, buf);
static int msg_fetch_header_fetch (CONTEXT* ctx, IMAP_HEADER* h, char* buf, FILE* fp)
{
IMAP_DATA* idata;
- long bytes;
int rc = -1; /* default now is that string isn't FETCH response*/
idata = (IMAP_DATA*) ctx->data;