diff --git a/tools/resetbounces b/tools/resetbounces new file mode 100755 index 0000000000000000000000000000000000000000..259d487d6c6182f122c39ab7796c0778c5678e18 --- /dev/null +++ b/tools/resetbounces @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w +# resetbounces - reset the bounce scores for users on a particular list +# NOTE: this script requires the current user has write access to the db +# Matt Taggart <taggart@riseup.net> 2020-08 + +print "This tool is unfinished, halfway through writing it we no longer needed it\n"; +exit 1; + +if ( ! $ARGV[0] ) { + print "usage: resetbounces <list>\n"; + exit 1; +} +my $target = $ARGV[0]; + +my $listsql=qq(mysql -N --batch --database=sympa --execute "select list_subscriber,user_subscriber,bounce_score_subscriber from subscriber_table where list_subscriber = '$target'"); + + +open(LISTDUMP, "$listsql|") or die "cannot get dump from database\n"; + +while (<LISTDUMP>) { + chomp; + print "$_\n"; + # match sane address and list + #m/^<?(.*\@(.*?))>?\s*\t(.*) (.*) (.*) (.*)$/; + #my $address=$1; + #my $domain=$2; + #my $firstbounce=$3; + #my $lastbounce=$4; + #my $bouncescore=$5; + #my $bouncecode=$6; + + #print "$address $domain $firstbounce $lastbounce $bouncescore $bouncecode\n"; + +} diff --git a/tools/sendadminsmail b/tools/sendadminsmail new file mode 100755 index 0000000000000000000000000000000000000000..1ad80b93f66a0c006717d1a6aa606fe4fc282495 --- /dev/null +++ b/tools/sendadminsmail @@ -0,0 +1,64 @@ +#!/usr/bin/perl -w +# sendadminsmail - given a file with a list of lsits, send admins email +# taggart - 202008 +# requires libemail-sender-perl + +use Email::Sender::Simple qw(sendmail); + +my $from='listmaster@lists.riseup.net'; +my $subject='Problem with lists.riseup.net mail delivery'; + +if (!$ARGV[0]) { + print "usage: sendadminsmail <file>\n"; + exit; +} + +$infile=$ARGV[0]; +open(IN, "$infile") or die "ERROR: cannot open $infile\n"; + +while (<IN>) { + chomp; + $list=$_; + $admin="${list}-admin@lists.riseup.net"; + + print "Sending to $admin...\n"; + + $body= "Hi $admin, +While recently making some configuration changes to improve server security, we had a bug that caused lists.riseup.net mail deliveries to bounce. +This bug existed for 13 hours, from + 2020-08-12 23:00 to 2020-08-13 12:00 UTC + 2020-08-12 16:00 to 2020-08-13 5:00 US PDT + +Your list, + + ${list}@lists.riseup.net + +was detected as possibly having list traffic during that time. There is a chance that any message sent to your list was not delivered to subscribers. However, any messages would have been properly archived, so you can check there to see if there are messages that need to be resent. + +You may also notice in the admin interface that bounce count for subscribers is high due to this issue. Do not delete any subscribers and on the next successful delivery the bounce numbers will be automatically fixed. + +We are sorry this happened and if you have any questions please file a support ticket at https://support.riseup.net + +Thanks, + +-- +Riseup +listmaster\@lists.riseup.net +"; + + #&domail; + print "TESTING\n"; + print "$body\n"; +} + +sub domail { + my $email = Email::Simple->create( + header => [ + To => $contact, + From => $from, + Subject => $subject, + ], + body => $body, + ); + sendmail($email); +}