aboutsummaryrefslogtreecommitdiff
path: root/src/imap/mod.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-08 22:46:39 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-08 22:46:39 +0100
commitd49a2355f71fe555a67a815c31800f901a0d0a71 (patch)
treec22c2a22af5aa235e538274344f3eb2b451bf774 /src/imap/mod.rs
parent356776cba35c450f6f7be9382c44df6d7b752ef1 (diff)
downloadaerogramme-d49a2355f71fe555a67a815c31800f901a0d0a71.tar.gz
aerogramme-d49a2355f71fe555a67a815c31800f901a0d0a71.zip
Reject \n alone, require \r\n
Diffstat (limited to 'src/imap/mod.rs')
-rw-r--r--src/imap/mod.rs9
1 files 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",