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.
Showing
11 changed files
with
14 additions
and
14 deletions
... | @@ -116,7 +116,6 @@ int | ... | @@ -116,7 +116,6 @@ int |
116 | imap4d_select_status () | 116 | imap4d_select_status () |
117 | { | 117 | { |
118 | const char *mflags = "\\Answered \\Flagged \\Deleted \\Seen \\Draft"; | 118 | const char *mflags = "\\Answered \\Flagged \\Deleted \\Seen \\Draft"; |
119 | const char *pflags = "\\Answered \\Deleted \\Seen"; | ||
120 | unsigned long uidvalidity = 0; | 119 | unsigned long uidvalidity = 0; |
121 | size_t count = 0, recent = 0, unseen = 0, uidnext = 0; | 120 | size_t count = 0, recent = 0, unseen = 0, uidnext = 0; |
122 | int status = 0; | 121 | int status = 0; |
... | @@ -148,7 +147,7 @@ imap4d_select_status () | ... | @@ -148,7 +147,7 @@ imap4d_select_status () |
148 | io_untagged_response (RESP_OK, "[PERMANENTFLAGS ()] No Permanent flags"); | 147 | io_untagged_response (RESP_OK, "[PERMANENTFLAGS ()] No Permanent flags"); |
149 | else | 148 | else |
150 | io_untagged_response (RESP_OK, "[PERMANENTFLAGS (%s)] Permanent flags", | 149 | io_untagged_response (RESP_OK, "[PERMANENTFLAGS (%s)] Permanent flags", |
151 | pflags); | 150 | mflags); |
152 | 151 | ||
153 | return 0; | 152 | return 0; |
154 | } | 153 | } | ... | ... |
... | @@ -33,7 +33,7 @@ if { $MU_ULONG_MAX > 0 } { | ... | @@ -33,7 +33,7 @@ if { $MU_ULONG_MAX > 0 } { |
33 | "OK \[UIDNEXT 6\] Predicted next uid"\ | 33 | "OK \[UIDNEXT 6\] Predicted next uid"\ |
34 | "OK \[UNSEEN 1\] first unseen messsage"\ | 34 | "OK \[UNSEEN 1\] first unseen messsage"\ |
35 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 35 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
36 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \ | 36 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \ |
37 | "OK" | 37 | "OK" |
38 | 38 | ||
39 | set limit [expr $MU_ULONG_MAX - 1] | 39 | set limit [expr $MU_ULONG_MAX - 1] | ... | ... |
... | @@ -31,7 +31,7 @@ if { $MU_ULONG_MAX > 0 } { | ... | @@ -31,7 +31,7 @@ if { $MU_ULONG_MAX > 0 } { |
31 | "OK \[UIDNEXT 6\] Predicted next uid"\ | 31 | "OK \[UIDNEXT 6\] Predicted next uid"\ |
32 | "OK \[UNSEEN 1\] first unseen messsage"\ | 32 | "OK \[UNSEEN 1\] first unseen messsage"\ |
33 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 33 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
34 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \ | 34 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \ |
35 | "OK" | 35 | "OK" |
36 | 36 | ||
37 | set limit [expr $MU_ULONG_MAX - 1] | 37 | set limit [expr $MU_ULONG_MAX - 1] | ... | ... |
... | @@ -66,7 +66,7 @@ imap4d_test "SELECT mbox"\ | ... | @@ -66,7 +66,7 @@ imap4d_test "SELECT mbox"\ |
66 | "OK \[UIDNEXT 4\] Predicted next uid"\ | 66 | "OK \[UIDNEXT 4\] Predicted next uid"\ |
67 | "OK \[UNSEEN 1\] first unseen messsage"\ | 67 | "OK \[UNSEEN 1\] first unseen messsage"\ |
68 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 68 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
69 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\ | 69 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\ |
70 | "OK" | 70 | "OK" |
71 | 71 | ||
72 | imap4d_test "FETCH 2:3 BODY\[\]"\ | 72 | imap4d_test "FETCH 2:3 BODY\[\]"\ | ... | ... |
... | @@ -59,7 +59,7 @@ imap4d_test "SELECT en/to/tre"\ | ... | @@ -59,7 +59,7 @@ imap4d_test "SELECT en/to/tre"\ |
59 | "OK \[UIDNEXT 2\] Predicted next uid"\ | 59 | "OK \[UIDNEXT 2\] Predicted next uid"\ |
60 | "OK \[UNSEEN 1\] first unseen messsage"\ | 60 | "OK \[UNSEEN 1\] first unseen messsage"\ |
61 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 61 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
62 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\ | 62 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\ |
63 | "OK \[READ-WRITE\] SELECT Completed" | 63 | "OK \[READ-WRITE\] SELECT Completed" |
64 | 64 | ||
65 | imap4d_test "FETCH 1 ALL"\ | 65 | imap4d_test "FETCH 1 ALL"\ | ... | ... |
... | @@ -35,7 +35,7 @@ imap4d_test "SELECT INBOX"\ | ... | @@ -35,7 +35,7 @@ imap4d_test "SELECT INBOX"\ |
35 | "OK \[UIDNEXT 96\] Predicted next uid"\ | 35 | "OK \[UIDNEXT 96\] Predicted next uid"\ |
36 | "OK \[UNSEEN 1\] first unseen messsage "\ | 36 | "OK \[UNSEEN 1\] first unseen messsage "\ |
37 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 37 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
38 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\ | 38 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\ |
39 | "OK \[READ-WRITE\] SELECT Completed" | 39 | "OK \[READ-WRITE\] SELECT Completed" |
40 | 40 | ||
41 | imap4d_test "STATUS INBOX (MESSAGES RECENT UNSEEN UIDVALIDITY UIDNEXT)" \ | 41 | imap4d_test "STATUS INBOX (MESSAGES RECENT UNSEEN UIDVALIDITY UIDNEXT)" \ | ... | ... |
... | @@ -38,7 +38,7 @@ imap4d_test "SELECT mbox1" \ | ... | @@ -38,7 +38,7 @@ imap4d_test "SELECT mbox1" \ |
38 | "OK \[UIDNEXT 6\] Predicted next uid"\ | 38 | "OK \[UIDNEXT 6\] Predicted next uid"\ |
39 | "OK \[UNSEEN 1\] first unseen messsage"\ | 39 | "OK \[UNSEEN 1\] first unseen messsage"\ |
40 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 40 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
41 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \ | 41 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \ |
42 | "OK" | 42 | "OK" |
43 | 43 | ||
44 | imap4d_test "STORE 2:* +FLAGS (\\Deleted)"\ | 44 | imap4d_test "STORE 2:* +FLAGS (\\Deleted)"\ |
... | @@ -66,7 +66,7 @@ imap4d_test "SELECT mbox1" \ | ... | @@ -66,7 +66,7 @@ imap4d_test "SELECT mbox1" \ |
66 | "OK \[UIDNEXT 6\] Predicted next uid"\ | 66 | "OK \[UIDNEXT 6\] Predicted next uid"\ |
67 | "OK \[UNSEEN 1\] first unseen messsage"\ | 67 | "OK \[UNSEEN 1\] first unseen messsage"\ |
68 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 68 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
69 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \ | 69 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \ |
70 | "OK" | 70 | "OK" |
71 | 71 | ||
72 | imap4d_stop | 72 | imap4d_stop | ... | ... |
... | @@ -37,7 +37,7 @@ imap4d_test "SELECT mbox1" \ | ... | @@ -37,7 +37,7 @@ imap4d_test "SELECT mbox1" \ |
37 | "OK \[UIDNEXT 6\] Predicted next uid"\ | 37 | "OK \[UIDNEXT 6\] Predicted next uid"\ |
38 | "OK \[UNSEEN 1\] first unseen messsage"\ | 38 | "OK \[UNSEEN 1\] first unseen messsage"\ |
39 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 39 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
40 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags" \ | 40 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags" \ |
41 | "OK" | 41 | "OK" |
42 | 42 | ||
43 | # FLAGS The flags that are set for this message. | 43 | # FLAGS The flags that are set for this message. | ... | ... |
... | @@ -40,7 +40,7 @@ imap4d_test "SELECT INBOX"\ | ... | @@ -40,7 +40,7 @@ imap4d_test "SELECT INBOX"\ |
40 | "OK \[UIDNEXT 9\] Predicted next uid"\ | 40 | "OK \[UIDNEXT 9\] Predicted next uid"\ |
41 | "OK \[UNSEEN 4\] first unseen messsage "\ | 41 | "OK \[UNSEEN 4\] first unseen messsage "\ |
42 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ | 42 | "FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)"\ |
43 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\ | 43 | "OK \[PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\] Permanent flags"\ |
44 | "OK \[READ-WRITE\] SELECT Completed" | 44 | "OK \[READ-WRITE\] SELECT Completed" |
45 | 45 | ||
46 | # <message set> Messages with message sequence numbers | 46 | # <message set> Messages with message sequence numbers | ... | ... |
... | @@ -97,7 +97,7 @@ extern int mu_attribute_is_equal (mu_attribute_t, mu_attribute_t att2); | ... | @@ -97,7 +97,7 @@ extern int mu_attribute_is_equal (mu_attribute_t, mu_attribute_t att2); |
97 | extern int mu_attribute_copy (mu_attribute_t, mu_attribute_t); | 97 | extern int mu_attribute_copy (mu_attribute_t, mu_attribute_t); |
98 | 98 | ||
99 | /* Maximum size of buffer for mu_attribute_to_string call, including nul */ | 99 | /* Maximum size of buffer for mu_attribute_to_string call, including nul */ |
100 | #define MU_STATUS_BUF_SIZE sizeof("OAFRd") | 100 | #define MU_STATUS_BUF_SIZE sizeof("AFDdOR") |
101 | 101 | ||
102 | extern int mu_attribute_to_string (mu_attribute_t, char *, size_t, size_t *); | 102 | extern int mu_attribute_to_string (mu_attribute_t, char *, size_t, size_t *); |
103 | extern int mu_string_to_flags (const char *, int *); | 103 | extern int mu_string_to_flags (const char *, int *); | ... | ... |
... | @@ -396,11 +396,12 @@ struct flagtrans | ... | @@ -396,11 +396,12 @@ struct flagtrans |
396 | #define mu_verify(R) extern int (* verify_function__ (void)) [mu_verify_true (R)] | 396 | #define mu_verify(R) extern int (* verify_function__ (void)) [mu_verify_true (R)] |
397 | 397 | ||
398 | static struct flagtrans flagtrans[] = { | 398 | static struct flagtrans flagtrans[] = { |
399 | { MU_ATTRIBUTE_SEEN, 'O' }, | ||
400 | { MU_ATTRIBUTE_ANSWERED, 'A' }, | 399 | { MU_ATTRIBUTE_ANSWERED, 'A' }, |
401 | { MU_ATTRIBUTE_FLAGGED, 'F' }, | 400 | { MU_ATTRIBUTE_FLAGGED, 'F' }, |
401 | { MU_ATTRIBUTE_DELETED, 'D' }, | ||
402 | { MU_ATTRIBUTE_DRAFT, 'd' }, | ||
403 | { MU_ATTRIBUTE_SEEN, 'O' }, | ||
402 | { MU_ATTRIBUTE_READ, 'R' }, | 404 | { MU_ATTRIBUTE_READ, 'R' }, |
403 | { MU_ATTRIBUTE_DELETED, 'd' }, | ||
404 | { 0 } | 405 | { 0 } |
405 | }; | 406 | }; |
406 | 407 | ... | ... |
-
Please register or sign in to post a comment