first working version for gv sending login data

This commit is contained in:
Gulliver 2021-04-27 01:38:02 +02:00
parent 280884a058
commit d89017241e

View File

@ -81,12 +81,32 @@ echo "MEMBER_DATA = "$MEMBER_DATA
echo "TEMPLATE = "$TEMPLATE echo "TEMPLATE = "$TEMPLATE
echo "SUBJECT = "$SUBJECT echo "SUBJECT = "$SUBJECT
if [ -z "$DRYRUN" ] ; then # we read the columns from $MEMBER_DATA file into these variables
echo "real run" # variables are used in script and also overhanded to erb
erb column1=Column1 column2=Column2 column3=Column3 $TEMPLATE\ while IFS="," read -r lineno nick email fingerprint passwort
| gpg2 --batch --yes -vvv -u vorstand@wtf-eg.de \ do
--no-emit-version -eas -r "42152130EE5C8BED881AB911D65BA8BC7E8B9302" \ echo "Displaying Record-$lineno"
| swaks --to frank.landgraf@web.de \ echo "Nick: $nick"
echo "email: $email"
echo "fingerprint: $fingerprint"
# echo "passwort: $passwort"
echo "-------"
if [ -z "$DRYRUN" ] ; then
# we take over nick and passwort into the erb template
# TODO this is not a generic solution !!!
# the file $TEMPLATE contains the erb template
#
# gpg uses the trust-model always
#
# swaks uses the other variables for sending per SMTP
# to mailhost
erb nick="$nick" passwort="$passwort" $TEMPLATE \
| gpg2 -vvv --trust-model always\
-u vorstand@wtf-eg.de \
--no-emit-version \
-eas -r ${fingerprint// /} \
| swaks --to "$email" \
--from "vorstand@wtf-eg.de" \ --from "vorstand@wtf-eg.de" \
-tls \ -tls \
--auth LOGIN \ --auth LOGIN \
@ -94,8 +114,14 @@ if [ -z "$DRYRUN" ] ; then
--auth-user $SMTPUSER \ --auth-user $SMTPUSER \
--auth-password $SMTPPASSWORD \ --auth-password $SMTPPASSWORD \
--header "Subject: $SUBJECT" --body - --header "Subject: $SUBJECT" --body -
else else
echo "dry run" erb nick="$nick" passwort="$passwort" $TEMPLATE
erb column1=Column1 column2=Column2 column3=Column3 $TEMPLATE erb nick="$nick" passwort="$passwort" $TEMPLATE \
erb column1=Column1 column2=Column2 column3=Column3 $TEMPLATE|gpg2 --batch --yes -vvv -u vorstand@wtf-eg.de --no-emit-version -eas -r "42152130EE5C8BED881AB911D65BA8BC7E8B9302" | gpg2 -vvv --trust-model always\
-u vorstand@wtf-eg.de \
--no-emit-version \
-eas -r ${fingerprint// /}
fi fi
done < $MEMBER_DATA