Mercurial > dovecot > original-hg > dovecot-1.2
diff src/imap/cmd-append.c @ 1168:03f1455664d7 HEAD
Added setting to limit length of custom flag names.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 14 Feb 2003 10:00:51 +0200 |
parents | 47ecd950a702 |
children | 69261ad92783 |
line wrap: on
line diff
--- a/src/imap/cmd-append.c Fri Feb 14 10:00:01 2003 +0200 +++ b/src/imap/cmd-append.c Fri Feb 14 10:00:51 2003 +0200 @@ -46,10 +46,12 @@ int cmd_append(struct client *client) { struct mailbox *box; + struct mailbox_status status; struct mail_save_context *ctx; struct imap_parser *save_parser; struct imap_arg *args; struct imap_arg_list *flags_list; + struct mailbox_custom_flags old_flags; struct mail_full_flags flags; time_t internal_date; const char *mailbox, *internal_date_str, *error; @@ -71,6 +73,16 @@ return TRUE; } + if (!box->get_status(box, STATUS_CUSTOM_FLAGS, &status)) { + client_send_storage_error(client); + box->close(box); + return TRUE; + } + memset(&old_flags, 0, sizeof(old_flags)); + old_flags.pool = data_stack_pool; + client_save_custom_flags(&old_flags, status.custom_flags, + status.custom_flags_count); + ctx = box->save_init(box, TRUE); if (ctx == NULL) { client_send_storage_error(client); @@ -141,7 +153,7 @@ if (flags_list != NULL) { if (!client_parse_mail_flags(client, flags_list->args, - &flags)) + &old_flags, &flags)) break; } else { memset(&flags, 0, sizeof(flags));