Commit Graph

12 Commits

Author SHA1 Message Date
23f0d67abe
Remove broken example, refactor code, fix module path 2022-02-01 05:19:11 -08:00
Jonathon Reinhart
b5f17a69f6
Implement graceful shutdown (#11)
* 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.
2021-03-29 10:24:55 +02:00
Bernhard Fröhlich
32be721d71
Verify that user is properly authenticated before sending mail if AUTH is required (#6)
* 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
2020-06-07 18:48:25 +02:00
Christian Joergensen
724b678a1a New test certificate. Better logging in tests. 2020-05-21 18:44:04 +02:00
Bernhard Froehlich
6323615a6b
Fix testsuite for Received line test 2018-12-14 13:43:03 +00:00
Christian Joergensen
f70a0c8d52 Removing personal e-mail from comments and tests. 2018-09-26 21:22:28 +02:00
Christian Joergensen
6441050e00 Added extra and cleaned old test cases for pull request #3. 2018-09-26 21:10:58 +02:00
Christian Joergensen
722e9f7848 Also set Peer.TLS connection state on raw TLS connections.
Fix double underscore typo.
2017-10-10 10:10:59 +02:00
Christian Joergensen
52e449011b Support TLS listeners (fixes issue #2). 2017-10-09 20:05:15 +02:00
Christoffer G. Thomsen
2987b286a4 Update import paths for move to GitHub 2017-08-20 18:05:24 +02:00
Christian Joergensen
b564e87572 Improve the command parser to try to parse malformed commands.
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.
2017-05-23 21:42:13 +02:00
Craig
66f94a07ae Fix several panics on invalid input 2016-02-12 01:26:50 +00:00