/usr/lib/python3/dist-packages/certbot
NameSizeModeActions
compat/-0755rm
display/-0755rm
plugins/-0755rm
tests/-0755rm
__pycache__/-0755rm
account.py139570644editdlrm
achallenges.py16240644editdlrm
auth_handler.py188600644editdlrm
cert_manager.py153700644editdlrm
cli.py725250644editdlrm
client.py303640644editdlrm
configuration.py58110644editdlrm
constants.py67620644editdlrm
crypto_util.py162270644editdlrm
eff.py31380644editdlrm
errors.py26550644editdlrm
error_handler.py70860644editdlrm
hooks.py90510644editdlrm
interfaces.py220420644editdlrm
lock.py97840644editdlrm
log.py127240644editdlrm
main.py499920644editdlrm
notify.py10640644editdlrm
ocsp.py131370644editdlrm
renewal.py213880644editdlrm
reporter.py35470644editdlrm
reverter.py245460644editdlrm
ssl-dhparams.pem4240644editdlrm
storage.py460740644editdlrm
updater.py39540644editdlrm
util.py195480644editdlrm
__init__.py1140644editdlrm
Edit: /usr/lib/python3/dist-packages/certbot/notify.py (1064B)
"""Send e-mail notification to system administrators.""" import email import smtplib import socket import subprocess def notify(subject, whom, what): """Send email notification. Try to notify the addressee (``whom``) by e-mail, with Subject: defined by ``subject`` and message body by ``what``. """ msg = email.message_from_string(what) msg.add_header("From", "Certbot renewal agent ") msg.add_header("To", whom) msg.add_header("Subject", subject) msg = msg.as_string() try: lmtp = smtplib.LMTP() lmtp.connect() lmtp.sendmail("root", [whom], msg) except (smtplib.SMTPHeloError, smtplib.SMTPRecipientsRefused, smtplib.SMTPSenderRefused, smtplib.SMTPDataError, socket.error): # We should try using /usr/sbin/sendmail in this case try: proc = subprocess.Popen(["/usr/sbin/sendmail", "-t"], stdin=subprocess.PIPE) proc.communicate(msg) except OSError: return False return True