diff --git a/_modules/parsedmarc.html b/_modules/parsedmarc.html index 429b5b5..336e1bd 100644 --- a/_modules/parsedmarc.html +++ b/_modules/parsedmarc.html @@ -1626,9 +1626,8 @@ server.login(username, password) imap_capabilities = get_imap_capabilities(server) if "IDLE" not in imap_capabilities: - logger.error("Cannot watch inbox: IMAP server does not support " - "the IDLE command") - exit(1) + raise IMAPError("Cannot watch inbox: IMAP server does not support " + "the IDLE command") ms = "MOVE" in imap_capabilities server.select_folder(rf) @@ -1707,13 +1706,21 @@ except ssl.CertificateError as error: raise IMAPError("Certificate error: {0}".format(error.__str__())) except BrokenPipeError: - raise IMAPError("Broken pipe") + logger.debug("IMAP error: Broken pipe") + logger.debug("Reconnecting watcher") + watch_inbox(host, username, password, callback, + reports_folder=reports_folder, + archive_folder=archive_folder, + delete=delete, + test=test, + wait=wait, + nameservers=nameservers, + dns_timeout=dns_timeout) except KeyboardInterrupt: break try: server.idle_done() - logger.info("IMAP: Sending DONE") server.logout() except BrokenPipeError: pass diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt index 7352b3f..ba79aa5 100644 --- a/_sources/index.rst.txt +++ b/_sources/index.rst.txt @@ -588,6 +588,7 @@ Create the service configuration file RestartSec=5m [Install] + After=elasticsearch.service WantedBy=multi-user.target Edit the command line options of ``parsedmarc`` in the service's ``ExecStart`` diff --git a/index.html b/index.html index 29dcb76..5ceb89b 100644 --- a/index.html +++ b/index.html @@ -636,6 +636,7 @@ arrive.
RestartSec=5m [Install] +After=elasticsearch.service WantedBy=multi-user.target