* Implement graceful shutdown
This borrows heavily from the implementation of net/http Server.Shutdown().
Closes#10
* Add Server.Address() function to return listener address of a Server
This is useful for logging, etc.
* Refactor out Server.Wait() and add 'wait' param to Shutdown()
This allows a consumer which runs multiple Servers (decke/smtprelay) to
first shut down all servers (passing wait=false) so no new connections are
accepted, and then wait for outstanding client connections to finish.
* Verify that user is properly authenticated before sending mail if AUTH is required
* Add testcase to verify that user is properly authenticated before sending mail if authenticator is setup
* Fix TestErrors() to not misuse auth bypass
Timon Relitzki reported that some systems, for example the Synology
DSM Rackstations, will send an extra space character with their SMTP
commands.
MAIL FROM:<christian@technobabble.dk>
Becomes:
MAIL FROM: <christian@technobabble.dk>
This confused the command parser. In the spirit of the robustness
principle if have choosen to improve the command parse to also handle
these extra spaces.
The command parser has also been extended with some extra unit tests,
to demonstrate the problem.