diff options
author | Leah Neukirchen <leah@vuxu.org> | 2021-05-09 16:23:18 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2021-05-09 16:23:18 +0200 |
commit | 5b52110399e991fa03480bfeb529e1fd0749fcc3 (patch) | |
tree | a7368591d914fa4b4963c5fa3380ba0419f8c712 /t | |
parent | 93e8a4a8920360c730f80f6dfe4353e626bf3502 (diff) | |
download | mblaze-5b52110399e991fa03480bfeb529e1fd0749fcc3.tar.gz mblaze-5b52110399e991fa03480bfeb529e1fd0749fcc3.tar.xz mblaze-5b52110399e991fa03480bfeb529e1fd0749fcc3.zip |
mmime: do not duplicate Content* headers
Do not add additional Content-Type and Content-Transfer-Encoding headers when using mmime on input already containing them. Do not reencode the message if Content-Transfer-Encoding is set. Based on a patch by Felix Van der Jeugt and duncaen.
Diffstat (limited to 't')
-rwxr-xr-x | t/1000-mmime.t | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/t/1000-mmime.t b/t/1000-mmime.t index b0b0dc5..47ca63b 100755 --- a/t/1000-mmime.t +++ b/t/1000-mmime.t @@ -1,7 +1,7 @@ #!/bin/sh -e cd ${0%/*} . ./lib.sh -plan 8 +plan 12 cat <<EOF >tmp References: <aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@a> <bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@b> <ccccccccccccccccccccccccccccccc@c> @@ -42,3 +42,50 @@ Subject: inclusion test with other disposition EOF check 'include works, overriding filename' 'mmime <tmp2 | grep Disposition | grep inline' + + +cat <<EOF >tmp2 +Subject: message with content-type +Content-Type: text/plain; format=flowed + +This message has format-flowed. +EOF + +check 'content-type is respected if found in input' 'mmime -r <tmp2 |grep format=flowed' + +cat <<EOF >tmp2 +Subject: message with content-transfer-encoding +Content-Transfer-Encoding: quoted-printable + +This message has already encoded. f=C3=B6=C3=B6. +EOF + + +check 'content-transfer-encoding is respected if found in input' 'mmime -r <tmp2 |grep f=C3=B6=C3=B6' + +cat <<EOF >tmp2 +Subject: message with content-type +Content-Type: text/plain; format=flowed + +This message has format-flowed. + +#message/rfc822 $PWD/tmp + +This part too. +EOF + + +check 'content-type is respected if found in input, for multipart/mixed' 'mmime <tmp2 |grep format=flowed' + +cat <<EOF >tmp2 +Subject: message with content-transfer-encoding +Content-Transfer-Encoding: Quoted-Printable + +This message has already encoded. f=C3=B6=C3=B6. + +#message/rfc822 $PWD/tmp + +This part too. +EOF + +check 'content-transfer-encoding is respected if found in input, for multipart/mixed' 'mmime <tmp2 |grep f=C3=B6=C3=B6' |