From 7eaa7c3ce8908d452147621e79fbc97155efb445 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 8 Jan 2024 22:44:48 +0100 Subject: Refuse \n without \r --- src/imap/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/imap/mod.rs b/src/imap/mod.rs index 4142ef9..2640183 100644 --- a/src/imap/mod.rs +++ b/src/imap/mod.rs @@ -20,7 +20,7 @@ use futures::stream::{FuturesUnordered, StreamExt}; use tokio::net::TcpListener; use tokio::sync::watch; -use imap_codec::imap_types::response::Greeting; +use imap_codec::imap_types::{core::Text, response::Greeting}; use imap_flow::server::{ServerFlow, ServerFlowEvent, ServerFlowOptions}; use imap_flow::stream::AnyStream; @@ -108,7 +108,12 @@ async fn client(mut ctx: ClientContext) -> Result<()> { // Send greeting let (mut server, _) = ServerFlow::send_greeting( ctx.stream, - ServerFlowOptions::default(), + ServerFlowOptions { + crlf_relaxed: false, + literal_accept_text: Text::unvalidated("OK"), + literal_reject_text: Text::unvalidated("Literal rejected"), + ..ServerFlowOptions::default() + }, Greeting::ok( Some(Code::Capability(ctx.server_capabilities.to_vec())), "Aerogramme", -- cgit v1.2.3