summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-03-05 11:56:30 +0100
committerErich Eckner <git@eckner.net>2020-03-05 11:56:30 +0100
commitb4dced98b973bac8194b876227947be08c321a41 (patch)
tree1f8d356eba25474a2051d090f2675f807f8046a9
parent84eaebe74a60f2b18358e46b3d1ce318c706d494 (diff)
downloaddmarc-aggregate-viewer-b4dced98b973bac8194b876227947be08c321a41.tar.xz
bin/extract-attachment: parse more email formats
-rwxr-xr-xbin/extract-attachment4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/extract-attachment b/bin/extract-attachment
index 0cce7a1..1411270 100755
--- a/bin/extract-attachment
+++ b/bin/extract-attachment
@@ -63,6 +63,8 @@ for end in ${borders}; do
t
s@^Content-Type: application/zip; name="\([^"]\+\.zip\)"$@\1@
t
+ s@^Content-Type: application/gzip; \([^;]\+; \)*name="\([^"]\+\.gz\)"$@\1@
+ t
d
' \
| tr -d '"/' \
@@ -75,7 +77,7 @@ for end in ${borders}; do
)
if printf '%s\n' "${filtered_cnt}" \
- | grep -qx '^Content-Transfer-Encoding: \(base\|BASE\)64\s*$' \
+ | grep -qx '^Content-Transfer-Encoding: [Bb][Aa][Ss][Ee]64\s*$' \
&& [ -n "${file_name}" ]; then
decode=true
break