Commit a6dfcb46 a6dfcb46989861fbb5a4f80913ee502d91e2e853 by Sergey Poznyakoff

Bugfixes.

* imap4d/copy.c, imap4d/fetch.c, imap4d/store.c: Do not report
error on non-existing message sets (RFC 3501, section 6.4.8).
* imap4d/testsuite/imap4d/IDEF0955.exp: Reflect this behavior.
* imap4d/testsuite/imap4d/fetch.exp: Header names in replies
to BODY[HEADER.FIELDS...] are no longer quoted.
1 parent 28f1bd41
2008-08-13 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* imap4d/copy.c, imap4d/fetch.c, imap4d/store.c: Do not report
error on non-existing message sets (RFC 3501, section 6.4.8).
* imap4d/testsuite/imap4d/IDEF0955.exp: Reflect this behavior.
* imap4d/testsuite/imap4d/fetch.exp: Header names in replies
to BODY[HEADER.FIELDS...] are no longer quoted.
2008-08-11 Sergey Poznyakoff <gray@gnu.org.ua>
More bugfixes in imap4d.
......
......@@ -81,8 +81,10 @@ imap4d_copy0 (imap4d_tokbuf_t tok, int isuid, char **err_text)
status = util_msgset (msgset, &set, &n, isuid);
if (status != 0)
{
*err_text = "Bogus number set";
return RESP_BAD;
/* See RFC 3501, section 6.4.8, and a comment to the equivalent code
in fetch.c */
*err_text = "Completed";
return RESP_OK;
}
mailbox_name = namespace_getfullpath (name, delim);
......
......@@ -1598,8 +1598,19 @@ imap4d_fetch0 (imap4d_tokbuf_t tok, int isuid, char **err_text)
status = util_msgset (msgset, &set, &n, isuid);
if (status != 0)
{
*err_text = "Bogus number set";
return RESP_BAD;
/* RFC3501, section 6.4.8.
A non-existent unique identifier is ignored without any error
message generated. Thus, it is possible for a UID FETCH command
to return an OK without any data or a UID COPY or UID STORE to
return an OK without performing any operations.
Obviously the same holds true for non-existing message numbers
as well, although I did not find any explicit mention thereof
in the RFC. */
*err_text = "Completed";
return RESP_OK;
}
/* Compile the expression */
......
......@@ -116,7 +116,12 @@ imap4d_store0 (imap4d_tokbuf_t tok, int isuid, char **ptext)
/* Get the message numbers in set[]. */
status = util_msgset (msgset, &set, &n, isuid);
if (status != 0)
parsebuf_exit (&pb, "Bogus number set");
{
/* See RFC 3501, section 6.4.8, and a comment to the equivalent code
in fetch.c */
*ptext = "Completed";
return RESP_OK;
}
if (pb.token[0] != '(')
parsebuf_exit (&pb, "Syntax error");
......
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2005, 2007 Free Software Foundation
# Copyright (C) 2005, 2007, 2008 Free Software Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -40,7 +40,7 @@ if { $MU_ULONG_MAX > 0 } {
set limit [expr $MU_ULONG_MAX - 1]
verbose "LIMIT is $limit"
imap4d_test "FETCH 1:$limit FLAGS" \
"BAD FETCH Bogus number set"
"OK"
imap4d_test "UID FETCH 1:$limit FLAGS" \
"OK"
......
......@@ -166,7 +166,7 @@ imap4d_test "FETCH 1 BODY\[HEADER\]"\
# with a field-name that matches one of the names in the list;
imap4d_test "FETCH 1 BODY\[HEADER.FIELDS (FROM TO SUBJECT)\]"\
"1 FETCH (BODY\[HEADER.FIELDS (\"FROM\" \"TO\" \"SUBJECT\")\] {94}"\
"1 FETCH (BODY\[HEADER.FIELDS (FROM TO SUBJECT)\] {94}"\
-literal\
"FROM: Foo Bar <foobar@nonexistent.net>"\
"TO: Bar <bar@dontmailme.org>"\
......@@ -179,7 +179,7 @@ imap4d_test "FETCH 1 BODY\[HEADER.FIELDS (FROM TO SUBJECT)\]"\
# the header fields with a non-matching field-name.
imap4d_test "FETCH 1 BODY\[HEADER.FIELDS.NOT (FROM TO SUBJECT)\]"\
"1 FETCH (BODY\[HEADER.FIELDS.NOT (\"FROM\" \"TO\" \"SUBJECT\")\] {235}"\
"1 FETCH (BODY\[HEADER.FIELDS.NOT (FROM TO SUBJECT)\] {235}"\
-literal\
"Received: (from foobar@nonexistent.net) "\
" by nonexistent.net id fBSKI8N04906"\
......