aboutsummaryrefslogtreecommitdiff
path: root/src/smtp_server.rs
Commit message (Collapse)AuthorAge
* Add a note on email encodingsMroik2026-04-13
| | | | | | | | | | | | | 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>
* Replace std socket IO with tokio socket IOMroik2026-04-13
| | | | | | | | | | | 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>
* Do not propagate TcpListener.accept() errorsMroik2026-04-13
| | | | | | | | | | | | 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>
* Add mail processing scaffoldingMroik2026-04-13
| | | | | | | | | | 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>
* Rename modules to more accurate namesMroik2026-04-13
Signed-off-by: Mroik <mroik@delayed.space>
XMR address: 854DmXNrxULU3ZFJVs4Wc8PFhbq29RhqHhY8W6cdWrtFN3qmooKyyeYPcDzZTNRxphhJ5UzASQfAdEMwSteVqymk28aLhqj