Updated
Showing
2 changed files
with
117 additions
and
0 deletions
1 | 2002-08-23 Sergey Poznyakoff | ||
2 | |||
3 | * configure.ac: Added check for socklen_t. | ||
4 | |||
5 | * imap4d/commands.c: Fixed allowed states for X-VERSION command. | ||
6 | * imap4d/fetch.c (fetch_operation) Fix section specification | ||
7 | output. | ||
8 | * mail/testsuite/mail/folder.exp: Enabled "folders" test. | ||
9 | * imap4d/testsuite/imap4d/examine.exp: Moved get_uidvalidity | ||
10 | to imap4d.exp and renamed it to imap4d_uidvalidity. | ||
11 | * imap4d/testsuite/lib/imap4d.exp: Likewise | ||
12 | (imap4d_test): Added new switches: -literal and -noliteral | ||
13 | |||
14 | * imap4d/testsuite/imap4d/fetch.exp: New file | ||
15 | * imap4d/testsuite/imap4d/x.exp: New file | ||
16 | * imap4d/testsuite/imap4d/DISTFILES: Added fetch.exp, x.exp | ||
17 | * imap4d/testsuite/imap4d/search.exp: Added comments | ||
18 | |||
19 | * testsuite/spool/mbox: Changed `organisation' header | ||
20 | * testsuite/spool/mbox1: Likewise. | ||
21 | * mail/testsuite/mail/write.exp: Adjusted tests to the changes in | ||
22 | mbox and mbox1. | ||
23 | |||
24 | * libmu_scm/mu_address.c (mu_address_get_count): Fixed | ||
25 | type of `count' variable | ||
26 | * mailbox/list.c (list_remove): Removed cast from void* to int, | ||
27 | it does not work on 64-bit machines. Besides, pointer comparison | ||
28 | is strictly defined by C. | ||
29 | * mailbox/observer.c (observable_detach): Likewise. | ||
30 | * mailbox/tcp.c (_tcp_open): Changed type of `namelen' to | ||
31 | socklen_t. | ||
32 | * mh/mh_format.c: Changed type of `len' to size_t. | ||
33 | |||
34 | * mail/folders.c (mail_folders): Protect directory name with | ||
35 | quotes. | ||
36 | |||
1 | 2002-08-23 Sergey Poznyakoff | 37 | 2002-08-23 Sergey Poznyakoff |
2 | 38 | ||
3 | * testsuite/lib/mailutils.exp: Introduced -re flag | 39 | * testsuite/lib/mailutils.exp: Introduced -re flag | ... | ... |
... | @@ -16,6 +16,21 @@ | ... | @@ -16,6 +16,21 @@ |
16 | # along with this program; if not, write to the Free Software Foundation, | 16 | # along with this program; if not, write to the Free Software Foundation, |
17 | # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | # 6.4.4. SEARCH Command | ||
20 | # Arguments: OPTIONAL [CHARSET] specification | ||
21 | # searching criteria (one or more) | ||
22 | # Responses: REQUIRED untagged response: SEARCH | ||
23 | # Result: OK - search completed | ||
24 | # NO - search error: can't search that [CHARSET] or | ||
25 | # criteria | ||
26 | # BAD - command unknown or arguments invalid | ||
27 | # | ||
28 | # The SEARCH command searches the mailbox for messages that match | ||
29 | # the given searching criteria. Searching criteria consist of one | ||
30 | # or more search keys. The untagged SEARCH response from the server | ||
31 | # contains a listing of message sequence numbers corresponding to | ||
32 | # those messages that match the searching criteria. | ||
33 | |||
19 | imap4d_start | 34 | imap4d_start |
20 | imap4d_auth "user!passwd" "guessme" | 35 | imap4d_auth "user!passwd" "guessme" |
21 | 36 | ||
... | @@ -31,19 +46,33 @@ imap4d_test "SELECT INBOX"\ | ... | @@ -31,19 +46,33 @@ imap4d_test "SELECT INBOX"\ |
31 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\ | 46 | "OK \[PERMANENTFLAGS (\\Answered \\Deleted \\Seen)\] Permanent flags"\ |
32 | "OK \[READ-WRITE\] SELECT Completed" | 47 | "OK \[READ-WRITE\] SELECT Completed" |
33 | 48 | ||
49 | # <message set> Messages with message sequence numbers | ||
50 | # corresponding to the specified message sequence | ||
51 | # number set | ||
52 | |||
34 | imap4d_test "SEARCH 1:*" \ | 53 | imap4d_test "SEARCH 1:*" \ |
35 | "SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95" \ | 54 | "SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95" \ |
36 | "OK" | 55 | "OK" |
37 | 56 | ||
57 | # ALL All messages in the mailbox; the default initial | ||
58 | # key for ANDing. | ||
59 | |||
38 | imap4d_test "SEARCH ALL" \ | 60 | imap4d_test "SEARCH ALL" \ |
39 | "SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95" \ | 61 | "SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95" \ |
40 | "OK" | 62 | "OK" |
41 | 63 | ||
64 | # NEW Messages that have the \Recent flag set but not the | ||
65 | # \Seen flag. This is functionally equivalent to | ||
66 | # "(RECENT UNSEEN)". | ||
67 | |||
42 | # All messages are still new | 68 | # All messages are still new |
43 | imap4d_test "SEARCH NEW" \ | 69 | imap4d_test "SEARCH NEW" \ |
44 | "SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95" \ | 70 | "SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95" \ |
45 | "OK" | 71 | "OK" |
46 | 72 | ||
73 | # FROM <string> Messages that contain the specified string in the | ||
74 | # envelope structure's FROM field. | ||
75 | |||
47 | imap4d_test "SEARCH FROM alice" \ | 76 | imap4d_test "SEARCH FROM alice" \ |
48 | "SEARCH 2 4 6 8 10 12 14 20 25 27 29 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 90 93 95" \ | 77 | "SEARCH 2 4 6 8 10 12 14 20 25 27 29 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 90 93 95" \ |
49 | "OK" | 78 | "OK" |
... | @@ -52,34 +81,63 @@ imap4d_test "SEARCH FROM hare" \ | ... | @@ -52,34 +81,63 @@ imap4d_test "SEARCH FROM hare" \ |
52 | "SEARCH 1 3 5 7 9 11 13 16 22 24 35 42 58 62 71" \ | 81 | "SEARCH 1 3 5 7 9 11 13 16 22 24 35 42 58 62 71" \ |
53 | "OK" | 82 | "OK" |
54 | 83 | ||
84 | # LARGER <n> Messages with an [RFC-822] size larger than the | ||
85 | # specified number of octets. | ||
86 | |||
55 | imap4d_test "SEARCH LARGER 512" \ | 87 | imap4d_test "SEARCH LARGER 512" \ |
56 | "SEARCH 41 46" \ | 88 | "SEARCH 41 46" \ |
57 | "OK" | 89 | "OK" |
58 | 90 | ||
91 | # SMALLER <n> Messages with an [RFC-822] size smaller than the | ||
92 | # specified number of octets. | ||
93 | |||
59 | imap4d_test "SEARCH SMALLER 300" \ | 94 | imap4d_test "SEARCH SMALLER 300" \ |
60 | "SEARCH 12 20 35" \ | 95 | "SEARCH 12 20 35" \ |
61 | "OK" | 96 | "OK" |
62 | 97 | ||
98 | # SUBJECT <string> Messages that contain the specified string in the | ||
99 | # envelope structure's SUBJECT field. | ||
100 | |||
63 | imap4d_test "SEARCH SUBJECT \"watch\"" \ | 101 | imap4d_test "SEARCH SUBJECT \"watch\"" \ |
64 | "SEARCH 19 20 21 22 23 24 25 26 27 28 29"\ | 102 | "SEARCH 19 20 21 22 23 24 25 26 27 28 29"\ |
65 | "OK" | 103 | "OK" |
66 | 104 | ||
105 | # HEADER <field-name> <string> | ||
106 | # Messages that have a header with the specified | ||
107 | # field-name (as defined in [RFC-822]) and that | ||
108 | # contains the specified string in the [RFC-822] | ||
109 | # field-body. | ||
110 | |||
67 | imap4d_test "SEARCH HEADER Message-Id \"<200207292200.3303@wonder.land>\"" \ | 111 | imap4d_test "SEARCH HEADER Message-Id \"<200207292200.3303@wonder.land>\"" \ |
68 | "SEARCH 3" \ | 112 | "SEARCH 3" \ |
69 | "OK" | 113 | "OK" |
70 | 114 | ||
115 | # CC <string> Messages that contain the specified string in the | ||
116 | # envelope structure's CC field. | ||
117 | |||
71 | imap4d_test "SEARCH CC dormouse" \ | 118 | imap4d_test "SEARCH CC dormouse" \ |
72 | "SEARCH 60" \ | 119 | "SEARCH 60" \ |
73 | "OK" | 120 | "OK" |
74 | 121 | ||
122 | # TO <string> Messages that contain the specified string in the | ||
123 | # envelope structure's TO field. | ||
124 | |||
75 | imap4d_test "SEARCH TO hare"\ | 125 | imap4d_test "SEARCH TO hare"\ |
76 | "SEARCH 2 4 6 8 10 12 14 21 23 42 59 72" \ | 126 | "SEARCH 2 4 6 8 10 12 14 21 23 42 59 72" \ |
77 | "OK" | 127 | "OK" |
78 | 128 | ||
129 | # SENTBEFORE <date> | ||
130 | # Messages whose [RFC-822] Date: header is earlier | ||
131 | # than the specified date. | ||
132 | |||
79 | imap4d_test "SEARCH SENTBEFORE \"29-Jul-2002 22:00:02 +0100\"" \ | 133 | imap4d_test "SEARCH SENTBEFORE \"29-Jul-2002 22:00:02 +0100\"" \ |
80 | "SEARCH 1"\ | 134 | "SEARCH 1"\ |
81 | "OK" | 135 | "OK" |
82 | 136 | ||
137 | # SENTSINCE <date> | ||
138 | # Messages whose [RFC-822] Date: header is within or | ||
139 | # later than the specified date. | ||
140 | |||
83 | imap4d_test "SEARCH SENTSINCE \"29-Jul-2002 22:01:32 +0100\""\ | 141 | imap4d_test "SEARCH SENTSINCE \"29-Jul-2002 22:01:32 +0100\""\ |
84 | "SEARCH 92 93 94 95"\ | 142 | "SEARCH 92 93 94 95"\ |
85 | "OK" | 143 | "OK" |
... | @@ -88,10 +146,16 @@ imap4d_test "SEARCH SENTSINCE \"29-Jul-2002 23:01:32 +0200\""\ | ... | @@ -88,10 +146,16 @@ imap4d_test "SEARCH SENTSINCE \"29-Jul-2002 23:01:32 +0200\""\ |
88 | "SEARCH 92 93 94 95"\ | 146 | "SEARCH 92 93 94 95"\ |
89 | "OK" | 147 | "OK" |
90 | 148 | ||
149 | # BEFORE <date> Messages whose internal date is earlier than the | ||
150 | # specified date. | ||
151 | |||
91 | imap4d_test "SEARCH BEFORE \"29-Jul-2002 22:00:09 +0000\""\ | 152 | imap4d_test "SEARCH BEFORE \"29-Jul-2002 22:00:09 +0000\""\ |
92 | "SEARCH 1"\ | 153 | "SEARCH 1"\ |
93 | "OK" | 154 | "OK" |
94 | 155 | ||
156 | # SINCE <date> Messages whose internal date is within or later | ||
157 | # than the specified date. | ||
158 | |||
95 | imap4d_test "SEARCH SINCE \"29-Jul-2002 22:01:36 +0000\""\ | 159 | imap4d_test "SEARCH SINCE \"29-Jul-2002 22:01:36 +0000\""\ |
96 | "SEARCH 89 90 91 92 93 94 95"\ | 160 | "SEARCH 89 90 91 92 93 94 95"\ |
97 | "OK" | 161 | "OK" |
... | @@ -102,22 +166,37 @@ imap4d_test "STORE 3,5,89 +FLAGS (\\Answered)"\ | ... | @@ -102,22 +166,37 @@ imap4d_test "STORE 3,5,89 +FLAGS (\\Answered)"\ |
102 | "89 FETCH FLAGS (\\Answered \\Recent)"\ | 166 | "89 FETCH FLAGS (\\Answered \\Recent)"\ |
103 | "OK" | 167 | "OK" |
104 | 168 | ||
169 | # ANSWERED Messages with the \Answered flag set. | ||
170 | |||
105 | imap4d_test "SEARCH ANSWERED"\ | 171 | imap4d_test "SEARCH ANSWERED"\ |
106 | "SEARCH 3 5 89"\ | 172 | "SEARCH 3 5 89"\ |
107 | "OK" | 173 | "OK" |
108 | 174 | ||
175 | # TEXT <string> Messages that contain the specified string in the | ||
176 | # header or body of the message. | ||
177 | |||
109 | imap4d_test "SEARCH TEXT wine"\ | 178 | imap4d_test "SEARCH TEXT wine"\ |
110 | "SEARCH 1 2 3"\ | 179 | "SEARCH 1 2 3"\ |
111 | "OK" | 180 | "OK" |
112 | 181 | ||
182 | ## Boolean operations | ||
183 | |||
184 | # When multiple keys are specified, the result is the intersection | ||
185 | # (AND function) of all the messages that match those keys. | ||
186 | |||
113 | imap4d_test "SEARCH TEXT wine FROM alice"\ | 187 | imap4d_test "SEARCH TEXT wine FROM alice"\ |
114 | "SEARCH 2"\ | 188 | "SEARCH 2"\ |
115 | "OK" | 189 | "OK" |
116 | 190 | ||
191 | # OR <search-key1> <search-key2> | ||
192 | # Messages that match either search key. | ||
193 | |||
117 | imap4d_test "SEARCH OR FROM alice ANSWERED"\ | 194 | imap4d_test "SEARCH OR FROM alice ANSWERED"\ |
118 | "SEARCH 2 3 4 5 6 8 10 12 14 20 25 27 29 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 89 90 93 95"\ | 195 | "SEARCH 2 3 4 5 6 8 10 12 14 20 25 27 29 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 89 90 93 95"\ |
119 | "OK" | 196 | "OK" |
120 | 197 | ||
198 | ## Check precedence | ||
199 | |||
121 | imap4d_test "SEARCH (OR FROM alice ANSWERED) SENTSINCE \"29-Jul-2002 22:00:33 +0100\""\ | 200 | imap4d_test "SEARCH (OR FROM alice ANSWERED) SENTSINCE \"29-Jul-2002 22:00:33 +0100\""\ |
122 | "SEARCH 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 89 90 93 95" \ | 201 | "SEARCH 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 89 90 93 95" \ |
123 | "OK" | 202 | "OK" |
... | @@ -133,3 +212,5 @@ imap4d_test "SEARCH OR FROM alice ANSWERED SENTSINCE \"29-Jul-2002 22:00:33 +010 | ... | @@ -133,3 +212,5 @@ imap4d_test "SEARCH OR FROM alice ANSWERED SENTSINCE \"29-Jul-2002 22:00:33 +010 |
133 | imap4d_test "SEARCH OR FROM alice (ANSWERED SENTSINCE \"29-Jul-2002 22:00:33 +0100\" SENTBEFORE \"29-Jul-2002 22:00:56 +0100\")"\ | 212 | imap4d_test "SEARCH OR FROM alice (ANSWERED SENTSINCE \"29-Jul-2002 22:00:33 +0100\" SENTBEFORE \"29-Jul-2002 22:00:56 +0100\")"\ |
134 | "SEARCH 2 4 6 8 10 12 14 20 25 27 29 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 90 93 95"\ | 213 | "SEARCH 2 4 6 8 10 12 14 20 25 27 29 33 36 38 40 43 45 47 51 53 55 57 59 63 66 68 70 72 74 76 78 80 82 85 87 90 93 95"\ |
135 | "OK" | 214 | "OK" |
215 | |||
216 | #end of search.exp | ... | ... |
-
Please register or sign in to post a comment