mhn: fixes in compose mode.
* mh/mhn.c (edit_forw): Accept directives without explicit folder spec. Fix creation of individual mime parts; set Content-Type: message/rfc822 for each of them. (mhn_edit): Fix some coredumps. (main): Use -file argument, if it is given. * mh/tests/atlocal.in (mimeflt): New function. * mh/tests/mhn.at: Add tests for compose mode.
Showing
3 changed files
with
714 additions
and
14 deletions
... | @@ -2223,15 +2223,14 @@ edit_extern (char *cmd, struct compose_env *env, mu_message_t *msg, int level) | ... | @@ -2223,15 +2223,14 @@ edit_extern (char *cmd, struct compose_env *env, mu_message_t *msg, int level) |
2223 | int | 2223 | int |
2224 | edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) | 2224 | edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) |
2225 | { | 2225 | { |
2226 | char *sp, *id = NULL, *descr = NULL; | 2226 | char *id = NULL, *descr = NULL; |
2227 | int stop = 0, status = 0; | 2227 | int stop = 0, status = 0; |
2228 | size_t i; | 2228 | size_t i, npart; |
2229 | struct mu_wordsplit ws; | 2229 | struct mu_wordsplit ws; |
2230 | mu_header_t hdr; | 2230 | mu_header_t hdr; |
2231 | mu_mime_t mime; | 2231 | mu_mime_t mime; |
2232 | mu_message_t msg; | 2232 | mu_message_t msg; |
2233 | const char *val; | 2233 | const char *val; |
2234 | char *newval; | ||
2235 | 2234 | ||
2236 | skipws (cmd); | 2235 | skipws (cmd); |
2237 | while (stop == 0 && status == 0 && *cmd) | 2236 | while (stop == 0 && status == 0 && *cmd) |
... | @@ -2283,10 +2282,22 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) | ... | @@ -2283,10 +2282,22 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) |
2283 | 2282 | ||
2284 | mu_mime_create (&mime, NULL, 0); | 2283 | mu_mime_create (&mime, NULL, 0); |
2285 | 2284 | ||
2285 | if (ws.ws_wordv[0][0] == '+') | ||
2286 | { | ||
2286 | mbox = mh_open_folder (ws.ws_wordv[0], 0); | 2287 | mbox = mh_open_folder (ws.ws_wordv[0], 0); |
2287 | for (i = 1; i < ws.ws_wordc; i++) | 2288 | i = 1; |
2289 | } | ||
2290 | else | ||
2288 | { | 2291 | { |
2289 | mu_message_t input_msg; | 2292 | mbox = mh_open_folder (mh_current_folder (), 0); |
2293 | i = 0; | ||
2294 | } | ||
2295 | |||
2296 | for (npart = 1; i < ws.ws_wordc; i++, npart++) | ||
2297 | { | ||
2298 | mu_message_t input_msg, newmsg; | ||
2299 | mu_body_t body; | ||
2300 | mu_stream_t input_str, bstr; | ||
2290 | char *endp; | 2301 | char *endp; |
2291 | size_t n = strtoul (ws.ws_wordv[i], &endp, 10); | 2302 | size_t n = strtoul (ws.ws_wordv[i], &endp, 10); |
2292 | 2303 | ||
... | @@ -2308,9 +2319,47 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) | ... | @@ -2308,9 +2319,47 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) |
2308 | return 1; | 2319 | return 1; |
2309 | } | 2320 | } |
2310 | 2321 | ||
2311 | if ((status = mu_message_create_copy (&msg, input_msg))) | 2322 | status = mu_message_get_streamref (input_msg, &input_str); |
2312 | break; | 2323 | if (status) |
2313 | mu_mime_add_part (mime, msg); | 2324 | { |
2325 | mu_diag_funcall (MU_DIAG_ERROR, "mu_message_get_streamref", NULL, | ||
2326 | status); | ||
2327 | exit (1); | ||
2328 | } | ||
2329 | |||
2330 | status = mu_message_create (&newmsg, NULL); | ||
2331 | if (status) | ||
2332 | { | ||
2333 | mu_diag_funcall (MU_DIAG_ERROR, "mu_message_create", NULL, status); | ||
2334 | exit (1); | ||
2335 | } | ||
2336 | status = mu_message_get_body (newmsg, &body); | ||
2337 | if (status) | ||
2338 | { | ||
2339 | mu_diag_funcall (MU_DIAG_ERROR, "mu_message_get_body", NULL, | ||
2340 | status); | ||
2341 | exit (1); | ||
2342 | } | ||
2343 | status = mu_body_get_streamref (body, &bstr); | ||
2344 | if (status) | ||
2345 | { | ||
2346 | mu_diag_funcall (MU_DIAG_ERROR, "mu_body_get_streamref", NULL, | ||
2347 | status); | ||
2348 | exit (1); | ||
2349 | } | ||
2350 | status = mu_stream_copy (bstr, input_str, 0, NULL); | ||
2351 | if (status) | ||
2352 | { | ||
2353 | mu_diag_funcall (MU_DIAG_ERROR, "mu_stream_copy", NULL, | ||
2354 | status); | ||
2355 | exit (1); | ||
2356 | } | ||
2357 | mu_stream_unref (bstr); | ||
2358 | mu_stream_unref (input_str); | ||
2359 | |||
2360 | mu_message_get_header (newmsg, &hdr); | ||
2361 | mu_header_set_value (hdr, MU_HEADER_CONTENT_TYPE, "message/rfc822", 1); | ||
2362 | mu_mime_add_part (mime, newmsg); | ||
2314 | } | 2363 | } |
2315 | mu_wordsplit_free (&ws); | 2364 | mu_wordsplit_free (&ws); |
2316 | 2365 | ||
... | @@ -2322,13 +2371,20 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) | ... | @@ -2322,13 +2371,20 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level) |
2322 | 2371 | ||
2323 | mu_mime_get_message (mime, &msg); | 2372 | mu_mime_get_message (mime, &msg); |
2324 | mu_message_get_header (msg, &hdr); | 2373 | mu_message_get_header (msg, &hdr); |
2374 | |||
2375 | if (npart > 2) | ||
2376 | { | ||
2377 | char *newval, *sp; | ||
2378 | |||
2325 | mu_header_sget_value (hdr, MU_HEADER_CONTENT_TYPE, &val); | 2379 | mu_header_sget_value (hdr, MU_HEADER_CONTENT_TYPE, &val); |
2326 | sp = strchr (val, ';'); | 2380 | sp = strchr (val, ';'); |
2327 | if (!sp) | 2381 | if (sp) |
2328 | abort (); | 2382 | { |
2329 | mu_asprintf (&newval, "multipart/digest%s", sp); | 2383 | mu_asprintf (&newval, "multipart/digest%s", sp); |
2330 | mu_header_set_value (hdr, MU_HEADER_CONTENT_TYPE, newval, 1); | 2384 | mu_header_set_value (hdr, MU_HEADER_CONTENT_TYPE, newval, 1); |
2331 | free (newval); | 2385 | free (newval); |
2386 | } | ||
2387 | } | ||
2332 | 2388 | ||
2333 | if (!id) | 2389 | if (!id) |
2334 | id = mh_create_message_id (env->subpart); | 2390 | id = mh_create_message_id (env->subpart); |
... | @@ -2463,7 +2519,6 @@ mhn_edit (struct compose_env *env, int level) | ... | @@ -2463,7 +2519,6 @@ mhn_edit (struct compose_env *env, int level) |
2463 | int status = 0; | 2519 | int status = 0; |
2464 | char *buf = NULL; | 2520 | char *buf = NULL; |
2465 | size_t bufsize = 0, n; | 2521 | size_t bufsize = 0, n; |
2466 | mu_body_t body; | ||
2467 | mu_stream_t output = NULL; | 2522 | mu_stream_t output = NULL; |
2468 | mu_message_t msg = NULL; | 2523 | mu_message_t msg = NULL; |
2469 | size_t line_count = 0; | 2524 | size_t line_count = 0; |
... | @@ -2483,6 +2538,11 @@ mhn_edit (struct compose_env *env, int level) | ... | @@ -2483,6 +2538,11 @@ mhn_edit (struct compose_env *env, int level) |
2483 | /* Create new message */ | 2538 | /* Create new message */ |
2484 | mu_message_create (&msg, NULL); | 2539 | mu_message_create (&msg, NULL); |
2485 | mu_message_get_header (msg, &hdr); | 2540 | mu_message_get_header (msg, &hdr); |
2541 | } | ||
2542 | if (!output) | ||
2543 | { | ||
2544 | mu_body_t body; | ||
2545 | |||
2486 | mu_message_get_body (msg, &body); | 2546 | mu_message_get_body (msg, &body); |
2487 | mu_body_get_streamref (body, &output); | 2547 | mu_body_get_streamref (body, &output); |
2488 | line_count = 0; | 2548 | line_count = 0; |
... | @@ -2849,9 +2909,9 @@ main (int argc, char **argv) | ... | @@ -2849,9 +2909,9 @@ main (int argc, char **argv) |
2849 | mu_error (_("extra arguments")); | 2909 | mu_error (_("extra arguments")); |
2850 | return 1; | 2910 | return 1; |
2851 | } | 2911 | } |
2852 | input_file = mh_expand_name (mu_folder_directory (), | 2912 | message = mh_file_to_message (NULL, |
2853 | argc == 1 ? argv[0] : "draft", 0); | 2913 | mu_tilde_expansion (input_file, |
2854 | message = mh_file_to_message (NULL, input_file); | 2914 | "/", NULL)); |
2855 | if (!message) | 2915 | if (!message) |
2856 | return 1; | 2916 | return 1; |
2857 | } | 2917 | } | ... | ... |
... | @@ -6,3 +6,34 @@ PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH | ... | @@ -6,3 +6,34 @@ PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH |
6 | remove_curdir() { | 6 | remove_curdir() { |
7 | sed "s|$curdir/*||;s| *$||" $* | 7 | sed "s|$curdir/*||;s| *$||" $* |
8 | } | 8 | } |
9 | # mimeflt [FILE] | ||
10 | # Filter out all variable information from a MIME message in FILE. | ||
11 | # If FILE is not given, filter stdin. | ||
12 | # "Variable information" means part boundary and Content-ID header values. | ||
13 | # These elements are likely to change between invocations of mhn -build. | ||
14 | mimeflt() { | ||
15 | awk ' | ||
16 | /^Content-Type:/ { | ||
17 | if (match($0, /boundary=".*"/)) { | ||
18 | s=substr($0,RSTART+10,RLENGTH-11) | ||
19 | boundary[++boundary_num] = s | ||
20 | sub(/boundary=".*"/,"boundary=\"BOUNDARY-" boundary_num "\"") | ||
21 | } | ||
22 | } | ||
23 | /^X-IMAPbase:/ { next } | ||
24 | /^Content-ID:/ { | ||
25 | content_id[$2]++ | ||
26 | print "Content-ID:", ++content_id_num | ||
27 | next | ||
28 | } | ||
29 | { | ||
30 | if ($0 == ("--" boundary[boundary_num])) { | ||
31 | print "--BOUNDARY-" boundary_num | ||
32 | } else if ($0 == ("--" boundary[boundary_num] "--")) { | ||
33 | print "--BOUNDARY-" boundary_num "--" | ||
34 | boundary_num-- | ||
35 | } else | ||
36 | |||
37 | } | ||
38 | ' $* | ||
39 | } | ... | ... |
... | @@ -412,6 +412,615 @@ part 2 application/x-tar 13835 | ... | @@ -412,6 +412,615 @@ part 2 application/x-tar 13835 |
412 | -rw-r--r-- gray/staff 937 2010-11-29 13:58 Jabberwocky | 412 | -rw-r--r-- gray/staff 937 2010-11-29 13:58 Jabberwocky |
413 | ]) | 413 | ]) |
414 | 414 | ||
415 | dnl ------------------------------------------------------------------- | ||
416 | dnl 4. Compose mode | ||
417 | dnl ------------------------------------------------------------------- | ||
418 | MH_CHECK([mhn-compose: adjacent plain text], | ||
419 | [mhn17 mhn-compose mhn-compose-01],[ | ||
420 | AT_DATA([input], | ||
421 | [From: gray@example.net | ||
422 | Subject: Adjacent plain text contexts | ||
423 | ------ | ||
424 | this is the first content | ||
425 | # | ||
426 | and this is the second | ||
427 | ]) | ||
428 | mhn -build ./input || exit $? | ||
429 | mimeflt input | ||
430 | ], | ||
431 | [0], | ||
432 | [From: gray@example.net | ||
433 | Subject: Adjacent plain text contexts | ||
434 | Content-Type: multipart/mixed; boundary="BOUNDARY-1" | ||
435 | MIME-Version: 1.0 | ||
436 | |||
437 | --BOUNDARY-1 | ||
438 | Content-ID: 1 | ||
439 | Content-Type: text/plain | ||
440 | |||
441 | this is the first content | ||
442 | |||
443 | --BOUNDARY-1 | ||
444 | Content-ID: 2 | ||
445 | Content-Type: text/plain | ||
446 | |||
447 | and this is the second | ||
448 | |||
449 | --BOUNDARY-1-- | ||
450 | ]) | ||
451 | |||
452 | MH_CHECK([mhn-compose: plain text content types], | ||
453 | [mhn18 mhn-compose mhn-compose-02],[ | ||
454 | AT_DATA([input], | ||
455 | [From: gray@example.net | ||
456 | Subject: Plaintext content types | ||
457 | ------ | ||
458 | #<text/enriched [First part] | ||
459 | this content will be tagged as text/enriched | ||
460 | # | ||
461 | and this content will be tagged as text/plain | ||
462 | # | ||
463 | #<application/x-patch [this is a patch] | ||
464 | and this content will be tagged as application/x-patch | ||
465 | ]) | ||
466 | mhn -build -file ./input||exit $? | ||
467 | mimeflt input | ||
468 | ], | ||
469 | [0], | ||
470 | [From: gray@example.net | ||
471 | Subject: Plaintext content types | ||
472 | Content-Type: multipart/mixed; boundary="BOUNDARY-1" | ||
473 | MIME-Version: 1.0 | ||
474 | |||
475 | --BOUNDARY-1 | ||
476 | Content-Description: First part | ||
477 | Content-ID: 1 | ||
478 | Content-Type: text/enriched | ||
479 | |||
480 | this content will be tagged as text/enriched | ||
481 | |||
482 | --BOUNDARY-1 | ||
483 | Content-ID: 2 | ||
484 | Content-Type: text/plain | ||
485 | |||
486 | and this content will be tagged as text/plain | ||
487 | |||
488 | --BOUNDARY-1 | ||
489 | Content-Description: this is a patch | ||
490 | Content-ID: 3 | ||
491 | Content-Type: application/x-patch | ||
492 | |||
493 | and this content will be tagged as application/x-patch | ||
494 | |||
495 | --BOUNDARY-1-- | ||
496 | ]) | ||
497 | |||
498 | MH_CHECK([mhn-compose: sharp at the beginning of a line], | ||
499 | [mhn19 mhn-compose mhn-compose-03],[ | ||
500 | AT_DATA([input], | ||
501 | [From: gray@example.net | ||
502 | Subject: Sharp at the beginning of a line | ||
503 | ------ | ||
504 | ##when sent, this line will start with only one # | ||
505 | ]) | ||
506 | |||
507 | mhn -build ./input || exit $? | ||
508 | mimeflt input | ||
509 | ], | ||
510 | [0], | ||
511 | [From: gray@example.net | ||
512 | Subject: Sharp at the beginning of a line | ||
513 | Content-Type: text/plain | ||
514 | MIME-Version: 1.0 | ||
515 | |||
516 | #when sent, this line will start with only one # | ||
517 | |||
518 | ]) | ||
519 | |||
520 | MH_CHECK([mhn-compose: charset], | ||
521 | [mhn20 mhn-compose mhn-compose-04],[ | ||
522 | AT_DATA([input], | ||
523 | [From: gray@example.net | ||
524 | Subject: Charset | ||
525 | ------ | ||
526 | #<text/plain; charset=utf-8 | ||
527 | Cześć | ||
528 | ]) | ||
529 | mhn -build ./input || exit $? | ||
530 | mimeflt input | ||
531 | ], | ||
532 | [0], | ||
533 | [From: gray@example.net | ||
534 | Subject: Charset | ||
535 | Content-Transfer-Encoding: quoted-printable | ||
536 | Content-Type: text/plain; charset=utf-8 | ||
537 | MIME-Version: 1.0 | ||
538 | |||
539 | Cze=C5=9B=C4=87 | ||
540 | |||
541 | ]) | ||
542 | |||
543 | MH_CHECK([mhn-compose: forward], | ||
544 | [mhn21 mhn-compose mhn-compose-05],[ | ||
545 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | ||
546 | AT_DATA([input], | ||
547 | [From: gray@example.net | ||
548 | Subject: Forwards | ||
549 | ------ | ||
550 | #forw [forwarded messages] +inbox 1 2 5 | ||
551 | ]) | ||
552 | |||
553 | mhn -build ./input || exit $? | ||
554 | mimeflt input | ||
555 | ], | ||
556 | [0], | ||
557 | [From: gray@example.net | ||
558 | Subject: Forwards | ||
559 | Content-Description: forwarded messages | ||
560 | Content-Type: multipart/digest; boundary="BOUNDARY-1" | ||
561 | MIME-Version: 1.0 | ||
562 | |||
563 | --BOUNDARY-1 | ||
564 | Content-Type: message/rfc822 | ||
565 | |||
566 | Received: (from foobar@nonexistent.net) | ||
567 | by nonexistent.net id fBSKI8N04906 | ||
568 | for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200 | ||
569 | Date: Fri, 28 Dec 2001 22:18:08 +0200 | ||
570 | From: Foo Bar <foobar@nonexistent.net> | ||
571 | Message-Id: <200112282018.fBSKI8N04906@nonexistent.net> | ||
572 | To: Bar <bar@dontmailme.org> | ||
573 | Subject: Jabberwocky | ||
574 | X-Envelope-Date: Fri Dec 28 22:18:09 2001 | ||
575 | X-Envelope-Sender: foobar@nonexistent.net | ||
576 | |||
577 | `Twas brillig, and the slithy toves | ||
578 | Did gyre and gimble in the wabe; | ||
579 | All mimsy were the borogoves, | ||
580 | And the mome raths outgrabe. | ||
581 | |||
582 | `Beware the Jabberwock, my son! | ||
583 | The jaws that bite, the claws that catch! | ||
584 | Beware the Jujub bird, and shun | ||
585 | The frumious Bandersnatch!' | ||
586 | |||
587 | He took his vorpal sword in hand: | ||
588 | Long time the manxome foe he sought -- | ||
589 | So rested he by the Tumtum gree, | ||
590 | And stood awhile in thought. | ||
591 | |||
592 | And as in uffish thought he stood, | ||
593 | The Jabberwock, with eyes of flame, | ||
594 | Came whiffling through the tulgey wook, | ||
595 | And burbled as it came! | ||
596 | |||
597 | One, two! One, two! And through and through | ||
598 | The vorpal blade went snicker-snack! | ||
599 | He left it dead, and with its head | ||
600 | He went galumphing back. | ||
601 | |||
602 | `And has thou slain the Jabberwock? | ||
603 | Come to my arms, my beamish boy! | ||
604 | O frabjous day! Calloh! Callay! | ||
605 | He chortled in his joy. | ||
606 | |||
607 | `Twas brillig, and the slithy toves | ||
608 | Did gyre and gimble in the wabe; | ||
609 | All mimsy were the borogoves, | ||
610 | And the mome raths outgrabe. | ||
611 | |||
612 | |||
613 | --BOUNDARY-1 | ||
614 | Content-Type: message/rfc822 | ||
615 | |||
616 | Received: (from bar@dontmailme.org) | ||
617 | by dontmailme.org id fERKR9N16790 | ||
618 | for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200 | ||
619 | Date: Fri, 28 Dec 2001 23:28:08 +0200 | ||
620 | From: Bar <bar@dontmailme.org> | ||
621 | To: Foo Bar <foobar@nonexistent.net> | ||
622 | Message-Id: <200112232808.fERKR9N16790@dontmailme.org> | ||
623 | Subject: Re: Jabberwocky | ||
624 | X-Envelope-Date: Fri Dec 28 23:28:09 2001 | ||
625 | X-Envelope-Sender: bar@dontmailme.org | ||
626 | |||
627 | It seems very pretty, but it's *rather* hard to understand!' | ||
628 | Somehow it seems to fill my head with ideas -- only I don't | ||
629 | exactly know what they are! However, SOMEBODY killed SOMETHING: | ||
630 | that's clear, at any rate... | ||
631 | |||
632 | --BOUNDARY-1 | ||
633 | Content-Type: message/rfc822 | ||
634 | |||
635 | Organization: Mailutils-tests | ||
636 | Received: from example.net (localhost [[127.0.0.1]]) | ||
637 | by example.net with ESMTP id g6CLhIb05086 | ||
638 | for <gray@example.net>; Sat, 13 Jul 2002 00:43:18 +0300 | ||
639 | Message-Id: <200207122143.g6CLhIb05086@example.net> | ||
640 | To: Foo Bar <foobar@nonexistent.net> | ||
641 | Subject: Empty MIME Parts | ||
642 | MIME-Version: 1.0 | ||
643 | Content-Type: multipart/mixed; boundary="BOUNDARY-2" | ||
644 | Content-ID: 1 | ||
645 | Date: Sat, 13 Jul 2002 00:43:18 +0300 | ||
646 | From: Sergey Poznyakoff <gray@example.net> | ||
647 | X-Envelope-Date: Sat Jul 13 00:43:18 2002 | ||
648 | X-Envelope-Sender: gray@example.net | ||
649 | |||
650 | --BOUNDARY-2 | ||
651 | Content-Type: text/plain; name="empty"; charset="us-ascii" | ||
652 | Content-ID: 2 | ||
653 | Content-Description: Empty part | ||
654 | |||
655 | |||
656 | --BOUNDARY-2 | ||
657 | Content-Type: text/plain; name="single.line"; charset="us-ascii" | ||
658 | Content-ID: 3 | ||
659 | Content-Description: Single line part | ||
660 | |||
661 | |||
662 | |||
663 | --BOUNDARY-2-- | ||
664 | |||
665 | --BOUNDARY-1-- | ||
666 | |||
667 | ]) | ||
668 | |||
669 | MH_CHECK([mhn-compose: forward (current folder)], | ||
670 | [mhn22 mhn-compose mhn-compose-06],[ | ||
671 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | ||
672 | echo "Current-Folder: inbox" > Mail/context | ||
673 | AT_DATA([input], | ||
674 | [From: gray@example.net | ||
675 | Subject: Forwards | ||
676 | ------ | ||
677 | #forw [forwarded messages] 1 2 5 | ||
678 | ]) | ||
679 | |||
680 | mhn -build ./input || exit $? | ||
681 | mimeflt input | ||
682 | ], | ||
683 | [0], | ||
684 | [From: gray@example.net | ||
685 | Subject: Forwards | ||
686 | Content-Description: forwarded messages | ||
687 | Content-Type: multipart/digest; boundary="BOUNDARY-1" | ||
688 | MIME-Version: 1.0 | ||
689 | |||
690 | --BOUNDARY-1 | ||
691 | Content-Type: message/rfc822 | ||
692 | |||
693 | Received: (from foobar@nonexistent.net) | ||
694 | by nonexistent.net id fBSKI8N04906 | ||
695 | for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200 | ||
696 | Date: Fri, 28 Dec 2001 22:18:08 +0200 | ||
697 | From: Foo Bar <foobar@nonexistent.net> | ||
698 | Message-Id: <200112282018.fBSKI8N04906@nonexistent.net> | ||
699 | To: Bar <bar@dontmailme.org> | ||
700 | Subject: Jabberwocky | ||
701 | X-Envelope-Date: Fri Dec 28 22:18:09 2001 | ||
702 | X-Envelope-Sender: foobar@nonexistent.net | ||
703 | |||
704 | `Twas brillig, and the slithy toves | ||
705 | Did gyre and gimble in the wabe; | ||
706 | All mimsy were the borogoves, | ||
707 | And the mome raths outgrabe. | ||
708 | |||
709 | `Beware the Jabberwock, my son! | ||
710 | The jaws that bite, the claws that catch! | ||
711 | Beware the Jujub bird, and shun | ||
712 | The frumious Bandersnatch!' | ||
713 | |||
714 | He took his vorpal sword in hand: | ||
715 | Long time the manxome foe he sought -- | ||
716 | So rested he by the Tumtum gree, | ||
717 | And stood awhile in thought. | ||
718 | |||
719 | And as in uffish thought he stood, | ||
720 | The Jabberwock, with eyes of flame, | ||
721 | Came whiffling through the tulgey wook, | ||
722 | And burbled as it came! | ||
723 | |||
724 | One, two! One, two! And through and through | ||
725 | The vorpal blade went snicker-snack! | ||
726 | He left it dead, and with its head | ||
727 | He went galumphing back. | ||
728 | |||
729 | `And has thou slain the Jabberwock? | ||
730 | Come to my arms, my beamish boy! | ||
731 | O frabjous day! Calloh! Callay! | ||
732 | He chortled in his joy. | ||
733 | |||
734 | `Twas brillig, and the slithy toves | ||
735 | Did gyre and gimble in the wabe; | ||
736 | All mimsy were the borogoves, | ||
737 | And the mome raths outgrabe. | ||
738 | |||
739 | |||
740 | --BOUNDARY-1 | ||
741 | Content-Type: message/rfc822 | ||
742 | |||
743 | Received: (from bar@dontmailme.org) | ||
744 | by dontmailme.org id fERKR9N16790 | ||
745 | for foobar@nonexistent.net; Fri, 28 Dec 2001 22:18:08 +0200 | ||
746 | Date: Fri, 28 Dec 2001 23:28:08 +0200 | ||
747 | From: Bar <bar@dontmailme.org> | ||
748 | To: Foo Bar <foobar@nonexistent.net> | ||
749 | Message-Id: <200112232808.fERKR9N16790@dontmailme.org> | ||
750 | Subject: Re: Jabberwocky | ||
751 | X-Envelope-Date: Fri Dec 28 23:28:09 2001 | ||
752 | X-Envelope-Sender: bar@dontmailme.org | ||
753 | |||
754 | It seems very pretty, but it's *rather* hard to understand!' | ||
755 | Somehow it seems to fill my head with ideas -- only I don't | ||
756 | exactly know what they are! However, SOMEBODY killed SOMETHING: | ||
757 | that's clear, at any rate... | ||
758 | |||
759 | --BOUNDARY-1 | ||
760 | Content-Type: message/rfc822 | ||
761 | |||
762 | Organization: Mailutils-tests | ||
763 | Received: from example.net (localhost [[127.0.0.1]]) | ||
764 | by example.net with ESMTP id g6CLhIb05086 | ||
765 | for <gray@example.net>; Sat, 13 Jul 2002 00:43:18 +0300 | ||
766 | Message-Id: <200207122143.g6CLhIb05086@example.net> | ||
767 | To: Foo Bar <foobar@nonexistent.net> | ||
768 | Subject: Empty MIME Parts | ||
769 | MIME-Version: 1.0 | ||
770 | Content-Type: multipart/mixed; boundary="BOUNDARY-2" | ||
771 | Content-ID: 1 | ||
772 | Date: Sat, 13 Jul 2002 00:43:18 +0300 | ||
773 | From: Sergey Poznyakoff <gray@example.net> | ||
774 | X-Envelope-Date: Sat Jul 13 00:43:18 2002 | ||
775 | X-Envelope-Sender: gray@example.net | ||
776 | |||
777 | --BOUNDARY-2 | ||
778 | Content-Type: text/plain; name="empty"; charset="us-ascii" | ||
779 | Content-ID: 2 | ||
780 | Content-Description: Empty part | ||
781 | |||
782 | |||
783 | --BOUNDARY-2 | ||
784 | Content-Type: text/plain; name="single.line"; charset="us-ascii" | ||
785 | Content-ID: 3 | ||
786 | Content-Description: Single line part | ||
787 | |||
788 | |||
789 | |||
790 | --BOUNDARY-2-- | ||
791 | |||
792 | --BOUNDARY-1-- | ||
793 | |||
794 | ]) | ||
795 | |||
796 | MH_CHECK([mhn-compose: forward (single message)], | ||
797 | [mhn23 mhn-compose mhn-compose-07],[ | ||
798 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | ||
799 | AT_DATA([input], | ||
800 | [From: gray@example.net | ||
801 | Subject: Forwards | ||
802 | ------ | ||
803 | #forw [forwarded messages] +inbox 1 | ||
804 | ]) | ||
805 | |||
806 | mhn -build ./input || exit $? | ||
807 | mimeflt input | ||
808 | ], | ||
809 | [0], | ||
810 | [From: gray@example.net | ||
811 | Subject: Forwards | ||
812 | Content-Description: forwarded messages | ||
813 | Content-Type: message/rfc822 | ||
814 | MIME-Version: 1.0 | ||
815 | |||
816 | Received: (from foobar@nonexistent.net) | ||
817 | by nonexistent.net id fBSKI8N04906 | ||
818 | for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200 | ||
819 | Date: Fri, 28 Dec 2001 22:18:08 +0200 | ||
820 | From: Foo Bar <foobar@nonexistent.net> | ||
821 | Message-Id: <200112282018.fBSKI8N04906@nonexistent.net> | ||
822 | To: Bar <bar@dontmailme.org> | ||
823 | Subject: Jabberwocky | ||
824 | X-Envelope-Date: Fri Dec 28 22:18:09 2001 | ||
825 | X-Envelope-Sender: foobar@nonexistent.net | ||
826 | |||
827 | `Twas brillig, and the slithy toves | ||
828 | Did gyre and gimble in the wabe; | ||
829 | All mimsy were the borogoves, | ||
830 | And the mome raths outgrabe. | ||
831 | |||
832 | `Beware the Jabberwock, my son! | ||
833 | The jaws that bite, the claws that catch! | ||
834 | Beware the Jujub bird, and shun | ||
835 | The frumious Bandersnatch!' | ||
836 | |||
837 | He took his vorpal sword in hand: | ||
838 | Long time the manxome foe he sought -- | ||
839 | So rested he by the Tumtum gree, | ||
840 | And stood awhile in thought. | ||
841 | |||
842 | And as in uffish thought he stood, | ||
843 | The Jabberwock, with eyes of flame, | ||
844 | Came whiffling through the tulgey wook, | ||
845 | And burbled as it came! | ||
846 | |||
847 | One, two! One, two! And through and through | ||
848 | The vorpal blade went snicker-snack! | ||
849 | He left it dead, and with its head | ||
850 | He went galumphing back. | ||
851 | |||
852 | `And has thou slain the Jabberwock? | ||
853 | Come to my arms, my beamish boy! | ||
854 | O frabjous day! Calloh! Callay! | ||
855 | He chortled in his joy. | ||
856 | |||
857 | `Twas brillig, and the slithy toves | ||
858 | Did gyre and gimble in the wabe; | ||
859 | All mimsy were the borogoves, | ||
860 | And the mome raths outgrabe. | ||
861 | |||
862 | |||
863 | |||
864 | ]) | ||
865 | |||
866 | MH_CHECK([mhn-compose: external data], | ||
867 | [mhn24 mhn-compose mhn-compose-08],[ | ||
868 | AT_DATA([input], | ||
869 | [From: gray@example.net | ||
870 | Subject: External data | ||
871 | ------ | ||
872 | #@application/octet-stream; \ | ||
873 | type=tar; \ | ||
874 | conversions=compress \ | ||
875 | [[GNU Mailutils distribution]] \ | ||
876 | name="mailutils-3.0.tar.gz"; \ | ||
877 | directory="/gnu/mailutils"; \ | ||
878 | site="ftp.gnu.org"; \ | ||
879 | access-type=anon-ftp; \ | ||
880 | mode="image" | ||
881 | ]) | ||
882 | mhn -build ./input || exit $? | ||
883 | mimeflt input | ||
884 | ], | ||
885 | [0], | ||
886 | [From: gray@example.net | ||
887 | Subject: External data | ||
888 | Content-Type: message/external-body; name="mailutils-3.0.tar.gz"; directory="/gnu/mailutils"; site="ftp.gnu.org"; access-type=anon-ftp; mode="image" | ||
889 | MIME-Version: 1.0 | ||
890 | |||
891 | Content-Description: GNU Mailutils distribution | ||
892 | Content-ID: 1 | ||
893 | Content-Type: application/octet-stream; type=tar; conversions=compress | ||
894 | |||
895 | |||
896 | ]) | ||
897 | |||
898 | |||
899 | MH_CHECK([mhn-compose: multipart], | ||
900 | [mhn25 mhn-compose mhn-compose-09],[ | ||
901 | |||
902 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail]) | ||
903 | |||
904 | AT_DATA([foo.tar], | ||
905 | [Not a tarball, really | ||
906 | ]) | ||
907 | |||
908 | AT_DATA([input], | ||
909 | [From: gray@example.net | ||
910 | Subject: Multipart | ||
911 | ------ | ||
912 | Initial text part. | ||
913 | |||
914 | #begin [Multipart message] mixed | ||
915 | #forw [forwarded message] +mbox1 1 | ||
916 | Plain text 1 | ||
917 | #<text/x-special | ||
918 | Plain text 2 | ||
919 | #application/octet-stream; type=tar [Tar archive] ./foo.tar | ||
920 | #end | ||
921 | ]) | ||
922 | |||
923 | mhn -build ./input || exit $? | ||
924 | mimeflt input | ||
925 | ], | ||
926 | [0], | ||
927 | [From: gray@example.net | ||
928 | Subject: Multipart | ||
929 | Content-Type: multipart/mixed; boundary="BOUNDARY-1" | ||
930 | MIME-Version: 1.0 | ||
931 | |||
932 | --BOUNDARY-1 | ||
933 | Content-ID: 1 | ||
934 | Content-Type: text/plain | ||
935 | |||
936 | Initial text part. | ||
937 | |||
938 | |||
939 | --BOUNDARY-1 | ||
940 | Content-Type: multipart/mixed; boundary="BOUNDARY-2" | ||
941 | MIME-Version: 1.0 | ||
942 | |||
943 | --BOUNDARY-2 | ||
944 | Content-Description: forwarded message | ||
945 | Content-ID: 2 | ||
946 | Content-Type: message/rfc822 | ||
947 | MIME-Version: 1.0 | ||
948 | |||
949 | Received: (from foobar@nonexistent.net) | ||
950 | by nonexistent.net id fBSKI8N04906 | ||
951 | for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200 | ||
952 | Date: Fri, 28 Dec 2001 22:18:08 +0200 | ||
953 | From: Foo Bar <foobar@nonexistent.net> | ||
954 | Message-Id: <200112282018.fBSKI8N04906@nonexistent.net> | ||
955 | To: Bar <bar@dontmailme.org> | ||
956 | Subject: Jabberwocky | ||
957 | X-Envelope-Date: Fri Dec 28 22:18:09 2001 | ||
958 | X-Envelope-Sender: foobar@nonexistent.net | ||
959 | |||
960 | `Twas brillig, and the slithy toves | ||
961 | Did gyre and gimble in the wabe; | ||
962 | All mimsy were the borogoves, | ||
963 | And the mome raths outgrabe. | ||
964 | |||
965 | `Beware the Jabberwock, my son! | ||
966 | The jaws that bite, the claws that catch! | ||
967 | Beware the Jujub bird, and shun | ||
968 | The frumious Bandersnatch!' | ||
969 | |||
970 | He took his vorpal sword in hand: | ||
971 | Long time the manxome foe he sought -- | ||
972 | So rested he by the Tumtum gree, | ||
973 | And stood awhile in thought. | ||
974 | |||
975 | And as in uffish thought he stood, | ||
976 | The Jabberwock, with eyes of flame, | ||
977 | Came whiffling through the tulgey wook, | ||
978 | And burbled as it came! | ||
979 | |||
980 | One, two! One, two! And through and through | ||
981 | The vorpal blade went snicker-snack! | ||
982 | He left it dead, and with its head | ||
983 | He went galumphing back. | ||
984 | |||
985 | `And has thou slain the Jabberwock? | ||
986 | Come to my arms, my beamish boy! | ||
987 | O frabjous day! Calloh! Callay! | ||
988 | He chortled in his joy. | ||
989 | |||
990 | `Twas brillig, and the slithy toves | ||
991 | Did gyre and gimble in the wabe; | ||
992 | All mimsy were the borogoves, | ||
993 | And the mome raths outgrabe. | ||
994 | |||
995 | |||
996 | |||
997 | --BOUNDARY-2 | ||
998 | Content-ID: 3 | ||
999 | Content-Type: text/plain | ||
1000 | |||
1001 | Plain text 1 | ||
1002 | |||
1003 | --BOUNDARY-2 | ||
1004 | Content-ID: 4 | ||
1005 | Content-Type: text/x-special | ||
1006 | |||
1007 | Plain text 2 | ||
1008 | |||
1009 | --BOUNDARY-2 | ||
1010 | Content-Transfer-Encoding: base64 | ||
1011 | Content-Description: Tar archive | ||
1012 | Content-ID: 5 | ||
1013 | Content-Type: application/octet-stream; type=tar | ||
1014 | |||
1015 | Tm90IGEgdGFyYmFsbCwgcmVhbGx5Cg== | ||
1016 | --BOUNDARY-2-- | ||
1017 | |||
1018 | --BOUNDARY-1-- | ||
1019 | ]) | ||
415 | 1020 | ||
416 | m4_popdef[MH_KEYWORDS]) | 1021 | m4_popdef[MH_KEYWORDS]) |
417 | # End of mhn.at | 1022 | # End of mhn.at |
1023 | |||
1024 | # Local Variables: | ||
1025 | # coding: utf-8 | ||
1026 | # End: | ... | ... |
-
Please register or sign in to post a comment