summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsendmailadvanced.in22
1 files changed, 15 insertions, 7 deletions
diff --git a/sendmailadvanced.in b/sendmailadvanced.in
index 5608ed2..f362500 100755
--- a/sendmailadvanced.in
+++ b/sendmailadvanced.in
@@ -68,6 +68,20 @@ gpgAdressaten() {
done
}
+gen_boundary() {
+ [ -n "$1" ] && len=$1 || len=33
+ local bnd
+ bnd=''
+ while [ "${#bnd}" -lt ${len} ]; do
+ bnd="${bnd}$(
+ head -c1 /dev/urandom | \
+ base64 -w0 | \
+ tr -d '/+='
+ )"
+ done
+ echo "${bnd}"
+}
+
datei=""
encrypt=true
stamp=true
@@ -250,13 +264,7 @@ fi
echo "${body}" | \
grep -q "${boundary}"
do
- boundary="$(
- set +o pipefail
- base64 -w0 < /dev/urandom | \
- tr -d [/+] | \
- head -c 33
- )"
- true
+ boundary="$(gen_boundary)"
done
echo 'MIME-Version: 1.0'