about summary refs log tree commit diff
path: root/t
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-10-04 13:47:51 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-10-04 13:47:51 +0200
commitb962fb6be048bc753a4131b6f690c25c5d45b3c5 (patch)
treedfa032416dd91fe191ed74bf1a99a1e889f26096 /t
parent958e3e08bd74e6bec3e5baee87041025fe59494d (diff)
downloadmblaze-b962fb6be048bc753a4131b6f690c25c5d45b3c5.tar.gz
mblaze-b962fb6be048bc753a4131b6f690c25c5d45b3c5.tar.xz
mblaze-b962fb6be048bc753a4131b6f690c25c5d45b3c5.zip
rfc2047: skip whitespace everywhere during base64 decoding
> The encoded output stream must be represented in lines of no more
> than 76 characters each.  All line breaks or other characters not
> found in Table 1 must be ignored by decoding software.  In base64
> data, characters other than those in Table 1, line breaks, and other
> white space probably indicate a transmission error, about which a
> warning message or even a message rejection might be appropriate
> under some circumstances.
Diffstat (limited to 't')
-rwxr-xr-xt/1701-mshow-regress.t26
1 files changed, 25 insertions, 1 deletions
diff --git a/t/1701-mshow-regress.t b/t/1701-mshow-regress.t
index ffb676d..96fe13f 100755
--- a/t/1701-mshow-regress.t
+++ b/t/1701-mshow-regress.t
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 cd ${0%/*}
 . ./lib.sh
-plan 2
+plan 3
 
 # Mail with \n\n and \r\n\r\n
 cr=$(printf '\r')
@@ -27,3 +27,27 @@ EOF
 
 check 'mail has 3 attachments' 'mshow -t ./tmp | wc -l | grep 4'
 check 'mail attachment foo has size 35' 'mshow -t ./tmp | grep size=35.*name=\"foo\"'
+
+# Mail with linebreaks in base64 quartets
+cat <<EOF >tmp
+Subject: base64
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="----_=_2f8f1e2243b55f8618eaf0d9_=_"
+
+This is a multipart message in MIME format.
+
+------_=_2f8f1e2243b55f8618eaf0d9_=_
+Content-Disposition: attachment; filename=base64
+Content-Type: application/binary
+Content-Transfer-Encoding: base64
+
+dGhp
+cyBpc
+yBzb21
+lIGJhc2
+U2NAo=
+
+------_=_2f8f1e2243b55f8618eaf0d9_=_--
+EOF
+
+check 'mail decodes correctly' 'mshow -O ./tmp 2 | grep -q "this is some base64"'