Unverified Commit d777231c authored by Isis Lovecruft's avatar Isis Lovecruft
Browse files

Consider it a fatal error if we can't listen on the configured EMAIL_PORT.

parent 80f10af2
......@@ -23,6 +23,7 @@ import socket
from twisted.internet import defer
from twisted.internet import reactor
from twisted.internet.error import CannotListenError
from twisted.internet.task import LoopingCall
from twisted.mail import smtp
from twisted.mail.smtp import rfc822date
......@@ -418,7 +419,11 @@ def addServer(config, distributor, schedule):
addr = config.EMAIL_BIND_IP or ""
port = config.EMAIL_PORT
reactor.listenTCP(port, factory, interface=addr)
reactor.listenTCP(port, factory, interface=addr)
except CannotListenError as error:
raise SystemExit(error.message)
# Set up a LoopingCall to run every 30 minutes and forget old email times.
lc = LoopingCall(distributor.cleanDatabase)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment