Commit 39160956 39160956df0ea814c08af4d60adb3bac63bd41f7 by Sergey Poznyakoff

mh: improve forw; add tests.

* mh/forw.c (options): New option --file.
(input_file): New variable.
(opt_handler): Handle --file.
(finish_draft): Remove a leftover path hack.
Implement raw file forwarding.
(main): Minor fix.
* mh/mh_getopt.c (mh_option_init): Limit match_len to the actual
length of the option string.

* mh/tests/forw.at: New file.
* mh/tests/Makefile.am (TESTSUITE_AT): Add forw.at.
* mh/tests/testsuite.at: Include forw.at.
* mh/tests/comp.at: Add more keywords.
1 parent 46b844cf
...@@ -42,6 +42,8 @@ static struct argp_option options[] = { ...@@ -42,6 +42,8 @@ static struct argp_option options[] = {
42 N_("set the editor program to use")}, 42 N_("set the editor program to use")},
43 {"noedit", ARG_NOEDIT, 0, 0, 43 {"noedit", ARG_NOEDIT, 0, 0,
44 N_("suppress the initial edit")}, 44 N_("suppress the initial edit")},
45 {"file", ARG_FILE, N_("FILE"), 0,
46 N_("read message from FILE")},
45 {"format", ARG_FORMAT, N_("BOOL"), 0, 47 {"format", ARG_FORMAT, N_("BOOL"), 0,
46 N_("format messages")}, 48 N_("format messages")},
47 {"noformat", ARG_NOFORMAT, NULL, 0, 49 {"noformat", ARG_NOFORMAT, NULL, 0,
...@@ -74,26 +76,28 @@ static struct argp_option options[] = { ...@@ -74,26 +76,28 @@ static struct argp_option options[] = {
74 struct mh_option mh_option[] = { 76 struct mh_option mh_option[] = {
75 { "annotate", MH_OPT_BOOL }, 77 { "annotate", MH_OPT_BOOL },
76 { "build" }, 78 { "build" },
77 { "form", MH_OPT_ARG, "formatfile"}, 79 { "file", MH_OPT_ARG, "msgfile" },
78 { "format", MH_OPT_ARG, "string"}, 80 { "form", MH_OPT_ARG, "formatfile" },
79 { "draftfolder", MH_OPT_ARG, "folder"}, 81 { "format", MH_OPT_ARG, "string" },
82 { "draftfolder", MH_OPT_ARG, "folder" },
80 { "nodraftfolder" }, 83 { "nodraftfolder" },
81 { "draftmessage" }, 84 { "draftmessage" },
82 { "editor", MH_OPT_ARG, "program"}, 85 { "editor", MH_OPT_ARG, "program" },
83 { "noedit" }, 86 { "noedit" },
84 { "filter", MH_OPT_ARG, "program"}, 87 { "filter", MH_OPT_ARG, "program" },
85 { "inplace", MH_OPT_BOOL }, 88 { "inplace", MH_OPT_BOOL },
86 { "whatnowproc", MH_OPT_ARG, "program"}, 89 { "whatnowproc", MH_OPT_ARG, "program" },
87 { "nowhatnowproc" }, 90 { "nowhatnowproc" },
88 { "mime", MH_OPT_BOOL }, 91 { "mime", MH_OPT_BOOL },
89 { NULL } 92 { NULL }
90 }; 93 };
91 94
92 enum encap_type { 95 enum encap_type
96 {
93 encap_clear, 97 encap_clear,
94 encap_mhl, 98 encap_mhl,
95 encap_mime 99 encap_mime
96 }; 100 };
97 101
98 static char *formfile; 102 static char *formfile;
99 struct mh_whatnow_env wh_env = { 0 }; 103 struct mh_whatnow_env wh_env = { 0 };
...@@ -108,6 +112,7 @@ static int use_draft = 0; /* --use flag */ ...@@ -108,6 +112,7 @@ static int use_draft = 0; /* --use flag */
108 static int width = 80; /* --width flag */ 112 static int width = 80; /* --width flag */
109 static char *draftmessage = "new"; 113 static char *draftmessage = "new";
110 static const char *draftfolder = NULL; 114 static const char *draftfolder = NULL;
115 static char *input_file; /* input file name (--file option) */
111 116
112 static mh_msgset_t msgset; 117 static mh_msgset_t msgset;
113 static mu_mailbox_t mbox; 118 static mu_mailbox_t mbox;
...@@ -118,8 +123,7 @@ opt_handler (int key, char *arg, struct argp_state *state) ...@@ -118,8 +123,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
118 switch (key) 123 switch (key)
119 { 124 {
120 case ARGP_KEY_INIT: 125 case ARGP_KEY_INIT:
121 draftfolder = mh_global_profile_get ("Draft-Folder", 126 draftfolder = mh_global_profile_get ("Draft-Folder", NULL);
122 mu_folder_directory ());
123 whatnowproc = mh_global_profile_get ("whatnowproc", NULL); 127 whatnowproc = mh_global_profile_get ("whatnowproc", NULL);
124 break; 128 break;
125 129
...@@ -131,6 +135,10 @@ opt_handler (int key, char *arg, struct argp_state *state) ...@@ -131,6 +135,10 @@ opt_handler (int key, char *arg, struct argp_state *state)
131 build_only = 1; 135 build_only = 1;
132 break; 136 break;
133 137
138 case ARG_FILE:
139 input_file = arg;
140 break;
141
134 case ARG_DRAFTFOLDER: 142 case ARG_DRAFTFOLDER:
135 draftfolder = arg; 143 draftfolder = arg;
136 break; 144 break;
...@@ -218,7 +226,8 @@ opt_handler (int key, char *arg, struct argp_state *state) ...@@ -218,7 +226,8 @@ opt_handler (int key, char *arg, struct argp_state *state)
218 return 0; 226 return 0;
219 } 227 }
220 228
221 struct format_data { 229 struct format_data
230 {
222 int num; 231 int num;
223 mu_stream_t stream; 232 mu_stream_t stream;
224 mu_list_t format; 233 mu_list_t format;
...@@ -286,26 +295,41 @@ msg_copy (mu_message_t msg, mu_stream_t ostream) ...@@ -286,26 +295,41 @@ msg_copy (mu_message_t msg, mu_stream_t ostream)
286 } 295 }
287 296
288 void 297 void
289 format_message (mu_mailbox_t mbox, mu_message_t msg, size_t num, void *data) 298 format_message (mu_stream_t outstr, mu_message_t msg, int num,
299 mu_list_t format)
290 { 300 {
291 struct format_data *fp = data; 301 int rc = 0;
292 char *s;
293 int rc;
294 302
295 if (annotate) 303 if (annotate)
296 mu_list_append (wh_env.anno_list, msg); 304 mu_list_append (wh_env.anno_list, msg);
297 305
298 if (fp->num) 306 if (num)
307 rc = mu_stream_printf (outstr, "\n------- Message %d\n", num);
308
309 if (rc == 0)
299 { 310 {
300 mu_asprintf (&s, "\n------- Message %d\n", fp->num++); 311 if (format)
301 rc = mu_stream_write (fp->stream, s, strlen (s), NULL); 312 rc = mhl_format_run (format, width, 0, 0, msg, outstr);
302 free (s); 313 else
314 rc = msg_copy (msg, outstr);
303 } 315 }
304 316
305 if (fp->format) 317 if (rc)
306 rc = mhl_format_run (fp->format, width, 0, 0, msg, fp->stream); 318 {
307 else 319 mu_error (_("cannot copy message: %s"), mu_strerror (rc));
308 rc = msg_copy (msg, fp->stream); 320 exit (1);
321 }
322 }
323
324 void
325 format_message_itr (mu_mailbox_t mbox MU_ARG_UNUSED,
326 mu_message_t msg, size_t num, void *data)
327 {
328 struct format_data *fp = data;
329
330 format_message (fp->stream, msg, fp->num, fp->format);
331 if (fp->num)
332 fp->num++;
309 } 333 }
310 334
311 void 335 void
...@@ -317,6 +341,46 @@ finish_draft () ...@@ -317,6 +341,46 @@ finish_draft ()
317 struct format_data fd; 341 struct format_data fd;
318 char *str; 342 char *str;
319 343
344 if ((rc = mu_file_stream_create (&stream,
345 wh_env.file,
346 MU_STREAM_WRITE|MU_STREAM_CREAT)))
347 {
348 mu_error (_("cannot open output file `%s': %s"),
349 wh_env.file, mu_strerror (rc));
350 exit (1);
351 }
352
353 mu_stream_seek (stream, 0, SEEK_END, NULL);
354
355 if (input_file)
356 {
357 mu_stream_t instr;
358 int rc;
359
360 if ((rc = mu_file_stream_create (&stream,
361 wh_env.file,
362 MU_STREAM_WRITE|MU_STREAM_CREAT)))
363 {
364 mu_error (_("cannot open output file `%s': %s"),
365 wh_env.file, mu_strerror (rc));
366 exit (1);
367 }
368
369 mu_stream_seek (stream, 0, SEEK_END, NULL);
370
371 rc = mu_file_stream_create (&instr, input_file, MU_STREAM_READ);
372 if (rc)
373 {
374 mu_diag_funcall (MU_DIAG_ERROR, "mu_file_stream_create",
375 input_file, rc);
376 exit (1);
377 }
378
379 rc = mu_stream_copy (stream, instr, 0, NULL);
380 mu_stream_unref (instr);
381 }
382 else
383 {
320 if (!mhl_filter) 384 if (!mhl_filter)
321 { 385 {
322 char *s = mh_expand_name (MHLIBDIR, "mhl.forward", 0); 386 char *s = mh_expand_name (MHLIBDIR, "mhl.forward", 0);
...@@ -334,17 +398,6 @@ finish_draft () ...@@ -334,17 +398,6 @@ finish_draft ()
334 free (s); 398 free (s);
335 } 399 }
336 400
337 if ((rc = mu_file_stream_create (&stream,
338 wh_env.file,
339 MU_STREAM_WRITE|MU_STREAM_CREAT)))
340 {
341 mu_error (_("cannot open output file `%s': %s"),
342 wh_env.file, mu_strerror (rc));
343 exit (1);
344 }
345
346 mu_stream_seek (stream, 0, SEEK_END, NULL);
347
348 if (annotate) 401 if (annotate)
349 { 402 {
350 wh_env.anno_field = "Forwarded"; 403 wh_env.anno_field = "Forwarded";
...@@ -359,10 +412,7 @@ finish_draft () ...@@ -359,10 +412,7 @@ finish_draft ()
359 size_t i; 412 size_t i;
360 413
361 mu_mailbox_get_url (mbox, &url); 414 mu_mailbox_get_url (mbox, &url);
362 415 mu_url_sget_path (url, &mbox_path);
363 mbox_path = mu_url_to_string (url);
364 if (memcmp (mbox_path, "mh:", 3) == 0)
365 mbox_path += 3;
366 mu_asprintf (&str, "#forw [] +%s", mbox_path); 416 mu_asprintf (&str, "#forw [] +%s", mbox_path);
367 rc = mu_stream_write (stream, str, strlen (str), NULL); 417 rc = mu_stream_write (stream, str, strlen (str), NULL);
368 free (str); 418 free (str);
...@@ -376,6 +426,9 @@ finish_draft () ...@@ -376,6 +426,9 @@ finish_draft ()
376 mu_list_append (wh_env.anno_list, msg); 426 mu_list_append (wh_env.anno_list, msg);
377 mh_message_number (msg, &num); 427 mh_message_number (msg, &num);
378 p = mu_umaxtostr (0, num); 428 p = mu_umaxtostr (0, num);
429 rc = mu_stream_write (stream, " ", 1, NULL);
430 if (rc)
431 break;
379 rc = mu_stream_write (stream, p, strlen (p), NULL); 432 rc = mu_stream_write (stream, p, strlen (p), NULL);
380 } 433 }
381 } 434 }
...@@ -398,7 +451,7 @@ finish_draft () ...@@ -398,7 +451,7 @@ finish_draft ()
398 rc = mu_stream_write (stream, str, strlen (str), NULL); 451 rc = mu_stream_write (stream, str, strlen (str), NULL);
399 fd.stream = stream; 452 fd.stream = stream;
400 fd.format = format; 453 fd.format = format;
401 rc = mh_iterate (mbox, &msgset, format_message, &fd); 454 rc = mh_iterate (mbox, &msgset, format_message_itr, &fd);
402 455
403 str = "\n------- "; 456 str = "\n------- ";
404 rc = mu_stream_write (stream, str, strlen (str), NULL); 457 rc = mu_stream_write (stream, str, strlen (str), NULL);
...@@ -412,6 +465,7 @@ finish_draft () ...@@ -412,6 +465,7 @@ finish_draft ()
412 } 465 }
413 466
414 rc = mu_stream_write (stream, "\n\n", 2, NULL); 467 rc = mu_stream_write (stream, "\n\n", 2, NULL);
468 }
415 mu_stream_close (stream); 469 mu_stream_close (stream);
416 mu_stream_destroy (&stream); 470 mu_stream_destroy (&stream);
417 } 471 }
...@@ -431,14 +485,30 @@ main (int argc, char **argv) ...@@ -431,14 +485,30 @@ main (int argc, char **argv)
431 argc -= index; 485 argc -= index;
432 argv += index; 486 argv += index;
433 487
488 if (input_file)
489 {
490 if (encap == encap_mime)
491 {
492 mu_error (_("--build disables --mime"));
493 encap = encap_clear;
494 }
495 if (argc)
496 {
497 mu_error (_("can't mix files and folders/msgs"));
498 exit (1);
499 }
500 }
501 else
502 {
434 mbox = mh_open_folder (mh_current_folder (), 0); 503 mbox = mh_open_folder (mh_current_folder (), 0);
435 mh_msgset_parse (mbox, &msgset, argc, argv, "cur"); 504 mh_msgset_parse (mbox, &msgset, argc, argv, "cur");
505 }
436 506
437 if (build_only || !draftfolder) 507 if (build_only || !draftfolder)
438 wh_env.file = mh_expand_name (NULL, "draft", 0); 508 wh_env.file = mh_expand_name (NULL, "draft", 0);
439 else 509 else if (draftfolder)
440 { 510 {
441 if (mh_draft_message (NULL, draftmessage, &wh_env.file)) 511 if (mh_draft_message (draftfolder, draftmessage, &wh_env.file))
442 return 1; 512 return 1;
443 } 513 }
444 wh_env.draftfile = wh_env.file; 514 wh_env.draftfile = wh_env.file;
......
...@@ -187,6 +187,7 @@ mh_option_init (struct mh_option *opt) ...@@ -187,6 +187,7 @@ mh_option_init (struct mh_option *opt)
187 do 187 do
188 { 188 {
189 minlen++; 189 minlen++;
190 if (minlen <= strlen (opt[j].opt))
190 opt[j].match_len = minlen; 191 opt[j].match_len = minlen;
191 if (minlen == sample_len) 192 if (minlen == sample_len)
192 break; 193 break;
...@@ -197,6 +198,7 @@ mh_option_init (struct mh_option *opt) ...@@ -197,6 +198,7 @@ mh_option_init (struct mh_option *opt)
197 else 198 else
198 break; 199 break;
199 } 200 }
201 if (minlen <= sample_len)
200 opt[i].match_len = minlen; 202 opt[i].match_len = minlen;
201 } 203 }
202 } 204 }
......
...@@ -44,6 +44,7 @@ TESTSUITE_AT = \ ...@@ -44,6 +44,7 @@ TESTSUITE_AT = \
44 burst.at\ 44 burst.at\
45 comp.at\ 45 comp.at\
46 folder.at\ 46 folder.at\
47 forw.at\
47 inc.at\ 48 inc.at\
48 install-mh.at\ 49 install-mh.at\
49 mark.at\ 50 mark.at\
......
...@@ -143,7 +143,7 @@ Subject: test input ...@@ -143,7 +143,7 @@ Subject: test input
143 message body 143 message body
144 ]) 144 ])
145 145
146 MH_CHECK([comp -draftfolder],[comp05 comp-draftfolder],[ 146 MH_CHECK([comp -draftfolder],[comp05 comp-draftfolder draftfolder],[
147 mkdir Mail/drafts 147 mkdir Mail/drafts
148 dir=`pwd` 148 dir=`pwd`
149 echo 'quit' | compcmd -draftfolder drafts | sed "s|$dir/*||;s| *$||" 149 echo 'quit' | compcmd -draftfolder drafts | sed "s|$dir/*||;s| *$||"
...@@ -165,7 +165,7 @@ Subject: ...@@ -165,7 +165,7 @@ Subject:
165 Seen by mhed 165 Seen by mhed
166 ]) 166 ])
167 167
168 MH_CHECK([comp +draftfolder -use],[comp06 comp-draftfolder-use],[ 168 MH_CHECK([comp +draftfolder -use],[comp06 comp-draftfolder-use draftfolder],[
169 mkdir Mail/drafts 169 mkdir Mail/drafts
170 AT_DATA([Mail/drafts/1],[From: gray 170 AT_DATA([Mail/drafts/1],[From: gray
171 To: root 171 To: root
...@@ -201,3 +201,4 @@ Seen by mhed ...@@ -201,3 +201,4 @@ Seen by mhed
201 m4_popdef([compcmd]) 201 m4_popdef([compcmd])
202 m4_popdef([MH_KEYWORDS]) 202 m4_popdef([MH_KEYWORDS])
203 203
204 # End of comp.at
......
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # GNU Mailutils is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16
17 m4_pushdef([MH_KEYWORDS],[forw])
18 m4_pushdef([forwcmd],[forw dnl
19 -form $abs_top_srcdir/mh/components dnl
20 -editor $abs_top_srcdir/mh/tests/mhed])
21
22 MH_CHECK([forw msg],[forw00 forw-msg],[
23 mkdir Mail/inbox
24 AT_DATA([Mail/inbox/1],[From: gray
25 To: root
26 Subject: test input
27
28 message body
29 ])
30
31 dir=`pwd`
32 echo quit | forwcmd +inbox 1 | sed "s|$dir/*||;s| *$||"
33 echo == Mail/draft ==
34 cat Mail/draft
35 echo == Message ==
36 # FIXME: AMD adds this header to the first message. Find a better way.
37 # See also the same sed hacks below.
38 sed '/^X-IMAPbase/d' Mail/inbox/1
39 ],
40 [0],
41 [-- Editor invocation: Mail/draft
42 -- Input file:
43 To:
44 cc:
45 Subject:
46 --------
47
48 ------- Forwarded message
49 From: gray
50 To: root
51 Subject: test input
52
53 message body
54
55 ------- End of Forwarded message
56
57 -- Input file end
58 What now? draft left on "Mail/draft".
59 == Mail/draft ==
60 To:
61 cc:
62 Subject:
63 --------
64
65 ------- Forwarded message
66 From: gray
67 To: root
68 Subject: test input
69
70 message body
71
72 ------- End of Forwarded message
73
74 Seen by mhed
75 == Message ==
76 From: gray
77 To: root
78 Subject: test input
79
80 message body
81 ])
82
83 MH_CHECK([forw msgs],[forw01 forw-msgs],[
84 mkdir Mail/inbox
85 AT_DATA([Mail/inbox/1],[From: gray
86 To: root
87 Subject: test input
88
89 message body
90 ])
91 AT_DATA([Mail/inbox/2],[From: gray
92 To: marlow
93 Subject: 2nd message
94
95 2nd message body
96 ])
97
98 dir=`pwd`
99 echo quit | forwcmd +inbox 1 2 | sed "s|$dir/*||;s| *$||"
100 echo == Mail/draft ==
101 cat Mail/draft
102 echo == Message 1 ==
103 sed '/^X-IMAPbase/d' Mail/inbox/1
104 echo == Message 2 ==
105 cat Mail/inbox/2
106 ],
107 [0],
108 [-- Editor invocation: Mail/draft
109 -- Input file:
110 To:
111 cc:
112 Subject:
113 --------
114
115 ------- Forwarded messages
116
117 ------- Message 1
118 From: gray
119 To: root
120 Subject: test input
121
122 message body
123
124 ------- Message 2
125 From: gray
126 To: marlow
127 Subject: 2nd message
128
129 2nd message body
130
131 ------- End of Forwarded messages
132
133 -- Input file end
134 What now? draft left on "Mail/draft".
135 == Mail/draft ==
136 To:
137 cc:
138 Subject:
139 --------
140
141 ------- Forwarded messages
142
143 ------- Message 1
144 From: gray
145 To: root
146 Subject: test input
147
148 message body
149
150 ------- Message 2
151 From: gray
152 To: marlow
153 Subject: 2nd message
154
155 2nd message body
156
157 ------- End of Forwarded messages
158
159 Seen by mhed
160 == Message 1 ==
161 From: gray
162 To: root
163 Subject: test input
164
165 message body
166 == Message 2 ==
167 From: gray
168 To: marlow
169 Subject: 2nd message
170
171 2nd message body
172 ])
173
174 MH_CHECK([forw -build msg],[forw02 forw-build-msg],[
175 mkdir Mail/inbox
176 AT_DATA([Mail/inbox/1],[From: gray
177 To: root
178 Subject: test input
179
180 message body
181 ])
182
183 dir=`pwd`
184 forwcmd -build +inbox 1 | sed "s|$dir/*||;s| *$||"
185 echo == Mail/draft ==
186 cat Mail/draft
187 echo == Message ==
188 sed '/^X-IMAPbase/d' Mail/inbox/1
189 ],
190 [0],
191 [== Mail/draft ==
192 To:
193 cc:
194 Subject:
195 --------
196
197 ------- Forwarded message
198 From: gray
199 To: root
200 Subject: test input
201
202 message body
203
204 ------- End of Forwarded message
205
206 == Message ==
207 From: gray
208 To: root
209 Subject: test input
210
211 message body
212 ])
213
214 MH_CHECK([forw -build -mime msgs],[forw03 forw-build-mime-msg],[
215 mkdir Mail/inbox
216 AT_DATA([Mail/inbox/1],[From: gray
217 To: root
218 Subject: test input
219
220 message body
221 ])
222 AT_DATA([Mail/inbox/2],[From: gray
223 To: marlow
224 Subject: 2nd message
225
226 2nd message body
227 ])
228
229 dir=`pwd`
230 forwcmd -build -mime +inbox 1 2 | sed "s|$dir/*||;s| *$||"
231 echo == Mail/draft ==
232 sed "s|$dir/*||;s| *$||" Mail/draft
233 echo == Message 1 ==
234 sed '/^X-IMAPbase/d' Mail/inbox/1
235 echo == Message 2 ==
236 cat Mail/inbox/2
237 ],
238 [0],
239 [== Mail/draft ==
240 To:
241 cc:
242 Subject:
243 --------
244 #forw [] +Mail/inbox 1 2
245
246 == Message 1 ==
247 From: gray
248 To: root
249 Subject: test input
250
251 message body
252 == Message 2 ==
253 From: gray
254 To: marlow
255 Subject: 2nd message
256
257 2nd message body
258 ])
259
260 MH_CHECK([forw -draftfolder],[forw04 forw-draftfolder draftfolder],[
261 mkdir Mail/inbox
262 mkdir Mail/drafts
263 AT_DATA([Mail/inbox/1],[From: gray
264 To: root
265 Subject: test input
266
267 message body
268 ])
269
270 echo "quit" | forwcmd -draftfolder drafts 1 | sed "s|$dir/*||;s| *$||"
271 echo == Mail/drafts/1 ==
272 cat Mail/drafts/1
273 echo == Message ==
274 sed '/^X-IMAPbase/d' Mail/inbox/1
275 ],
276 [0],
277 [-- Editor invocation: Mail/drafts/1
278 -- Input file:
279 To:
280 cc:
281 Subject:
282 --------
283
284 ------- Forwarded message
285 From: gray
286 To: root
287 Subject: test input
288
289 message body
290
291 ------- End of Forwarded message
292
293 -- Input file end
294 What now? draft left on "Mail/drafts/1".
295 == Mail/drafts/1 ==
296 To:
297 cc:
298 Subject:
299 --------
300
301 ------- Forwarded message
302 From: gray
303 To: root
304 Subject: test input
305
306 message body
307
308 ------- End of Forwarded message
309
310 Seen by mhed
311 == Message ==
312 From: gray
313 To: root
314 Subject: test input
315
316 message body
317 ])
318
319 MH_CHECK([forw -file],[forw05 forw-file],[
320 AT_DATA([infile],[From: gray
321 To: root
322 Subject: test input
323
324 message body
325 ])
326
327 echo "quit" | forwcmd -file infile | sed "s|$dir/*||;s| *$||"
328 ],
329 [0],
330 [-- Editor invocation: Mail/draft
331 -- Input file:
332 To:
333 cc:
334 Subject:
335 --------
336 From: gray
337 To: root
338 Subject: test input
339
340 message body
341 -- Input file end
342 What now? draft left on "Mail/draft".
343 ])
344
345 m4_popdef([forwcmd])
346 m4_popdef([MH_KEYWORDS])
347
348 # End of forw.at
...@@ -58,3 +58,4 @@ m4_include([anno.at]) ...@@ -58,3 +58,4 @@ m4_include([anno.at])
58 m4_include([pick.at]) 58 m4_include([pick.at])
59 m4_include([burst.at]) 59 m4_include([burst.at])
60 m4_include([comp.at]) 60 m4_include([comp.at])
61 m4_include([forw.at])
......