Commit 2a5ee8e5 2a5ee8e518780c2f1c13e52e16845f4da7160e40 by Sergey Poznyakoff

Added to the repository

1 parent 4c9f40d5
1 AUTOMAKE_OPTIONS = ../lib/ansi2knr
2 noinst_PROGRAMS = addr url-parse sfrom mimetest muemail msg-send
3
4 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib
5 AM_LDFLAGS = ../mailbox/libmailbox.la ../lib/libmailutils.la
6
7 EXTRA_DIST = comsat.conf dot.biffrc gnu-imap4d.pam gnu-pop3d.pam\
8 mailutils.rc reply.scm
...\ No newline at end of file ...\ No newline at end of file
1 /* GNU mailutils - a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
17
18 /* sfrom, Simple From */
19 #include <stdio.h>
20 #include <unistd.h>
21 #include <stdlib.h>
22 #include <string.h>
23
24 #include <mailutils/mailutils.h>
25
26 int
27 main (int argc, const char **argv)
28 {
29 char *from;
30 char *subject;
31 mailbox_t mbox;
32 int status;
33 size_t msgno, total = 0;
34
35 /* Register the type of mailbox. IMAP4, POP3 and local format */
36 {
37 list_t registrar;
38 registrar_get_list (&registrar);
39 list_append (registrar, imap_record);
40 list_append (registrar, path_record);
41 list_append (registrar, pop_record);
42 }
43
44 status = mailbox_create_default (&mbox, argv[1]);
45
46 if (status != 0)
47 {
48 fprintf (stderr, "mailbox_create: %s\n", mu_errstring (status));
49 exit (EXIT_FAILURE);
50 }
51
52 status = mailbox_open (mbox, MU_STREAM_READ);
53 if (status != 0)
54 {
55 fprintf (stderr, "mailbox_open: %s\n", mu_errstring (status));
56 exit (EXIT_FAILURE);
57 }
58
59 mailbox_messages_count (mbox, &total);
60
61 for (msgno = 1; msgno <= total; msgno++)
62 {
63 message_t msg;
64 header_t hdr;
65
66 if ((status = mailbox_get_message (mbox, msgno, &msg)) != 0
67 || (status = message_get_header (msg, &hdr)) != 0)
68 {
69 fprintf (stderr, "Error message: %s\n",
70 mu_errstring (status));
71 exit (EXIT_FAILURE);
72 }
73
74 if (header_aget_value (hdr, MU_HEADER_FROM, &from))
75 from = strdup ("(NO FROM)");
76
77 if (header_aget_value (hdr, MU_HEADER_SUBJECT, &subject))
78 subject = strdup("(NO SUBJECT)");
79
80 printf ("%s\t%s\n", from, subject);
81 free (from);
82 free (subject);
83 }
84
85 mailbox_close (mbox);
86 mailbox_destroy (&mbox);
87 return 0;
88 }
1 Makefile
2 Makefile.in
3 *.log
4 *.sum
5 site.exp
6 remote.exp
7 data
1 AUTOMAKE_OPTIONS = dejagnu
2 DEJATOOL = mailbox
3 RUNTESTFLAGS =
4 CLEANFILES = *.log
5 test_dirs = lib mailbox
6 EXTRA_DIST = Addrs Urls
7
8 dist-hook:
9 here=`cd $(top_builddir)/$(subdir) && pwd`; \
10 srcdir=`cd $(srcdir) && pwd`; \
11 distdir=`cd $(distdir) && pwd`; \
12 for dir in $(test_dirs); \
13 do \
14 cd $$srcdir;\
15 mkdir $$distdir/$$dir;\
16 cd $$dir;\
17 for file in DISTFILES `cat DISTFILES`; do \
18 d=$$srcdir/$$dir; \
19 if test -d $$d/$$file; then \
20 cp -pr $$d/$$file $$distdir/$$dir/$$file; \
21 else \
22 test -f $$distdir/$$dir/$$file \
23 || cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \
24 fi; \
25 done;\
26 done;\
27 cd $$here
28
29 site.exp: Makefile remote.exp
30 @echo 'Making a new site.exp file...'
31 @test ! -f site.bak || rm -f site.bak
32 @echo '## these variables are automatically generated by make ##' > $@-t
33 @echo '# Do not edit here. If you wish to override these values' >> $@-t
34 @echo '# edit the last section' >> $@-t
35 @echo 'set tool $(DEJATOOL)' >> $@-t
36 @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t
37 @echo "set top_builddir `cd $(top_builddir); pwd`" >> $@-t
38 @echo "set srcdir `cd $(srcdir); pwd`" >> $@-t
39 @echo 'set objdir' `pwd` >> $@-t
40 @echo 'set host_alias "$(host_alias)"' >> $@-t
41 @echo 'set host_triplet $(host_triplet)' >> $@-t
42 @echo 'set target_alias "$(target_alias)"' >> $@-t
43 @echo 'set target_triplet $(target_triplet)' >> $@-t
44 @echo 'set build_alias "$(build_alias)"' >> $@-t
45 @echo 'set build_triplet $(build_triplet)' >> $@-t
46 @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
47 @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
48 @test ! -f site.exp || mv site.exp site.bak
49 @mv $@-t site.exp
50
51 remote.exp:;
52 @echo 'Making a new remote.exp file...'
53 @test ! -f remote.bak || rm -f remote.bak
54 @echo '## These variables are used to set up for the remote testing.' >> $@-t
55 @echo '## Please, read file README in this directory for instructions' >> $@-t
56 @echo '## on how to use this file' >> $@-t
57 @echo "set host_board `hostname`" >> $@-t
58 @echo 'set board_info($$host_board,connect) rlogin' >> $@-t
59 @echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> $@-t
60 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
61 @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
62 @echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> $@-t
63 @echo "set board_info(\$$host_board,objdir) `pwd`" >> $@-t
64 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
65 @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
66 @test ! -f remote.exp || mv remote.exp remote.bak
67 @mv $@-t remote.exp
68
69
70 DISTCLEANFILES=*.exp *.log *.sum
71
72 distclean-local:
73 -rm -rf data
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2002, Free Software Foundation
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #
18 # NOTE: Apart from this comment, the contents of this file is taken verbatim.
19 # Please be sure you don't add any extra newlines.
20 Message: 1
21 From: Foo Bar <foobar@nonexistent.net>
22 Subject: Jabberwocky
23 Number of parts in message - 1
24 Total message size - 1255
25 Type of part 1 =
26 Message part size - 1255
27 Text Message
28 Begin
29 `Twas brillig, and the slithy toves
30 Did gyre and gimble in the wabe;
31 All mimsy were the borogoves,
32 And the mome raths outgrabe.
33
34 `Beware the Jabberwock, my son!
35 The jaws that bite, the claws that catch!
36 Beware the Jujub bird, and shun
37 The frumious Bandersnatch!'
38
39 He took his vorpal sword in hand:
40 Long time the manxome foe he sought --
41 So rested he by the Tumtum gree,
42 And stood awhile in thought.
43
44 And as in uffish thought he stood,
45 The Jabberwock, with eyes of flame,
46 Came whiffling through the tulgey wook,
47 And burbled as it came!
48
49 One, two! One, two! And through and through
50 The vorpal blade went snicker-snack!
51 He left it dead, and with its head
52 He went galumphing back.
53
54 `And has thou slain the Jabberwock?
55 Come to my arms, my beamish boy!
56 O frabjous day! Calloh! Callay!
57 He chortled in his joy.
58
59 `Twas brillig, and the slithy toves
60 Did gyre and gimble in the wabe;
61 All mimsy were the borogoves,
62 And the mome raths outgrabe.
63
64
65 End
66 Message: 2
67 From: Bar <bar@dontmailme.org>
68 Subject: Re: Jabberwocky
69 Number of parts in message - 1
70 Total message size - 535
71 Type of part 1 =
72 Message part size - 535
73 Text Message
74 Begin
75 It seems very pretty, but it's *rather* hard to understand!'
76 Somehow it seems to fill my head with ideas -- only I don't
77 exactly know what they are! However, SOMEBODY killed SOMETHING:
78 that's clear, at any rate...
79
80 End
81 Message: 3
82 From: Sergey Poznyakoff <gray@Mirddin.farlep.net>
83 Subject: Simple MIME
84 Number of parts in message - 2
85 Total message size - 1626
86 Type of part 1 = text/plain; name="msg.1"; charset="us-ascii"
87 Message part size - 372
88 Text Message
89 Begin
90 How doth the little crocodile
91 Improve his shining tail,
92 And pour the waters of the Nile
93 On every golden scale!
94
95 `How cheerfully he seems to grin,
96 How neatly spread his claws,
97 And welcome little fishes in
98 With gently smiling jaws!
99
100
101 End
102 Type of part 2 = application/octet-stream; name="msg.21"
103 Message part size - 646
104 Attachment - saving [msg.21]
105 Begin
106 `You are old, Father William,' the young man said,
107 `And your hair has become very white;
108 And yet you incessantly stand on your head--
109 Do you think, at your age, it is right?'
110
111 `In my youth,' Father William replied to his son,
112 `I feared it might injure the brain;
113 But, now that I'm perfectly sure I have none,
114 Why, I do it again and again.'
115
116
117 End
118 Message: 4
119 From: Sergey Poznyakoff <gray@Mirddin.farlep.net>
120 Subject: Nested MIME
121 Number of parts in message - 2
122 Total message size - 3484
123 Type of part 1 = text/plain; name="msg.21"; charset="us-ascii"
124 Message part size - 497
125 Text Message
126 Begin
127 `You are old, Father William,' the young man said,
128 `And your hair has become very white;
129 And yet you incessantly stand on your head--
130 Do you think, at your age, it is right?'
131
132 `In my youth,' Father William replied to his son,
133 `I feared it might injure the brain;
134 But, now that I'm perfectly sure I have none,
135 Why, I do it again and again.'
136
137
138
139 End
140 Type of part 2 = multipart/mixed; boundary="----- =_aaaaaaaaaa1"
141 Message part size - 2379
142 Encapsulated message :
143 Begin
144 Type of part 1 = application/octet-stream; name="msg.22"
145 Message part size - 664
146 Attachment - saving [msg.22]
147 Begin
148 `You are old,' said the youth, `as I mentioned before,
149 And have grown most uncommonly fat;
150 Yet you turned a back-somersault in at the door--
151 Pray, what is the reason of that?'
152
153 `In my youth,' said the sage, as he shook his grey locks,
154 `I kept all my limbs very supple
155 By the use of this ointment--one shilling the box--
156 Allow me to sell you a couple?'
157
158 End
159 Type of part 2 = multipart/mixed; boundary="----- =_aaaaaaaaaa2"
160 Message part size - 1532
161 Encapsulated message :
162 Begin
163 Type of part 1 = application/octet-stream; name="msg.23"
164 Message part size - 669
165 Attachment - saving [msg.23]
166 Begin
167 `You are old,' said the youth, `and your jaws are too weak
168 For anything tougher than suet;
169 Yet you finished the goose, with the bones and the beak--
170 Pray how did you manage to do it?'
171
172 `In my youth,' said his father, `I took to the law,
173 And argued each case with my wife;
174 And the muscular strength, which it gave to my jaw,
175 Has lasted the rest of my life.'
176
177 End
178 Type of part 2 = application/octet-stream; name="msg.24"
179 Message part size - 680
180 Attachment - saving [msg.24]
181 Begin
182 `You are old,' said the youth, `one would hardly suppose
183 That your eye was as steady as ever;
184 Yet you balanced an eel on the end of your nose--
185 What made you so awfully clever?'
186
187 `I have answered three questions, and that is enough,'
188 Said his father; `don't give yourself airs!
189 Do you think I can listen all day to such stuff?
190 Be off, or I'll kick you down stairs!'
191
192 End
193
194 End
195
196 End
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2002, Free Software Foundation
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #
18
19 scheme: => SUCCESS
20 scheme <scheme>
21 user <>
22 passwd <>
23 auth <>
24 host <>
25 port 0
26 path <>
27 query <>
28
29 scheme:/absolute/path => SUCCESS
30 scheme <scheme>
31 user <>
32 passwd <>
33 auth <>
34 host <>
35 port 0
36 path </absolute/path>
37 query <>
38
39 scheme:relative/path => SUCCESS
40 scheme <scheme>
41 user <>
42 passwd <>
43 auth <>
44 host <>
45 port 0
46 path <relative/path>
47 query <>
48
49 scheme:///relative/path => SUCCESS
50 scheme <scheme>
51 user <>
52 passwd <>
53 auth <>
54 host <>
55 port 0
56 path <relative/path>
57 query <>
58
59 scheme:////absolute/path => SUCCESS
60 scheme <scheme>
61 user <>
62 passwd <>
63 auth <>
64 host <>
65 port 0
66 path </absolute/path>
67 query <>
68
69 scheme://%75%73%65%72:%70%61%73%73@%68%6f%73%74 => SUCCESS
70 scheme <scheme>
71 user <user>
72 passwd <pass>
73 auth <>
74 host <hest>
75 port 0
76 path <>
77 query <>
78
79 ftp://user:pass@host//a/path => SUCCESS
80 scheme <ftp>
81 user <user>
82 passwd <pass>
83 auth <>
84 host <host>
85 port 0
86 path </a/path>
87 query <>
88
89 ftp://:pass@host//a/path => SUCCESS
90 scheme <ftp>
91 user <>
92 passwd <pass>
93 auth <>
94 host <host>
95 port 0
96 path </a/path>
97 query <>
98
99 ftp://user:@host//a/path => SUCCESS
100 scheme <ftp>
101 user <user>
102 passwd <>
103 auth <>
104 host <host>
105 port 0
106 path </a/path>
107 query <>
108
109 ftp://user:pass@//a/path => SUCCESS
110 scheme <ftp>
111 user <user>
112 passwd <pass>
113 auth <>
114 host <>
115 port 0
116 path </a/path>
117 query <>
118
119 ftp://user:@//a/path => SUCCESS
120 scheme <ftp>
121 user <user>
122 passwd <>
123 auth <>
124 host <>
125 port 0
126 path </a/path>
127 query <>
128
129 ftp://:@host//a/path => SUCCESS
130 scheme <ftp>
131 user <>
132 passwd <>
133 auth <>
134 host <host>
135 port 0
136 path </a/path>
137 query <>
138
139 ftp://:pass@//a/path => SUCCESS
140 scheme <ftp>
141 user <>
142 passwd <pass>
143 auth <>
144 host <>
145 port 0
146 path </a/path>
147 query <>
148
149 ftp://:@//a/path => SUCCESS
150 scheme <ftp>
151 user <>
152 passwd <>
153 auth <>
154 host <>
155 port 0
156 path </a/path>
157 query <>
158
159 ftp://://a/path => SUCCESS
160 scheme <ftp>
161 user <>
162 passwd <>
163 auth <>
164 host <>
165 port 0
166 path </a/path>
167 query <>
168
169 ftp://@//a/path => SUCCESS
170 scheme <ftp>
171 user <>
172 passwd <>
173 auth <>
174 host <>
175 port 0
176 path </a/path>
177 query <>
178
179 ftp:////a/path => SUCCESS
180 scheme <ftp>
181 user <>
182 passwd <>
183 auth <>
184 host <>
185 port 0
186 path </a/path>
187 query <>
188
189 ftp://user:pass@host/a/path => SUCCESS
190 scheme <ftp>
191 user <user>
192 passwd <pass>
193 auth <>
194 host <host>
195 port 0
196 path <a/path>
197 query <>
198
199 ftp://:pass@host/a/path => SUCCESS
200 scheme <ftp>
201 user <>
202 passwd <pass>
203 auth <>
204 host <host>
205 port 0
206 path <a/path>
207 query <>
208
209 ftp://user:@host/a/path => SUCCESS
210 scheme <ftp>
211 user <user>
212 passwd <>
213 auth <>
214 host <host>
215 port 0
216 path <a/path>
217 query <>
218
219 ftp://user:pass@/a/path => SUCCESS
220 scheme <ftp>
221 user <user>
222 passwd <pass>
223 auth <>
224 host <>
225 port 0
226 path <a/path>
227 query <>
228
229 ftp://user:@/a/path => SUCCESS
230 scheme <ftp>
231 user <user>
232 passwd <>
233 auth <>
234 host <>
235 port 0
236 path <a/path>
237 query <>
238
239 ftp://:@host/a/path => SUCCESS
240 scheme <ftp>
241 user <>
242 passwd <>
243 auth <>
244 host <host>
245 port 0
246 path <a/path>
247 query <>
248
249 ftp://:pass@/a/path => SUCCESS
250 scheme <ftp>
251 user <>
252 passwd <pass>
253 auth <>
254 host <>
255 port 0
256 path <a/path>
257 query <>
258
259 ftp://:@/a/path => SUCCESS
260 scheme <ftp>
261 user <>
262 passwd <>
263 auth <>
264 host <>
265 port 0
266 path <a/path>
267 query <>
268
269 ftp://:/a/path => SUCCESS
270 scheme <ftp>
271 user <>
272 passwd <>
273 auth <>
274 host <>
275 port 0
276 path <a/path>
277 query <>
278
279 ftp://@/a/path => SUCCESS
280 scheme <ftp>
281 user <>
282 passwd <>
283 auth <>
284 host <>
285 port 0
286 path <a/path>
287 query <>
288
289 ftp:///a/path => SUCCESS
290 scheme <ftp>
291 user <>
292 passwd <>
293 auth <>
294 host <>
295 port 0
296 path <a/path>
297 query <>
298
299 pop://pop.example.net => SUCCESS
300 scheme <pop>
301 user <>
302 passwd <>
303 auth <>
304 host <pop.example.net>
305 port 0
306 path <>
307 query <>
308
309 pop://user@pop.example.net => SUCCESS
310 scheme <pop>
311 user <user>
312 passwd <>
313 auth <>
314 host <pop.example.net>
315 port 0
316 path <>
317 query <>
318
319 pop://user:passwd@pop.example.net => SUCCESS
320 scheme <pop>
321 user <user>
322 passwd <passwd>
323 auth <>
324 host <pop.example.net>
325 port 0
326 path <>
327 query <>
328
329 pop://user;auth=*@pop.example.net => SUCCESS
330 scheme <pop>
331 user <user>
332 passwd <>
333 auth <*>
334 host <pop.example.net>
335 port 0
336 path <>
337 query <>
338
339 pop://pop.example.net:111 => SUCCESS
340 scheme <pop>
341 user <>
342 passwd <>
343 auth <>
344 host <pop.example.net>
345 port 111
346 path <>
347 query <>
348
349 pop://user@pop.example.net:111 => SUCCESS
350 scheme <pop>
351 user <user>
352 passwd <>
353 auth <>
354 host <pop.example.net>
355 port 111
356 path <>
357 query <>
358
359 pop://user:passwd@pop.example.net:111 => SUCCESS
360 scheme <pop>
361 user <user>
362 passwd <passwd>
363 auth <>
364 host <pop.example.net>
365 port 111
366 path <>
367 query <>
368
369 pop://user;auth=*@pop.example.net:111 => SUCCESS
370 scheme <pop>
371 user <user>
372 passwd <>
373 auth <*>
374 host <pop.example.net>
375 port 111
376 path <>
377 query <>
378
379 imap://imap.example.net => SUCCESS
380 scheme <imap>
381 user <>
382 passwd <>
383 auth <>
384 host <imap.example.net>
385 port 0
386 path <>
387 query <>
388
389 imap://user@imap.example.net => SUCCESS
390 scheme <imap>
391 user <user>
392 passwd <>
393 auth <>
394 host <imap.example.net>
395 port 0
396 path <>
397 query <>
398
399 imap://user:passwd@imap.example.net => SUCCESS
400 scheme <imap>
401 user <user>
402 passwd <passwd>
403 auth <>
404 host <imap.example.net>
405 port 0
406 path <>
407 query <>
408
409 imap://user;auth=*@imap.example.net => SUCCESS
410 scheme <imap>
411 user <user>
412 passwd <>
413 auth <*>
414 host <imap.example.net>
415 port 0
416 path <>
417 query <>
418
419 imap://imap.example.net:111 => SUCCESS
420 scheme <imap>
421 user <>
422 passwd <>
423 auth <>
424 host <imap.example.net>
425 port 111
426 path <>
427 query <>
428
429 imap://user@imap.example.net:111 => SUCCESS
430 scheme <imap>
431 user <user>
432 passwd <>
433 auth <>
434 host <imap.example.net>
435 port 111
436 path <>
437 query <>
438
439 imap://user:passwd@imap.example.net:111 => SUCCESS
440 scheme <imap>
441 user <user>
442 passwd <passwd>
443 auth <>
444 host <imap.example.net>
445 port 111
446 path <>
447 query <>
448
449 imap://user;auth=*@imap.example.net:111 => SUCCESS
450 scheme <imap>
451 user <user>
452 passwd <>
453 auth <*>
454 host <imap.example.net>
455 port 111
456 path <>
457 query <>
458
459 imap://imap.example.net/mbox => SUCCESS
460 scheme <imap>
461 user <>
462 passwd <>
463 auth <>
464 host <imap.example.net>
465 port 0
466 path <mbox>
467 query <>
468
469 imap://user@imap.example.net/mbox => SUCCESS
470 scheme <imap>
471 user <user>
472 passwd <>
473 auth <>
474 host <imap.example.net>
475 port 0
476 path <mbox>
477 query <>
478
479 imap://user:passwd@imap.example.net/mbox => SUCCESS
480 scheme <imap>
481 user <user>
482 passwd <passwd>
483 auth <>
484 host <imap.example.net>
485 port 0
486 path <mbox>
487 query <>
488
489 imap://user;auth=*@imap.example.net/mbox => SUCCESS
490 scheme <imap>
491 user <user>
492 passwd <>
493 auth <*>
494 host <imap.example.net>
495 port 0
496 path <mbox>
497 query <>
498
499 imap://imap.example.net:111/mbox => SUCCESS
500 scheme <imap>
501 user <>
502 passwd <>
503 auth <>
504 host <imap.example.net>
505 port 111
506 path <mbox>
507 query <>
508
509 imap://user@imap.example.net:111/mbox => SUCCESS
510 scheme <imap>
511 user <user>
512 passwd <>
513 auth <>
514 host <imap.example.net>
515 port 111
516 path <mbox>
517 query <>
518
519 imap://user:passwd@imap.example.net:111/mbox => SUCCESS
520 scheme <imap>
521 user <user>
522 passwd <passwd>
523 auth <>
524 host <imap.example.net>
525 port 111
526 path <mbox>
527 query <>
528
529 imap://user;auth=*@imap.example.net:111/mbox => SUCCESS
530 scheme <imap>
531 user <user>
532 passwd <>
533 auth <*>
534 host <imap.example.net>
535 port 111
536 path <mbox>
537 query <>
538
539 imap://imap.example.net/mbox/user@host => SUCCESS
540 scheme <imap>
541 user <imap.example.net/mbox/user>
542 passwd <>
543 auth <>
544 host <host>
545 port 0
546 path <>
547 query <>
548
549 imap://user@imap.example.net/mbox/user@host => SUCCESS
550 scheme <imap>
551 user <user>
552 passwd <>
553 auth <>
554 host <imap.example.net>
555 port 0
556 path <mbox/user@host>
557 query <>
558
559 imap://user:passwd@imap.example.net/mbox/user@host => SUCCESS
560 scheme <imap>
561 user <user>
562 passwd <passwd>
563 auth <>
564 host <imap.example.net>
565 port 0
566 path <mbox/user@host>
567 query <>
568
569 imap://user;auth=*@imap.example.net/mbox/user@host => SUCCESS
570 scheme <imap>
571 user <user>
572 passwd <>
573 auth <*>
574 host <imap.example.net>
575 port 0
576 path <mbox/user@host>
577 query <>
578
579 imap://imap.example.net:111/mbox/user@host => SUCCESS
580 scheme <imap>
581 user <imap.example.net>
582 passwd <111/mbox/user>
583 auth <>
584 host <host>
585 port 0
586 path <>
587 query <>
588
589 imap://user@imap.example.net:111/mbox/user@host => SUCCESS
590 scheme <imap>
591 user <user>
592 passwd <>
593 auth <>
594 host <imap.example.net>
595 port 111
596 path <mbox/user@host>
597 query <>
598
599 imap://user:passwd@imap.example.net:111/mbox/user@host => SUCCESS
600 scheme <imap>
601 user <user>
602 passwd <passwd>
603 auth <>
604 host <imap.example.net>
605 port 111
606 path <mbox/user@host>
607 query <>
608
609 imap://user;auth=*@imap.example.net:111/mbox/user@host => SUCCESS
610 scheme <imap>
611 user <user>
612 passwd <>
613 auth <*>
614 host <imap.example.net>
615 port 111
616 path <mbox/user@host>
617 query <>
618
619 ftp://ftp.example.org/mbox/user%40host => SUCCESS
620 scheme <ftp>
621 user <>
622 passwd <>
623 auth <>
624 host <ftp.example.org>
625 port 0
626 path <mbox/user@host>
627 query <>
628
629 ftp://ftp.example.org:111/mbox/user%40host => SUCCESS
630 scheme <ftp>
631 user <>
632 passwd <>
633 auth <>
634 host <ftp.example.org>
635 port 111
636 path <mbox/user@host>
637 query <>
638
639 # NOTE: This file must end with an empty line
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, Free Software Foundation
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
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.
18
19 source $top_srcdir/testsuite/lib/mailutils.exp
20
21 mu_init
22
23 proc mailbox_run {args} {
24 global verbose
25 global expect_out
26
27 set sw ""
28 for {set i 0} {$i < [llength $args]} {incr i} {
29 set a [lindex $args $i]
30 if {"$a" == "-mail-spool"} {
31 if [info exists host_board] {
32 if [board_info $host_board exists top_srcdir] {
33 append sw "--mail-spool [board_info $host_board top_srcdir]/mail/testsuite/spool"
34 }
35 }
36 if {![info exists init_spool]} {
37 set init_spool 1
38 }
39 } elseif {"$a" == "-reuse-spool"} {
40 set init_spool 0
41 } else {
42 break
43 }
44 }
45
46 if [info exists init_spool] {
47 mu_prepare_spools
48 }
49
50 set args "[lrange $args $i end] $sw"
51
52 verbose "Spawning $args"
53
54 set res [remote_spawn host $args]
55 if { $res < 0 || $res == "" } {
56 perror "Spawning $args failed."
57 return 1;
58 }
59
60 return 0
61 }
62
63 proc mailbox_send { string } {
64 return [mu_send "$string"]
65 }
66
67 # mailbox_test [-message MESSAGE][-default (FAIL|XFAIL)]
68 # COMMAND [-pattern PATTERN-LIST][PATTERN...]
69 # COMMAND - Command to send.
70 # PATTERN - Sequence to expect in return.
71 # MESSAGE - [optional] message to output
72 proc mailbox_test { args } {
73 global verbose
74 global suppress_flag;
75 upvar timeout timeout
76
77 set default ""
78 set message ""
79 for {set i 0} {$i < [llength $args]} {incr i} {
80 set a [lindex $args $i]
81 if {"$a" == "-default"} {
82 incr i
83 set default [lindex $args $i]
84 } elseif {"$a" == "-message"} {
85 incr i
86 set message [lindex $args $i]
87 } elseif {"$a" == "-pattern"} {
88 incr i
89 set pattern [lindex $args $i]
90 } else {
91 set args [lrange $args $i end]
92 break
93 }
94 }
95
96 if {"$message" == ""} {
97 set message [lindex $args 0]
98 }
99
100 if $verbose>2 then {
101 send_user "Message is \"$message\"\n"
102 }
103 set command [lindex $args 0]
104 if {[llength $args] >= 2} {
105 set pattern [lrange $args 1 end]
106 }
107
108 if [info exists pattern] {
109 set result [mu_test $command $pattern]
110 } else {
111 set result [mu_test $command]
112 }
113
114 if {$result == 0} {
115 pass "$message"
116 } elseif {$result == 1} {
117 if { "$default" == "" || "$default" != "FAIL" } {
118 fail "$message"
119 } else {
120 xfail "$message"
121 set result 0
122 }
123 } elseif {$result == -2} {
124 fail "$message (timeout)"
125 } elseif {$result == -3} {
126 fail "$message (eof)"
127 } else {
128 fail "$message"
129 }
130 return $result
131 }
132
133
1 address.exp
2 mime.exp
3 url.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, Free Software Foundation
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
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.
18
19 mailbox_run ${top_builddir}/examples/addr
20
21 set chan [open ${objdir}/Addrs r]
22
23 set command ""
24 for {gets $chan line} {![eof $chan]} {gets $chan line} {
25 switch -regexp -- "$line" {
26 "^#.*" { }
27 "^[^ \t].*=>.*" {
28 regexp "(.*)=>.*" $line dummy command
29 set pattern [list $line]
30 }
31 "^\$" {
32 if {$command != ""} {
33 mailbox_test -pattern $pattern $command
34 set command ""
35 }
36 }
37 default {
38 if [info exist pattern] {
39 set pattern [concat $pattern [list $line]]
40 }
41 }
42 }
43 }
44
45 close $chan
46
47 # end of address.exp
...\ No newline at end of file ...\ No newline at end of file
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, Free Software Foundation
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
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.
18
19 set MU_TOOL "${top_builddir}/examples/mimetest"
20 set MU_TOOL_FLAGS "-i 0 -p $MU_SPOOL_DIR/mbox1"
21
22 mu_prepare_spools
23
24 set chan [open ${objdir}/Mime r]
25
26 set pattern [list]
27 for {gets $chan line} {![eof $chan]} {gets $chan line} {
28 switch -regexp -- "$line" {
29 "^#.*" { }
30 default { set pattern [concat $pattern [list $line]] }
31 }
32 }
33
34 mu_exec -retcode 0 -message "MIME" -pattern $pattern
35
36 close $chan
37
38 # end of mime.exp
...\ No newline at end of file ...\ No newline at end of file
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, Free Software Foundation
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
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.
18
19 mailbox_run ${top_builddir}/examples/url-parse
20
21 set chan [open ${objdir}/Urls r]
22
23 set command ""
24 for {gets $chan line} {![eof $chan]} {gets $chan line} {
25 verbose "LINE: $line"
26 switch -regexp -- "$line" {
27 "^#.*" { }
28 "^[^ \t].*=>.*" {
29 regexp "(.*\[^ \t\])\[ \t\]*=>.*" $line dummy command
30 verbose "COMMAND: \"$command\""
31 set pattern [list $line]
32 }
33 "^\$" {
34 if {$command != ""} {
35 mailbox_test -pattern $pattern $command
36 set command ""
37 }
38 }
39 default {
40 set pattern [concat $pattern [list $line]]
41 }
42 }
43 }
44
45 close $chan
46
47 # end of url.exp
...\ No newline at end of file ...\ No newline at end of file