diff options
author | nay <nay@nays.cz> | 2023-08-16 16:50:05 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2024-09-11 21:36:32 +0200 |
commit | 75cb6729f053e0050fcbbd974de9e8dff22d94f5 (patch) | |
tree | 9440187b97a461be6bf3dc9a337211362634d613 /t | |
parent | e618e579faf64effb4ddbc398647f91d356c2186 (diff) | |
download | mblaze-75cb6729f053e0050fcbbd974de9e8dff22d94f5.tar.gz mblaze-75cb6729f053e0050fcbbd974de9e8dff22d94f5.tar.xz mblaze-75cb6729f053e0050fcbbd974de9e8dff22d94f5.zip |
t/1702-mshow-attachments.t: add tests for named part/attachment detection
Diffstat (limited to 't')
-rwxr-xr-x | t/1702-mshow-attachments.t | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/t/1702-mshow-attachments.t b/t/1702-mshow-attachments.t new file mode 100755 index 0000000..73f2517 --- /dev/null +++ b/t/1702-mshow-attachments.t @@ -0,0 +1,53 @@ +#!/bin/sh -e +cd ${0%/*} +. ./lib.sh +plan 2 + +# Different naming scenarios for named parts +cat <<EOF >tmp +Content-Type: multipart/mixed; boundary=----_NextPart_000_00DE_01D6A2E8.A7446C80 + +------_NextPart_000_00DE_01D6A2E8.A7446C80 + +no header, part is not attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Type: text/plain; charset=UTF-8 + +CT w/o name, part is not attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Type: text/plain; charset=UTF-8; name="ctn.txt" + +CT with name, part is attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Disposition: attachment + +CD w/o filename, part is not attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Type: text/plain; charset=UTF-8 +Content-Disposition: attachment + +CD w/o filename, CT w/o name, part is not attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Type: text/plain; charset=UTF-8; name="cd_ctn.txt" +Content-Disposition: attachment + +CD w/o filename, CT with name, part is attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Disposition: attachment; filename="cdf.txt" + +CD with filename, part is attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Type: text/plain; charset=UTF-8; name="cdf_ct.txt" +Content-Disposition: attachment + +CD with filename, CT w/o name, part is attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80 +Content-Type: text/plain; charset=UTF-8; name="cdf_ctn.txt" +Content-Disposition: attachment; filename="cdf_ctn.txt" + +CD with filename, CT with name, part is attachment +------_NextPart_000_00DE_01D6A2E8.A7446C80-- +EOF + +check 'mail has 10 parts' 'mshow -t ./tmp | wc -l | grep 11' +check 'mail has 5 named parts/attachments' 'mshow -t ./tmp | grep .*name=\".*\" | wc -l | grep 5' |