summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-29 15:08:15 +0200
committerErich Eckner <git@eckner.net>2017-08-29 15:08:15 +0200
commitc9042888420196641eff9c566a9b2db2d18fd5d3 (patch)
tree435c8578f8e3de13ffbc77948577a6b4abc6818d
parent7bdbbbc17bd2c93d112a372fa4871f86ccd79957 (diff)
downloadbuilder-c9042888420196641eff9c566a9b2db2d18fd5d3.tar.xz
bin/interpret-mail: all mails are multipart :-)
-rwxr-xr-xbin/interpret-mail31
1 files changed, 12 insertions, 19 deletions
diff --git a/bin/interpret-mail b/bin/interpret-mail
index 9c33ff9..6e2d365 100755
--- a/bin/interpret-mail
+++ b/bin/interpret-mail
@@ -50,25 +50,18 @@ if [ -z "$(
exit
fi
-if grep -q '^From:\s' "${tmp_dir}/plain-content" &&
- grep -q '^To:\s' "${tmp_dir}/plain-content" &&
- grep -q '^Subject:\s' "${tmp_dir}/plain-content"; then
- # the content is / might be "multipart"
- sed -n '
- /^$/!b
- N
- s/^\n//
- /^--/b
- :a
- N
- /\n$/!ba
- s/\n$//
- p
- ' "${tmp_dir}/plain-content" > \
- "${tmp_dir}/raw-content"
-else
- mv "${tmp_dir}/plain-content" "${tmp_dir}/raw-content"
-fi
+sed -n '
+ /^$/!b
+ N
+ s/^\n//
+ /^--/b
+ :a
+ N
+ /\n$/!ba
+ s/\n$//
+ p
+' "${tmp_dir}/plain-content" > \
+ "${tmp_dir}/raw-content"
sed -n '
/^stabilize:/{