diff options
-rw-r--r-- | mail-scripts/email | 6 | ||||
-rw-r--r-- | mail-scripts/mail-table | 1 | ||||
-rw-r--r-- | mail-scripts/mail-voters | 17 |
3 files changed, 24 insertions, 0 deletions
diff --git a/mail-scripts/email b/mail-scripts/email new file mode 100644 index 0000000..df5701f --- /dev/null +++ b/mail-scripts/email @@ -0,0 +1,6 @@ +Hello. + +INSERT +For the election officials for the <election-name> election, + +<signature> diff --git a/mail-scripts/mail-table b/mail-scripts/mail-table new file mode 100644 index 0000000..24d72bf --- /dev/null +++ b/mail-scripts/mail-table @@ -0,0 +1 @@ +<nick> <email> diff --git a/mail-scripts/mail-voters b/mail-scripts/mail-voters new file mode 100644 index 0000000..c38f895 --- /dev/null +++ b/mail-scripts/mail-voters @@ -0,0 +1,17 @@ +election=<election-name> +while read num user; +do grep -q "confirmation $num" master-${election} || continue; + email=$(grep "$user" mail-table); + if [[ ! -z $email ]]; then + to="${email#$user }" + else + to="$user@gentoo.org" + fi + ( echo "To: $to"; + echo "From: elections@gentoo.org" + echo "Date: $(date -R)"; + echo "Subject: Your ${election} confirmation id"; + echo ""; + sed -e "s/^INSERT.*/Your confirmation number is $num./" email -e "s/ELECTION/$election/"; ) \ + | /usr/lib/sendmail -oi $to; +done < confs-${election} |