ReachFive / fake-smtp-server

Fake SMTP Server for email testing
https://www.npmjs.com/package/fake-smtp-server
MIT License
192 stars 81 forks source link

Be able to use dynamic port #80

Open thomasjm opened 12 months ago

thomasjm commented 12 months ago

This PR makes it possible to use dynamically chosen ports by passing --http-port 0 and --smtp-port 0. It's useful to allow the OS to choose the ports when you want to run different SMTP tests concurrently without running into port collisions.

To support this, I added the flags --http-port-file and --smtp-port-file. These files will be written with the chosen ports when the servers start up, and can then be read by your test harness code.