Skip to content

Commit

Permalink
imap: allow large literals with APPEND
Browse files Browse the repository at this point in the history
The APPEND command (with some tag) can come in different varieties:

	A01 APPEND inbox {n}
	A02 APPEND inbox (flags) {n}
	A03 APPEND inbox (time) {n}
	A04 APPEND inbox (flags) (time) {n}

imap_parse_args() transforms those into 3, 4, 4 and 5 arguments, respectively,
as empty literals are suppressed (to be visited another time).

The imap_cmd_parser_append_begin2() function certainly deals
with argc==3, so the result of imap_parse_args() seems acceptable.

References: GXH-60, GXL-417
  • Loading branch information
jengelh committed Jul 26, 2023
1 parent d846910 commit 753c1a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mra/imap/imap_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ static int ps_literal_processing(IMAP_CONTEXT *pcontext)
char *argv[128];
auto argc = parse_imap_args(pcontext->command_buffer, pcontext->command_len,
argv, std::size(argv));
if (argc >= 4 && 0 == strcasecmp(argv[1], "APPEND")) {
if (argc >= 3 && 0 == strcasecmp(argv[1], "APPEND")) {
/* Special handling for APPEND with potentially huge literals */
switch (imap_cmd_parser_append_begin(argc, argv, pcontext)) {
case DISPATCH_CONTINUE: {
Expand Down

0 comments on commit 753c1a9

Please sign in to comment.