diff options
-rwxr-xr-x | sendmailadvanced | 49 |
1 files 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}" ( |