summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-28 11:05:25 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-12-28 11:05:25 +0100
commiteca4338a0f5247f3b6c11ef75c5453de91ace326 (patch)
treef933b0a9e9c43fe1909e0d643c8bc59f6731cbfc
parent1f8cba40c4a74566a5ad174fe090c07745b01f54 (diff)
downloadarch-mirror-tools-eca4338a0f5247f3b6c11ef75c5453de91ace326.tar.gz
arch-mirror-tools-eca4338a0f5247f3b6c11ef75c5453de91ace326.tar.xz
Document generate-mirror-mail.pl
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xbin/generate-mirror-mail.pl25
1 files changed, 24 insertions, 1 deletions
diff --git a/bin/generate-mirror-mail.pl b/bin/generate-mirror-mail.pl
index 5249752..c071d8f 100755
--- a/bin/generate-mirror-mail.pl
+++ b/bin/generate-mirror-mail.pl
@@ -10,6 +10,29 @@ use Try::Tiny;
use Data::Dumper;
+=head1 NAME
+
+generate-mirror-mail.pl - Generate notification mails for broken mirrors
+
+=head1 DESCRIPTION
+
+Run the script and pass it URLs to the archweb mirror page (e.g.
+<https://www.archlinux.org/mirrors/melbourneitmirror.net/>) via STDIN. If the
+mirror has a problem the script will generate an appropriate mail and run
+`compose-mail-from-stdin` which should be a script that starts your favourite
+mail client with the mail. The mail is currently not complete so it cannot be
+sent automatically.
+
+Missing from the mail are:
+
+ - the recipient addresses
+ - the links to the details pages of the problematic mirror URLs
+
+=cut
+
+# TODO: put this in a config file
+my $sender = 'bluewind@xinu.at';
+
#$ENV{HTTPS_CA_FILE} = '/etc/ssl/certs/ca-certificates.crt';
my %templates = (
@@ -50,7 +73,7 @@ sub send_mail {
open my $fh, "|compose-mail-from-stdin" or die "Failed to run mailer: $!";
print $fh "To: $to\n";
- print $fh "From: bluewind\@archlinux.org\n";
+ print $fh "From: $sender\n";
print $fh "Subject: $subject\n";
print $fh "\n";
print $fh "$body";