From: Andrew Ruthven Date: Mon, 17 Nov 2014 22:05:43 +0000 (+1300) Subject: Report on who we sent GPG encrypted messages to. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cdc07d269f5dab4d622afd7c034b76f86a4082a;p=mail-merge.git Report on who we sent GPG encrypted messages to. --- diff --git a/merge.pl b/merge.pl index ac89f1f..55b205e 100755 --- a/merge.pl +++ b/merge.pl @@ -92,6 +92,7 @@ if ($tmplData->{'attachment_col'}) { } my @gpg_failed_addresses; +my @gpg_succeeded_addresses; while (my $cols = $csv->getline_hr($IN) ) { last unless %$cols; @@ -217,6 +218,7 @@ while (my $cols = $csv->getline_hr($IN) ) { } $mail->send('sendmail'); + push @gpg_succeeded_addresses, @emails if defined $mg; } else { # Say who we want to send to. @@ -228,8 +230,12 @@ while (my $cols = $csv->getline_hr($IN) ) { close $IN; +if (scalar(@gpg_succeeded_addresses) > 0) { + print "Sent GPG encrypted messages to the following addresses:\n"; + print " ", join("\n ", uniq(@gpg_succeeded_addresses)) . "\n\n"; +} if (scalar(@gpg_failed_addresses) > 0) { - print "Failed to send GPG encrypt messages to the following addresses:\n"; + print "Failed to send GPG encrypted messages to the following addresses:\n"; print " ", join("\n ", uniq(@gpg_failed_addresses)) . "\n\n"; }