From 3e0946743dc794fedcd578729a8c32fdbd69e577 Mon Sep 17 00:00:00 2001 From: mdecimus Date: Fri, 30 Aug 2024 19:50:06 +0200 Subject: [PATCH] Allow localhost to override HTTP access controls + change sieve runtime error default log level --- crates/jmap/src/api/http.rs | 7 ++++++- crates/trc/src/event/level.rs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/jmap/src/api/http.rs b/crates/jmap/src/api/http.rs index c758fadc..f73b069e 100644 --- a/crates/jmap/src/api/http.rs +++ b/crates/jmap/src/api/http.rs @@ -63,7 +63,12 @@ impl JMAP { let ctx = HttpContext::new(&session, &req); match ctx.has_endpoint_access(&self.core).await { StatusCode::OK => (), - status => return Ok(status.into_http_response()), + status => { + // Allow lookup to avoid lockout + if !session.remote_ip.is_loopback() { + return Ok(status.into_http_response()); + } + } } match path.next().unwrap_or_default() { diff --git a/crates/trc/src/event/level.rs b/crates/trc/src/event/level.rs index e4de67e1..5e553255 100644 --- a/crates/trc/src/event/level.rs +++ b/crates/trc/src/event/level.rs @@ -325,11 +325,11 @@ impl EventType { | SieveEvent::QuotaExceeded | SieveEvent::ListNotFound | SieveEvent::ScriptNotFound - | SieveEvent::RuntimeError | SieveEvent::MessageTooLarge => Level::Warn, SieveEvent::SendMessage => Level::Info, SieveEvent::UnexpectedError => Level::Error, SieveEvent::ActionAccept + | SieveEvent::RuntimeError | SieveEvent::ActionAcceptReplace | SieveEvent::ActionDiscard | SieveEvent::ActionReject => Level::Debug,