
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>;'
