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
# we read the columns from $MEMBER_DATA file into these variables
# variables are used in script and also overhanded to erb
while IFS="," read -r lineno nick email fingerprint passwort
do
echo "Displaying Record-$lineno"
echo "Nick: $nick"
echo "email: $email"
echo "fingerprint: $fingerprint"
# echo "passwort: $passwort"
echo "-------"
if [ -z "$DRYRUN" ] ; then if [ -z "$DRYRUN" ] ; then
echo "real run" # we take over nick and passwort into the erb template
erb column1=Column1 column2=Column2 column3=Column3 $TEMPLATE\ # TODO this is not a generic solution !!!
| gpg2 --batch --yes -vvv -u vorstand@wtf-eg.de \ # the file $TEMPLATE contains the erb template
--no-emit-version -eas -r "42152130EE5C8BED881AB911D65BA8BC7E8B9302" \ #
| swaks --to frank.landgraf@web.de \ # 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 \
@ -95,7 +115,13 @@ if [ -z "$DRYRUN" ] ; then
--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