]>
diplodocus.org Git - nmh/blob - test/repl/test-convert
2 ######################################################
4 # Test repl -convertarg
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"${srcdir}/test/post/test-post-common.sh"
17 expected
="$MH_TEST_DIR/test-convert$$.expected"
18 actual
=`mhpath +`/draft
20 printf 'Local-Mailbox: recipient@example.com' >>"$MH"
23 #### Make sure that this works with 7-bit encoding.
24 LC_ALL
=C
; export LC_ALL
27 # check -convertarg with multiple parts and additional text in draft
28 start_test
'-convertarg with multiple parts and additional text in draft'
29 cat >"$expected" <<'EOF'
30 From: recipient@example.com
31 To: sender@example.com
35 Comments: In-reply-to sender@example.com
36 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
38 Content-Type: text/plain; charset="US-ASCII"
45 cat >`mhpath new` <<'EOF'
46 From: sender@example.com
47 To: recipient@example.com
49 Date: Thu, 11 Dec 2014 08:19:02 -0600
50 Content-Type: multipart/mixed; boundary="_001_"
54 Content-Type: text/plain
59 Content-Type: text/plain
64 Content-Type: text/enriched
66 This should not appear in the reply
67 because the content type isn't matched.
72 repl
-noformat -convertarg text
/plain
'' -nowhatnowproc last
74 check
"$actual" "$expected"
77 #### Make sure that this works with 8-bit encoding.
79 require_locale en_US.UTF
-8 en_US.UTF8 en_US.utf
-8 en_US.utf8
82 # check -convertarg with multiple parts, 7 bit
83 start_test
'-convertarg with multiple parts, 7 bit'
84 cat >"$expected" <<'EOF'
85 From: recipient@example.com
86 To: sender@example.com
90 Comments: In-reply-to sender@example.com
91 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
93 Content-Type: text/plain; charset="UTF-8"
95 sender@example.com writes:
102 cat >`mhpath new` <<'EOF'
103 From: sender@example.com
104 To: recipient@example.com
106 Date: Thu, 11 Dec 2014 08:19:02 -0600
107 Content-Type: multipart/mixed; boundary="_001_"
111 Content-Type: text/plain
116 Content-Type: text/plain; charset="UTF-8"
123 repl
-filter mhl.replywithoutbody
-convertarg text
/plain
'' -nowhatnowproc last
125 check
"$actual" "$expected"
128 # check -convertarg with multiple parts, 8 bit
129 start_test
'-convertarg with multiple parts, 8 bit'
130 cat >"$expected" <<'EOF'
131 From: recipient@example.com
132 To: sender@example.com
136 Comments: In-reply-to sender@example.com
137 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
139 Content-Type: text/plain; charset="UTF-8"
140 Content-Transfer-Encoding: 8bit
142 sender@example.com writes:
146 > This is §2, with a non-ASCII character.
149 cat >`mhpath new` <<'EOF'
150 From: sender@example.com
151 To: recipient@example.com
153 Date: Thu, 11 Dec 2014 08:19:02 -0600
154 Content-Type: multipart/mixed; boundary="_001_"
158 Content-Type: text/plain
163 Content-Type: text/plain; charset="UTF-8"
165 This is §2, with a non-ASCII character.
170 repl
-filter mhl.replywithoutbody
-convertarg text
/plain
'' -nowhatnowproc last
172 check
"$actual" "$expected"
175 # check message with text part in multipart/related
176 start_test
'check message with text part in multipart/related'
177 cat >"$expected" <<'EOF'
178 From: recipient@example.com
179 To: sender@example.com
182 Subject: Re: test with text part in multipart/related
183 Comments: In-reply-to sender@example.com
186 Content-Type: text/plain; charset="UTF-8"
188 sender@example.com writes:
193 cat >`mhpath new` <<'EOF'
194 From: sender@example.com
195 To: recipient@example.com
196 Subject: test with text part in multipart/related
197 Content-Type: multipart/alternative; boundary="_001_"
201 Content-Type: multipart/related; type="text/plain"; boundary="_002_"
204 Content-Type: text/plain; charset="UTF-8"
213 repl
-filter mhl.replywithoutbody
-convertarg text
/plain
'' -nowhatnowproc last
215 check
"$actual" "$expected"
218 # check reply to calendar request
219 start_test
'check reply to calendar request'
220 cat >"$expected" <<'EOF'
221 From: recipient@example.com
222 To: sender@example.com
225 Subject: Re: test iCalendar reply
226 Comments: In-reply-to sender@example.com
229 Content-Type: text/calendar; method="REPLY"; charset="UTF-8"
233 PRODID:nmh mhical v0.1
236 TZID:Eastern Standard Time
238 DTSTART:16010101T020000
241 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
244 DTSTART:16010101T020000
247 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
251 ORGANIZER;CN=Requester:MAILTO:requester@example.com
252 ATTENDEE;PARTSTAT=ACCEPTED;CN=Recip:MAILTO:recipient@example.com
253 SUMMARY;LANGUAGE=en-US:Accepted: test request
254 DTSTART;TZID=Eastern Standard Time:20150105T090000
255 DTEND;TZID=Eastern Standard Time:20150105T093000
262 LOCATION;LANGUAGE=en-US:
267 cat >`mhpath new` <<'EOF'
268 From: sender@example.com
269 To: recipient@example.com
270 Subject: test iCalendar reply
271 Content-Type: text/calendar; charset="UTF-8"
279 TZID:Eastern Standard Time
281 DTSTART:16010101T020000
284 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
287 DTSTART:16010101T020000
290 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
294 ORGANIZER;CN=Requester:MAILTO:requester@example.com
295 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
296 :MAILTO:requestee1@example.com
297 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
298 :MAILTO:requestee2@example.com
299 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
300 :MAILTO:requestee3@example.com
301 SUMMARY;LANGUAGE=en-US:test request
302 DTSTART;TZID=Eastern Standard Time:20150105T090000
303 DTEND;TZID=Eastern Standard Time:20150105T093000
307 DTSTAMP:20150101T171600Z
311 LOCATION;LANGUAGE=en-US:
315 TRIGGER;RELATED=START:-PT15M
321 actual
="$MH_TEST_DIR/test-convert$$.actual"
323 -convertargs text
/calendar
'-reply accept -contenttype' -nowhatnowproc last
324 SIGNATURE
=Recip mhbuild
- <`mhpath +`/draft
| egrep -v '^DTSTAMP:' >"$actual"
325 check
"$actual" "$expected"