aiosmtpd icon indicating copy to clipboard operation
aiosmtpd copied to clipboard

Request support for closing and re-opening SMTP listen port

Open davidmcnabnz opened this issue 2 years ago • 3 comments
trafficstars

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.

davidmcnabnz avatar Dec 16 '22 06:12 davidmcnabnz

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

pepoluan avatar Dec 16 '22 08:12 pepoluan

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.

davidmcnabnz avatar Dec 16 '22 10:12 davidmcnabnz

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.

pepoluan avatar Dec 16 '22 12:12 pepoluan