cfa95f7dc97a3aeb09d609892fcf4c3081be0712 lrnassar Thu Jan 11 09:14:31 2024 -0800 Changing the address from genome-www to reduce spam and sending it to the browserqa cron ML instead, refs Max. diff --git src/utils/qa/hubPublicMail src/utils/qa/hubPublicMail index 237084f..bf3c2eb 100755 --- src/utils/qa/hubPublicMail +++ src/utils/qa/hubPublicMail @@ -1,29 +1,29 @@ #!/usr/bin/env python3 import logging, sys, optparse, os, requests, sys, urllib3, atexit, urllib from os.path import isfile from email.mime.text import MIMEText from subprocess import Popen, PIPE # makes sure that only one instance of the program runs at the same time lockFname = None # switch off insecure SSL warnings urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) -fromEmail="genome-www@soe.ucsc.edu" +fromEmail="qateam@gi.ucsc.edu" emailTemplate = """Dear UCSC Public Hub author, This is an automated email sent by the UCSC Genome Browser Group's hubPublicMail system to alert you that your public track hub at the address: %s Has been inaccessible for at least 48 consecutive hours. If it continues to be offline, we may have to remove it from our public hubs list at https://genome.ucsc.edu/cgi-bin/hgHubConnect Do not hesitate to let us know if we can help you resolve this situation, e.g. by updating the URL where the hub is hosted or possibly hosting the files on our servers. You can reach us at genome-www@soe.ucsc.edu. @@ -126,31 +126,31 @@ # some hubs may have broken hub.txt files. Treat these as if they were broken. didFail.append(url) break key, val = keyVal if not key=="email": continue emails[url] = parseEmail(val) return didFail, emails def sendEmail(dest, body): " send email to dest " msg = MIMEText(body) msg["From"] = fromEmail - msg["To"] = dest+","+fromEmail + msg["To"] = dest+","+"browserqa-group@ucsc.edu" msg["Subject"] = "Your UCSC public hub is down" p = Popen(["/usr/sbin/sendmail", "-t", "-oi"], stdin=PIPE) p.communicate(msg.as_bytes()) # Both Python 2.X and 3.X # p.communicate(msg.as_bytes() if sys.version_info >= (3,0) else msg.as_string()) # Python 2.X # p.communicate(msg.as_string()) def readStatus(fname): " read tab sep file with columns hubUrl, email, failCount " hubs = dict() if not isfile(fname): return hubs logging.debug("Reading %s" % fname)