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