From: Timo Sirainen Date: Tue, 8 Sep 2015 15:45:28 +0000 (+0300) Subject: lib-storage: Use MAIL_ERROR_NOTPOSSIBLE if mailbox_attribute_*set() fails for read... X-Git-Tag: 2.2.19.rc1~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e09e28395b98fa7c9ef08fce644ce10a99d5458;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Use MAIL_ERROR_NOTPOSSIBLE if mailbox_attribute_*set() fails for read-only attribute. MAIL_ERROR_PARAMS indicates that there was something wrong with the parameters itself. But the caller can't know (at least with current APIs) if it's a read-only attribute it's trying to change before actually doing it. --- diff --git a/src/lib-storage/mailbox-attribute.c b/src/lib-storage/mailbox-attribute.c index cc9f2b5d68..41e331b467 100644 --- a/src/lib-storage/mailbox-attribute.c +++ b/src/lib-storage/mailbox-attribute.c @@ -172,7 +172,7 @@ mailbox_attribute_set_common(struct mailbox_transaction_context *t, break; case MAIL_ATTRIBUTE_INTERNAL_RANK_AUTHORITY: if (iattr->set == NULL) { - mail_storage_set_error(t->box->storage, MAIL_ERROR_PARAMS, t_strdup_printf( + mail_storage_set_error(t->box->storage, MAIL_ERROR_NOTPOSSIBLE, t_strdup_printf( "The /%s/%s attribute cannot be changed", (type == MAIL_ATTRIBUTE_TYPE_SHARED ? "shared" : "private"), key)); return -1;