aiosmtpd
aiosmtpd copied to clipboard
Request support for closing and re-opening SMTP listen port
So far I haven't found an orderly way to close down the listening SMTP port, and re-open it at a later stage.
If this ability could be provided through methods, it would help in a lot of cases.
Hmm, that's a nice feature... Currently the only way is to end the instance then recreate it again.
Might need some intensive rewrites, though. I think this will be a good feature to add to 1.5.0
In my use case, I've had the SMTP listener spawned by systemd. The only way to close then re-open the port, is for the process to fall on its sword, then let systemd automatically restart it. This is not among the most elegant solutions I've contrived in my time.
In my use case, I've had the SMTP listener spawned by systemd. The only way to close then re-open the port, is for the process to fall on its sword, then let systemd automatically restart it. This is not among the most elegant solutions I've contrived in my time.
Another way is for your enclosing program to capture SIGUSR1 or SIGUSR2 (or heck, SIGWINCH) wherein the enclosing program will perform Controller shutdown & restart.