]>
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 cat >"$expected" <<'EOF'
29 From: recipient@example.com
30 To: sender@example.com
34 Comments: In-reply-to sender@example.com
35 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
37 Content-Type: text/plain; charset="US-ASCII"
44 cat >`mhpath new` <<'EOF'
45 From: sender@example.com
46 To: recipient@example.com
48 Date: Thu, 11 Dec 2014 08:19:02 -0600
49 Content-Type: multipart/mixed; boundary="_001_"
53 Content-Type: text/plain
58 Content-Type: text/plain
63 Content-Type: text/enriched
65 This should not appear in the reply
66 because the content type isn't matched.
71 repl
-noformat -convertarg text
/plain
'' -nowhatnowproc last
73 check
"$actual" "$expected"
76 #### Make sure that this works with 8-bit encoding.
77 require_locale en_US.utf
-8 en_US.utf8
78 LC_ALL
=en_US.UTF
-8; export LC_ALL
81 # check -convertarg with multiple parts and no additional text in draft
82 cat >"$expected" <<'EOF'
83 From: recipient@example.com
84 To: sender@example.com
88 Comments: In-reply-to sender@example.com
89 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
91 Content-Type: text/plain; charset="UTF-8"
92 Content-Transfer-Encoding: 8bit
94 sender@example.com writes:
101 cat >`mhpath new` <<'EOF'
102 From: sender@example.com
103 To: recipient@example.com
105 Date: Thu, 11 Dec 2014 08:19:02 -0600
106 Content-Type: multipart/mixed; boundary="_001_"
110 Content-Type: text/plain
115 Content-Type: text/plain
122 repl
-filter mhl.replywithoutbody
-convertarg text
/plain
'' -nowhatnowproc last
124 check
"$actual" "$expected"
127 # check message with text part in multipart/related
128 cat >"$expected" <<'EOF'
129 From: recipient@example.com
130 To: sender@example.com
133 Subject: Re: test with text part in multipart/related
134 Comments: In-reply-to sender@example.com
137 Content-Type: text/plain; charset="UTF-8"
138 Content-Transfer-Encoding: 8bit
140 sender@example.com writes:
145 cat >`mhpath new` <<'EOF'
146 From: sender@example.com
147 To: recipient@example.com
148 Subject: test with text part in multipart/related
149 Content-Type: multipart/alternative; boundary="_001_"
153 Content-Type: multipart/related; type="text/plain"; boundary="_002_"
156 Content-Type: text/plain
165 repl
-filter mhl.replywithoutbody
-convertarg text
/plain
'' -nowhatnowproc last
167 check
"$actual" "$expected"
170 # check reply to calendar request
171 cat >"$expected" <<'EOF'
172 From: recipient@example.com
173 To: sender@example.com
176 Subject: Re: test iCalendar reply
177 Comments: In-reply-to sender@example.com
180 Content-Type: text/calendar; method="REPLY"; charset="UTF-8"
184 PRODID:nmh mhical v0.1
187 TZID:Eastern Standard Time
189 DTSTART:16010101T020000
192 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
195 DTSTART:16010101T020000
198 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
202 ORGANIZER;CN=Requester:MAILTO:requester@example.com
203 ATTENDEE;PARTSTAT=ACCEPTED;CN=Recip:MAILTO:recipient@example.com
204 SUMMARY;LANGUAGE=en-US:Accepted: test request
205 DTSTART;TZID=Eastern Standard Time:20150105T090000
206 DTEND;TZID=Eastern Standard Time:20150105T093000
213 LOCATION;LANGUAGE=en-US:
218 cat >`mhpath new` <<'EOF'
219 From: sender@example.com
220 To: recipient@example.com
221 Subject: test iCalendar reply
222 Content-Type: text/calendar; charset="UTF-8"
230 TZID:Eastern Standard Time
232 DTSTART:16010101T020000
235 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
238 DTSTART:16010101T020000
241 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
245 ORGANIZER;CN=Requester:MAILTO:requester@example.com
246 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee1
247 :MAILTO:requestee1@example.com
248 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee2
249 :MAILTO:requestee2@example.com
250 ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Requestee3
251 :MAILTO:requestee3@example.com
252 SUMMARY;LANGUAGE=en-US:test request
253 DTSTART;TZID=Eastern Standard Time:20150105T090000
254 DTEND;TZID=Eastern Standard Time:20150105T093000
258 DTSTAMP:20150101T171600Z
262 LOCATION;LANGUAGE=en-US:
266 TRIGGER;RELATED=START:-PT15M
272 actual
="$MH_TEST_DIR/test-convert$$.actual"
274 -convertargs text
/calendar
'-reply accept -contenttype' -nowhatnowproc last
275 SIGNATURE
=Recip mhbuild
- <`mhpath +`/draft
| egrep -v '^DTSTAMP:' >"$actual"
276 check
"$actual" "$expected"