From c9042888420196641eff9c566a9b2db2d18fd5d3 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 29 Aug 2017 15:08:15 +0200 Subject: bin/interpret-mail: all mails are multipart :-) --- bin/interpret-mail | 31 ++++++++++++------------------- 1 file 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:/{ -- cgit v1.2.3-70-g09d2