Commit 2f34f8ae 2f34f8ae2c0f9207d94629d94f664f728094e990 by Sergey Poznyakoff

Make all status flags permanent.

* include/mailutils/attribute.h (MU_STATUS_BUF_SIZE): Add more status letters.
* libmailutils/mailbox/attribute.c (flagtrans): Keep the same ordering as
in attribute.h.  Add missing attributes.

* imap4d/select.c (imap4d_select_status): All flags are now permanent.
* imap4d/testsuite/imap4d/IDEF0955.exp: Reflect changes in PERMANENTFLAGS.
* imap4d/testsuite/imap4d/IDEF0956.exp: Likewise.
* imap4d/testsuite/imap4d/append.exp: Likewise.
* imap4d/testsuite/imap4d/create.exp: Likewise.
* imap4d/testsuite/imap4d/examine.exp: Likewise.
* imap4d/testsuite/imap4d/expunge.exp: Likewise.
* imap4d/testsuite/imap4d/fetch.exp: Likewise.
* imap4d/testsuite/imap4d/search.exp: Likewise.
1 parent accf1d99
......@@ -116,7 +116,6 @@ int
imap4d_select_status ()
{
const char *mflags = "\\Answered \\Flagged \\Deleted \\Seen \\Draft";
const char *pflags = "\\Answered \\Deleted \\Seen";
unsigned long uidvalidity = 0;
size_t count = 0, recent = 0, unseen = 0, uidnext = 0;
int status = 0;
......@@ -148,7 +147,7 @@ imap4d_select_status ()
io_untagged_response (RESP_OK, "[PERMANENTFLAGS ()] No Permanent flags");
else
io_untagged_response (RESP_OK, "[PERMANENTFLAGS (%s)] Permanent flags",
pflags);
mflags);
return 0;
}
......
......@@ -33,7 +33,7 @@ if { $MU_ULONG_MAX > 0 } {
"OK \[UIDNEXT 6\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \
"OK"
set limit [expr $MU_ULONG_MAX - 1]
......
......@@ -31,7 +31,7 @@ if { $MU_ULONG_MAX > 0 } {
"OK \[UIDNEXT 6\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \
"OK"
set limit [expr $MU_ULONG_MAX - 1]
......
......@@ -66,7 +66,7 @@ imap4d_test "SELECT mbox"\
"OK \[UIDNEXT 4\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\
"OK"
imap4d_test "FETCH 2:3 BODY\[\]"\
......
......@@ -59,7 +59,7 @@ imap4d_test "SELECT en/to/tre"\
"OK \[UIDNEXT 2\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\
"OK \[READ-WRITE\] SELECT Completed"
imap4d_test "FETCH 1 ALL"\
......
......@@ -35,7 +35,7 @@ imap4d_test "SELECT INBOX"\
"OK \[UIDNEXT 96\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage "\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\
"OK \[READ-WRITE\] SELECT Completed"
imap4d_test "STATUS INBOX (MESSAGES RECENT UNSEEN UIDVALIDITY UIDNEXT)" \
......
......@@ -38,7 +38,7 @@ imap4d_test "SELECT mbox1" \
"OK \[UIDNEXT 6\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \
"OK"
imap4d_test "STORE 2:* +FLAGS (\\Deleted)"\
......@@ -66,7 +66,7 @@ imap4d_test "SELECT mbox1" \
"OK \[UIDNEXT 6\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \
"OK"
imap4d_stop
......
......@@ -37,7 +37,7 @@ imap4d_test "SELECT mbox1" \
"OK \[UIDNEXT 6\] Predicted next uid"\
"OK \[UNSEEN 1\] first unseen messsage"\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \
"OK"
# FLAGS The flags that are set for this message.
......
......@@ -40,7 +40,7 @@ imap4d_test "SELECT INBOX"\
"OK \[UIDNEXT 9\] Predicted next uid"\
"OK \[UNSEEN 4\] first unseen messsage "\
"FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\
"OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\
"OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\
"OK \[READ-WRITE\] SELECT Completed"
# <message set> Messages with message sequence numbers
......
......@@ -97,7 +97,7 @@ extern int mu_attribute_is_equal (mu_attribute_t, mu_attribute_t att2);
extern int mu_attribute_copy (mu_attribute_t, mu_attribute_t);
/* Maximum size of buffer for mu_attribute_to_string call, including nul */
#define MU_STATUS_BUF_SIZE sizeof("OAFRd")
#define MU_STATUS_BUF_SIZE sizeof("AFDdOR")
extern int mu_attribute_to_string (mu_attribute_t, char *, size_t, size_t *);
extern int mu_string_to_flags (const char *, int *);
......
......@@ -396,11 +396,12 @@ struct flagtrans
#define mu_verify(R) extern int (* verify_function__ (void)) [mu_verify_true (R)]
static struct flagtrans flagtrans[] = {
{ MU_ATTRIBUTE_SEEN, 'O' },
{ MU_ATTRIBUTE_ANSWERED, 'A' },
{ MU_ATTRIBUTE_FLAGGED, 'F' },
{ MU_ATTRIBUTE_DELETED, 'D' },
{ MU_ATTRIBUTE_DRAFT, 'd' },
{ MU_ATTRIBUTE_SEEN, 'O' },
{ MU_ATTRIBUTE_READ, 'R' },
{ MU_ATTRIBUTE_DELETED, 'd' },
{ 0 }
};
......