1
0
Fork 0

Update to not send mails in case nothing changes

Future TODO: Send update if expiry is close (< 30 days)
This commit is contained in:
Luca Beltrame 2021-08-28 22:43:21 +02:00
parent 3cad10d133
commit 782f3202e3
Signed by: einar
GPG key ID: 4707F46E9EC72DEC

View file

@ -44,17 +44,16 @@ def main():
elif "unexpected error occurred" in line: elif "unexpected error occurred" in line:
state = State.error state = State.error
text = "\n".join(text) if state is not State.no_action:
subject = SUBJECT.format(str(state)) text = "\n".join(text)
message = drymail.Message( subject = SUBJECT.format(str(state))
sender=("Certbot renewal bot", "notify@dennogumi.org"), message = drymail.Message(
receivers=["root"], sender=("Certbot renewal bot", "notify@dennogumi.org"),
subject=subject, receivers=["root"],
headers=HEADER, subject=subject,
text=text headers=HEADER,
) text=text
)
client = drymail.SMTPMailer( client = drymail.SMTPMailer(
host='localhost') host='localhost')