| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
| |
It logs anytime we break out of the loop, therefore logging a connection
closed by remote regardless of what happened.
Move logging to closed connection check and make it a warn instead of an
info.
Signed-off-by: Mroik <mroik@delayed.space>
|
| |
|
|
| |
Signed-off-by: Mroik <mroik@delayed.space>
|
| |
|
|
|
|
| |
The replies do not end with <CRLF>. Fix it.
Signed-off-by: Mroik <mroik@delayed.space>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Leave a note for future devs that the server might receive an email with
an encoding different from ASCII or UTF-8. This can be problematic as
String accepts only UTF-8 valid strings.
In TODO when I say "handle non UTF-8 encodings", I think it would be
totally ok to just disregard anything that isn't UTF-8 and return a
"rejected for policy" error to the MTA. Otherwise we'll just have to put
`encoding_rs` in the mix.
Signed-off-by: Mroik <mroik@delayed.space>
|
| |
|
|
|
|
|
|
|
|
|
| |
Since the TcpListener (and related) operations are blocking, they would
prevent other tasks from running by monopolizing CPU time.
This should've been done from the start but I'm not used to directly
using low level primitives in an async environment as I would normally
use a high level library for this, so I forgot.
Signed-off-by: Mroik <mroik@delayed.space>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Errors produced by the socket may not be necessarily fatal, meaning that
while a connection might be dropped the process should be able to resume
execution as if nothing happened and accept the next connection.
Error handling for accept() has been copied from NGINX's [1].
[1] https://stackoverflow.com/questions/76955978/which-socket-accept-errors-are-fatal
Signed-off-by: Mroik <mroik@delayed.space>
|
| |
|
|
|
|
|
|
|
|
| |
After receiving the email we don't want to process it in the same thread
as soon as we can, instead we queue it to a MailProcessor. This allows
us to be more flexible with the pipeline and reduce the amount of
concurrency for the database connection. This also helps with writing
possible fences around resource consumption.
Signed-off-by: Mroik <mroik@delayed.space>
|
|
|
Signed-off-by: Mroik <mroik@delayed.space>
|