From 558eb3ebdd9f6b8f1256d514b455defbc6ab09a0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 25 Apr 2016 14:04:30 +0200 Subject: Briefmarken werden jetzt direkt nach dem Erscheinen der Adressaten eingefügt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sendmailadvanced | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/sendmailadvanced b/sendmailadvanced index 3c3122d..c1a6ef0 100755 --- a/sendmailadvanced +++ b/sendmailadvanced @@ -13,6 +13,30 @@ verwendung() { exit 1 } +stempeln() { + oldIFS="${IFS}" + + IFS=',' + for adressat in ${adressatenString} + do + if [[ "${adressat}" == *"<"*">"* ]] + then + adressat="${adressat#*<}" + adressat="${adressat%>*}" + fi + adressat="$( + echo "${adressat}" | \ + tr -d "[:space:]" + )" + echo "${adressat}" | grep -q "\S" || continue + hashcash -b ${hashcash_bits} -Xm "${adressat}" + done + + adressatenString="" + + IFS="${oldIFS}" +} + datei="" encrypt=true stamp=true @@ -122,29 +146,16 @@ fi adressatenSammeln=true s=" ,${s:4}" fi - [ "${s:0:1}" == " " ] || adressatenSammeln=false + if [ ! "${s:0:1}" == " " ] + then + ${adressatenSammeln} && ${stamp} && stempeln + adressatenSammeln=false + fi ${adressatenSammeln} && adressatenString="${adressatenString}${s}" echo "${zeile}" done - if ${stamp} - then - IFS=',' - for adressat in ${adressatenString} - do - if [[ "${adressat}" == *"<"*">"* ]] - then - adressat="${adressat#*<}" - adressat="${adressat%>*}" - fi - adressat="$( - echo "${adressat}" | \ - tr -d "[:space:]" - )" - echo "${adressat}" | grep -q "\S" || continue - hashcash -b ${hashcash_bits} -Xm "${adressat}" - done - fi + ${stamp} && stempeln echo "${zeile}" ( -- cgit v1.2.3-70-g09d2