From c04b16a601c180c768cee805363ae0c6985d767a Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 21 Jun 2022 11:26:04 +0200 Subject: [PATCH] Update smtp-server with new LMTP server API --- Cargo.lock | 6 +++--- src/lmtp.rs | 16 ++-------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b9e9ca..a5364b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "smtp-message" version = "0.1.0" -source = "git+http://github.com/Alexis211/kannader?branch=feature/lmtp#8c01360230f21c20d4c2da462dcf62e8a801ce0f" +source = "git+http://github.com/Alexis211/kannader?branch=feature/lmtp#245cd13212db727d4085768b813a0ee09a137bc3" dependencies = [ "auto_enums", "futures", @@ -2121,7 +2121,7 @@ dependencies = [ [[package]] name = "smtp-server" version = "0.1.0" -source = "git+http://github.com/Alexis211/kannader?branch=feature/lmtp#8c01360230f21c20d4c2da462dcf62e8a801ce0f" +source = "git+http://github.com/Alexis211/kannader?branch=feature/lmtp#245cd13212db727d4085768b813a0ee09a137bc3" dependencies = [ "async-trait", "chrono", @@ -2135,7 +2135,7 @@ dependencies = [ [[package]] name = "smtp-server-types" version = "0.1.0" -source = "git+http://github.com/Alexis211/kannader?branch=feature/lmtp#8c01360230f21c20d4c2da462dcf62e8a801ce0f" +source = "git+http://github.com/Alexis211/kannader?branch=feature/lmtp#245cd13212db727d4085768b813a0ee09a137bc3" dependencies = [ "serde", "smtp-message", diff --git a/src/lmtp.rs b/src/lmtp.rs index 049e119..55da3ee 100644 --- a/src/lmtp.rs +++ b/src/lmtp.rs @@ -88,7 +88,7 @@ pub struct Message { #[async_trait] impl Config for LmtpServer { - const PROTOCOL: Protocol = Protocol::Lmtp; + type Protocol = smtp_server::protocol::Lmtp; type ConnectionUserMeta = Conn; type MailUserMeta = Message; @@ -155,19 +155,7 @@ impl Config for LmtpServer { } } - async fn handle_mail<'a, R>( - &self, - reader: &mut EscapedDataReader<'a, R>, - _mail: MailMetadata, - _conn_meta: &mut ConnectionMetadata, - ) -> Decision<()> - where - R: Send + Unpin + AsyncRead, - { - unreachable!(); - } - - async fn handle_mail_multi<'a, 'slife0, 'slife1, 'stream, R>( + async fn handle_mail<'a, 'slife0, 'slife1, 'stream, R>( &'slife0 self, reader: &mut EscapedDataReader<'a, R>, meta: MailMetadata,