aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-02-10 11:01:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-02-10 11:01:00 -0300
commit703079974f0245015c585533ee551d9117324397 (patch)
treed87d4eacb4a4da31c7b533bf7eecc3604f2ee7a1
parent22903e3000ec12ee49bd28d136f63078bd676c46 (diff)
downloadutils-mail-703079974f0245015c585533ee551d9117324397.tar.gz
utils-mail-703079974f0245015c585533ee551d9117324397.tar.bz2
Feat: minimailer: increase verbosity and adds variable in the template
-rwxr-xr-xminimailer8
1 files changed, 6 insertions, 2 deletions
diff --git a/minimailer b/minimailer
index 09c66ae..8eadd8a 100755
--- a/minimailer
+++ b/minimailer
@@ -12,7 +12,8 @@ To: recipient
From: myself@mydomain
Subject: Email Test using MSMTP from File
-Hi $recipient! This is an automated message.
+Hi $recipient! This is an automated message to remind
+that your email $address is in our database.
King regards,
Myself
@@ -54,6 +55,9 @@ cat $RECIPIENTS | while read recipient; do
# https://linuxconfig.org/extract-email-address-from-a-text-file
address="`echo $recipient | sed -r 's/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/\n&\n/ig;s/(^|\n)[^@]*(\n|$)/\n/g;s/^\n|\n$//g;/^$/d'`"
- sed -e "s/\$recipient/$recipient/g" $TEMPLATE | \
+ echo "sending to $address..."
+
+ sed -e "s/\$recipient/$recipient/g" \
+ -e "s/\$address/$address/g" $TEMPLATE | \
msmtp -a $MSMTP_ACCOUNT $address
done