|
|
|
@ -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__":
|
|
|
|
|