]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fail silently if selected mailbox format doesn't support GUIDs.
authorTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2015 15:32:23 +0000 (18:32 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2015 15:32:23 +0000 (18:32 +0300)
src/imap/imap-state.c

index 07b9abb044543d38ed324f944842f87e4b59543f..a7e93be613da3bf0a8cabae19ff087a2dc356a2a 100644 (file)
@@ -213,6 +213,7 @@ imap_state_export_mailbox(buffer_t *dest, struct client *client,
         struct mailbox_status status;
        struct mailbox_metadata metadata;
        const char *vname = mailbox_get_vname(box);
+       enum mail_error mail_error;
 
        mailbox_get_open_status(box, STATUS_UIDVALIDITY | STATUS_UIDNEXT |
                                STATUS_MESSAGES | STATUS_HIGHESTMODSEQ |
@@ -224,8 +225,9 @@ imap_state_export_mailbox(buffer_t *dest, struct client *client,
        }
 
        if (mailbox_get_metadata(box, MAILBOX_METADATA_GUID, &metadata) < 0) {
-               *error_r = mailbox_get_last_error(box, NULL);
-               return -1;
+               *error_r = mailbox_get_last_error(box, &mail_error);
+               /* if the selected mailbox can't have a GUID, fail silently */
+               return mail_error == MAIL_ERROR_NOTPOSSIBLE ? 0 : -1;
        }
 
        buffer_append_c(dest, IMAP_STATE_TYPE_MAILBOX);