diff --git a/stubs/cmdtests/smtpd.script b/stubs/cmdtests/smtpd.script index 79541da..659732a 100755 --- a/stubs/cmdtests/smtpd.script +++ b/stubs/cmdtests/smtpd.script @@ -51,7 +51,7 @@ def main(): env['STUB_SMTPD_DATADIR'] = smtpddir smtpd = subprocess.Popen([os.path.join(stubdir, 'smtpd'), '--port=4321'], - env=env) + stdin=subprocess.DEVNULL, env=env) time.sleep(1) diff --git a/stubs/smtpd b/stubs/smtpd index 1c8e8ad..9c0c337 100755 --- a/stubs/smtpd +++ b/stubs/smtpd @@ -36,6 +36,7 @@ import aiosmtpd.controller import os import os.path import sys +import signal datadir = None @@ -81,8 +82,9 @@ def run(args): # Run the event loop in a separate thread. controller.start() - # Wait for the user to press Return. - input() + # wait until a signal is received + signal.pause() + controller.stop()