File: testsuite

package info (click to toggle)
maildrop 2.9.3-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,104 kB
  • sloc: ansic: 26,822; cpp: 9,085; sh: 4,868; makefile: 753; perl: 94
file content (227 lines) | stat: -rw-r--r-- 5,884 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_PAPER
unset LC_NAME
unset LC_ADDRESS
unset LC_TELEPHONE
unset LC_MEASUREMENT
unset LC_IDENTIFICATION
unset LC_ALL
unset CHARSET
unset MM_CHARSET
export LANG
export LC_ALL

cat >testsuite.dat <<EOF
Subject: test
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=aaa


--aaa
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=C3=81BC

--aaa
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

ABC

--aaa
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

=C1

--aaa
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Á

--aaa
Content-Type: message/rfc822

Subject: testing

test message

--aaa---
EOF
LANG=en_US.utf-8 ./reformime -r <testsuite.dat | sed 's/=_.*//;s/X-Mime-Autoconverted:.*//'
LANG=en_US.utf-8 ./reformime -r7 <testsuite.dat | sed 's/=_.*//;s/X-Mime-Autoconverted:.*//'
LANG=en_US.utf-8 ./reformime -r8 <testsuite.dat | sed 's/=_.*//;s/X-Mime-Autoconverted:.*//'

cat >testsuite.dat <<EOF
From: nobody
To: nobody
Subject: this is
   a test

testing
EOF
./headercheck 0 "" <testsuite.dat
echo "--"
./headercheck 2 "" <testsuite.dat
echo "--"
./headercheck 1 "" <testsuite.dat

cat >testsuite.dat <<EOF
From: nobody
To: nobody
Mime-Version: 1.0
Content-Type: message/rfc822

From: nobody@example.com
To: nobody@example.com
Message-ID: <a@b>
Subject: Example
   subject

EOF
echo "---"
./headercheck 0 "1.1" <testsuite.dat
echo "--"
./headercheck 2 "1.1" <testsuite.dat
echo "--"
./headercheck 1 "1.1" <testsuite.dat

cat >testsuite.dat <<EOF
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=aaa


--aaa
Content-Type: text/plain; name*=n%41me
Content-Disposition: attachment; filename*1=n%41me;
				 filename*2*=".%65xe";
				 filename*0*=iso8859-1'en_US'file

Testing

--aaa
Content-Type: text/plain; name=name
Content-Disposition: attachment; filename=name.exe; filename*1=n%41me;
				 filename*2*=".%65xe";
				 filename*0*=iso8859-1'en_US'file

Testing

--aaa---
EOF
LANG=en_US.utf-8 ./reformime -i <testsuite.dat | sed 's/^charset:.*/charset: iso-8859-1/'

echo "foo" >confmdtest

./makemime -c application/octet-stream -C utf-8 -N footest confmdtest

./makemime -c application/octet-stream -C utf-8 -N footest:1 confmdtest
./makemime -c application/octet-stream -C utf-8 -N f:::::::::::::::::::::::::1 confmdtest

LANG=en_US.utf-8 ./reformime -h '=?iso-8859-1?Q?H=F3la!?= test =?iso-8859-1?Q?H=F3la!_?=  =?iso-8859-1?Q?H=F3la!?=  test'
rm -f confmdtest

cat >testsuite.dat <<EOF
Subject: test
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Description: =?iso-8859-1?Q?H=F3la!?= test =?iso-8859-1?Q?H=F3la!_?=
		     =?iso-8859-1?Q?H=F3la!?=  test

testing
EOF
LANG=en_US.utf-8 ./reformime -i <./testsuite.dat
LANG=en_US.utf-8 ./reformime -H '=?iso-8859-1?Q?H=F3la!?= test <test1@example.com>'
LANG=en_US.utf-8 ./reformime -H '=?iso-8859-1?Q?H=F3la=22?= test <test1@example.com>'
LANG=en_US.utf-8 ./reformime -O 'Hóla <user@Hóla.example.com>, user@example.com (Hóla), John Smith <user@example.com>, user2@example.com, "John Smith (Accounting)" <user3@example.com>, "Hóla Smith (Accounting)" <user4@example.com>, john smith <user@hóla.example.com>'

LANG=en_US.utf-8 ./reformime -H '=?UTF-8?B?SMOzbGE=?= <user@xn--hla-gna.example.com>, =?UTF-8?B?SMOzbGE=?= <user@example.com>, John Smith <user@example.com>, user2@example.com, "John Smith (Accounting)" <user3@example.com>, =?UTF-8?B?SMOzbGE=?= Smith =?UTF-8?B?KEFjY291bnRpbmcp?= <user4@example.com>, john smith <user@xn--hla-gna.example.com>'

LANG=en_US.utf-8 ./reformime -H 'list: address1 <address1@example.com>, address2 <address2@example.com>;'

LANG=en_US.utf-8 ./reformime -O 'list: address1 <address1@example.com>, address2 <address2@example.com>;'

./reformime -u <<EOF
From: Sam =?iso-8859-1?B?SOhsbG8=?= <nobody@xn--8ca.example.com>
Subject: =?iso-8859-1?B?SOhsbG8=?=
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="aaa"

Ignore this

--aaa
Content-Type: message/rfc822

Subject: embedded message
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="bbb"

Ignore this too

--bbb
Content-Type: TEXT/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

H=C2llo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AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AMM
EOF

./reformime -u >/dev/null <<EOF
Subject: test
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-7"

AA+AM
BB
EOF

x="XXXXXXXX"
x="
$x$x$x$x$x$x$x$x"
x="$x$x$x$x"
x="$x$x$x$x"
x="$x$x"

(cat <<EOF
Subject: test
Mime-Version: 1.0
Content-Type: text/plain; charset='iso-8859-15'
$x
EOF
) | tr 'X' '\244' | ./reformime -u | tail -32

rm testsuite.dat