diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2015-09-23 15:36:32 -0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-09-23 15:21:19 -0400 |
commit | 1b8e9f5d6df6aedd3566069d9d27adc1d8ad771d (patch) | |
tree | 9f6b8ffdcaabd5b6f8942fa8e235071de256f5cb /src/leap/mail/imap | |
parent | 36ef9dc7f9894a2578e8697e4b20e7e808c63f5b (diff) |
[feat] disable local-only bind on docker container
- Related: #7471
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r-- | src/leap/mail/imap/service/imap.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py index cd31edf..a50611b 100644 --- a/src/leap/mail/imap/service/imap.py +++ b/src/leap/mail/imap/service/imap.py @@ -158,8 +158,14 @@ def run_service(store, **kwargs): factory = LeapIMAPFactory(uuid, userid, store) try: + interface = "localhost" + # don't bind just to localhost if we are running on docker since we + # won't be able to access imap from the host + if os.environ.get("LEAP_DOCKERIZED"): + interface = '' + tport = reactor.listenTCP(port, factory, - interface="localhost") + interface=interface) except CannotListenError: logger.error("IMAP Service failed to start: " "cannot listen in port %s" % (port,)) |