1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-11-27 22:18:22 +02:00

fetchmail: print unhandled exceptions, but don't crash

refs #1295
This commit is contained in:
Alexander A. Klimov
2020-01-05 14:00:00 +01:00
parent b8b1699f9e
commit 313e98c1a2

View File

@@ -8,6 +8,7 @@ import subprocess
import re
import requests
import sys
import traceback
FETCHMAIL = """
@@ -45,6 +46,7 @@ def fetchmail(fetchmailrc):
def run(debug):
try:
fetches = requests.get("http://admin/internal/fetch").json()
smtphost, smtpport = extract_host_port(os.environ.get("HOST_SMTP", "smtp"), None)
if smtpport is None:
@@ -86,6 +88,8 @@ def run(debug):
requests.post("http://admin/internal/fetch/{}".format(fetch["id"]),
json=error_message.split("\n")[0]
)
except Exception:
traceback.print_exc()
if __name__ == "__main__":