Commits

Greg Ward committed 8125555

Fix so netcat only listens on localhost interface.
No need to expose exim's test SMTP interface to the whole wide Internet.

  • Participants
  • Parent commits 911891b

Comments (0)

Files changed (1)

src/eximunit/smtp.py

         # first, spawn nc wrapping the exim debug session on a spare local port
         # TODO redirect exim stderr to a file we can fish it out of
         port = findFreePorts()[0]
-        ncCmd = ['nc', '-l', '-p', str(port), '-c', '/usr/sbin/exim4 -bhc %s 2>exim-debug.log' % self.fromHost]
+        ncCmd = ['nc', '-l', '-p', str(port), '-s', '127.0.0.1',
+                 '-c', '/usr/sbin/exim4 -bhc %s 2>exim-debug.log' % self.fromHost]
         if self.debuglevel > 0:
             print "Spawning exim on port %s with incoming address %s" % (port, self.fromHost)
         ncProcess = Popen(ncCmd, stdout=PIPE)