summaryrefslogtreecommitdiff
path: root/crates/smtp
diff options
context:
space:
mode:
authormdecimus <mauro@stalw.art>2024-07-17 18:33:22 +0200
committermdecimus <mauro@stalw.art>2024-07-17 18:33:22 +0200
commitd2ad44cf9f085db5b067338d560291db667aeaa9 (patch)
treec5fd2b3859a70f0cda86668379d954b4c1a92d25 /crates/smtp
parente74b29189a45c4afb6b204fced1b07032b16af61 (diff)
Improved error handling (part 3)
Diffstat (limited to 'crates/smtp')
-rw-r--r--crates/smtp/src/inbound/auth.rs6
-rw-r--r--crates/smtp/src/inbound/vrfy.rs4
-rw-r--r--crates/smtp/src/queue/spool.rs2
-rw-r--r--crates/smtp/src/reporting/scheduler.rs2
4 files changed, 7 insertions, 7 deletions
diff --git a/crates/smtp/src/inbound/auth.rs b/crates/smtp/src/inbound/auth.rs
index ec33d866..052235e2 100644
--- a/crates/smtp/src/inbound/auth.rs
+++ b/crates/smtp/src/inbound/auth.rs
@@ -196,7 +196,7 @@ impl<T: SessionStream> Session<T> {
return Ok(false);
}
Err(err) => match err.as_ref() {
- trc::Cause::Authentication => {
+ trc::Cause::Auth(trc::AuthCause::Failed) => {
tracing::debug!(
parent: &self.span,
context = "auth",
@@ -208,7 +208,7 @@ impl<T: SessionStream> Session<T> {
.auth_error(b"535 5.7.8 Authentication credentials invalid.\r\n")
.await;
}
- trc::Cause::MissingTotp => {
+ trc::Cause::Auth(trc::AuthCause::MissingTotp) => {
tracing::debug!(
parent: &self.span,
context = "auth",
@@ -222,7 +222,7 @@ impl<T: SessionStream> Session<T> {
)
.await;
}
- trc::Cause::Banned => {
+ trc::Cause::Auth(trc::AuthCause::Banned) => {
tracing::debug!(
parent: &self.span,
context = "auth",
diff --git a/crates/smtp/src/inbound/vrfy.rs b/crates/smtp/src/inbound/vrfy.rs
index dfc722b7..bf6126fa 100644
--- a/crates/smtp/src/inbound/vrfy.rs
+++ b/crates/smtp/src/inbound/vrfy.rs
@@ -57,7 +57,7 @@ impl<T: SessionStream> Session<T> {
event = "temp-fail",
address = &address);
- if !err.matches(trc::Cause::Unsupported) {
+ if !err.matches(trc::Cause::Store(trc::StoreCause::NotSupported)) {
self.write(b"252 2.4.3 Unable to verify address at this time.\r\n")
.await
} else {
@@ -122,7 +122,7 @@ impl<T: SessionStream> Session<T> {
event = "temp-fail",
address = &address);
- if !err.matches(trc::Cause::Unsupported) {
+ if !err.matches(trc::Cause::Store(trc::StoreCause::NotSupported)) {
self.write(b"252 2.4.3 Unable to expand mailing list at this time.\r\n")
.await
} else {
diff --git a/crates/smtp/src/queue/spool.rs b/crates/smtp/src/queue/spool.rs
index a6758ff1..e3ea8f10 100644
--- a/crates/smtp/src/queue/spool.rs
+++ b/crates/smtp/src/queue/spool.rs
@@ -127,7 +127,7 @@ impl SMTP {
);
match self.core.storage.data.write(batch.build()).await {
Ok(_) => Some(event),
- Err(err) if err.matches(trc::Cause::AssertValue) => {
+ Err(err) if err.is_assertion_failure() => {
tracing::debug!(
context = "queue",
event = "locked",
diff --git a/crates/smtp/src/reporting/scheduler.rs b/crates/smtp/src/reporting/scheduler.rs
index 3b198928..7000f376 100644
--- a/crates/smtp/src/reporting/scheduler.rs
+++ b/crates/smtp/src/reporting/scheduler.rs
@@ -173,7 +173,7 @@ impl SMTP {
);
match self.core.storage.data.write(batch.build()).await {
Ok(_) => true,
- Err(err) if err.matches(trc::Cause::AssertValue) => {
+ Err(err) if err.is_assertion_failure() => {
tracing::debug!(
context = "queue",
event = "locked",