public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox 02/55] notify: refactor error type
Date: Fri, 13 Nov 2026 16:07:35 +0100	[thread overview]
Message-ID: <20261113150828.756836-3-l.wagner@proxmox.com> (raw)
In-Reply-To: <20261113150828.756836-1-l.wagner@proxmox.com>

The old Error type was quite annoying to use which is why it was
replaced by a new one. Instead of manually implementing the expected
interfaces, this time we use the `thiserror` crate to derive the
appropriate implementations.

While this is technically a breaking change, none of the existing users
of proxmox-notify match on any concrete error variants, so this change
does not require any modifications in application code. Some error
messages change slightly due to the restructuring of error variants.

One noteworthy change is that the implementations of the Context trait
do not return `Error` anymore, instead, they return a Box<dyn Error>,
which is then wrapped into an appropriate variant of the crate-owned
Error type wherever a context method is called. This is a deliberate
design decision. Eventually, the implementations of Context should live
in the application code, and I want to refrain from instantiating
proxmox_notify::Error in application code.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-notify/Cargo.toml                |   1 +
 proxmox-notify/src/api/common.rs         |   4 +-
 proxmox-notify/src/config.rs             |   9 +-
 proxmox-notify/src/context/mod.rs        |   9 +-
 proxmox-notify/src/context/pbs.rs        |   8 +-
 proxmox-notify/src/context/pve.rs        |  13 +-
 proxmox-notify/src/context/test.rs       |   4 +-
 proxmox-notify/src/endpoints/gotify.rs   |   7 +-
 proxmox-notify/src/endpoints/sendmail.rs |  10 +-
 proxmox-notify/src/endpoints/smtp.rs     |  42 +++---
 proxmox-notify/src/endpoints/webhook.rs  |  44 +++---
 proxmox-notify/src/error.rs              | 165 +++++++++++++++++++++++
 proxmox-notify/src/lib.rs                |  75 +----------
 proxmox-notify/src/matcher/calendar.rs   |   4 +-
 proxmox-notify/src/matcher/field.rs      |  29 ++--
 proxmox-notify/src/matcher/mod.rs        |  22 +--
 proxmox-notify/src/matcher/severity.rs   |   8 +-
 proxmox-notify/src/renderer/mod.rs       |  11 +-
 18 files changed, 294 insertions(+), 171 deletions(-)
 create mode 100644 proxmox-notify/src/error.rs

diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml
index 326f5f9e5..6796c2915 100644
--- a/proxmox-notify/Cargo.toml
+++ b/proxmox-notify/Cargo.toml
@@ -25,6 +25,7 @@ regex.workspace = true
 serde = { workspace = true, features = ["derive"] }
 serde_json.workspace = true
 serde_regex.workspace = true
+thiserror.workspace = true
 
 proxmox-api-macro.workspace = true
 proxmox-base64 = { workspace = true, optional = true }
diff --git a/proxmox-notify/src/api/common.rs b/proxmox-notify/src/api/common.rs
index fa2356e2a..bc89695f8 100644
--- a/proxmox-notify/src/api/common.rs
+++ b/proxmox-notify/src/api/common.rs
@@ -1,7 +1,7 @@
 use proxmox_http_error::HttpError;
 
 use super::http_err;
-use crate::{Bus, Config, Notification};
+use crate::{Bus, Config, Error, Notification};
 
 /// Send a notification to a given target.
 ///
@@ -33,7 +33,7 @@ pub fn test_target(config: &Config, endpoint: &str) -> Result<(), HttpError> {
     })?;
 
     bus.test_target(endpoint).map_err(|err| match err {
-        crate::Error::TargetDoesNotExist(endpoint) => {
+        Error::TargetDoesNotExist(endpoint) => {
             http_err!(NOT_FOUND, "endpoint '{endpoint}' does not exist")
         }
         _ => http_err!(INTERNAL_SERVER_ERROR, "Could not test target: {err}"),
diff --git a/proxmox-notify/src/config.rs b/proxmox-notify/src/config.rs
index 952e77262..c280e8285 100644
--- a/proxmox-notify/src/config.rs
+++ b/proxmox-notify/src/config.rs
@@ -124,7 +124,7 @@ pub fn config(raw_config: &str) -> Result<(SectionConfigData, [u8; 32]), Error>
     let digest = openssl::sha::sha256(raw_config.as_bytes());
     let data = config_parser()
         .parse("notifications.cfg", raw_config)
-        .map_err(|err| Error::ConfigDeserialization(err.into()))?;
+        .map_err(Error::config_deserialization)?;
 
     Ok((data, digest))
 }
@@ -133,18 +133,19 @@ pub fn private_config(raw_config: &str) -> Result<(SectionConfigData, [u8; 32]),
     let digest = openssl::sha::sha256(raw_config.as_bytes());
     let data = private_config_parser()
         .parse("priv/notifications.cfg", raw_config)
-        .map_err(|err| Error::ConfigDeserialization(err.into()))?;
+        .map_err(Error::config_deserialization)?;
+
     Ok((data, digest))
 }
 
 pub fn write(config: &SectionConfigData) -> Result<String, Error> {
     config_parser()
         .write("notifications.cfg", config)
-        .map_err(|err| Error::ConfigSerialization(err.into()))
+        .map_err(Error::config_serialization)
 }
 
 pub fn write_private(config: &SectionConfigData) -> Result<String, Error> {
     private_config_parser()
         .write("priv/notifications.cfg", config)
-        .map_err(|err| Error::ConfigSerialization(err.into()))
+        .map_err(Error::config_serialization)
 }
diff --git a/proxmox-notify/src/context/mod.rs b/proxmox-notify/src/context/mod.rs
index 87a2a7165..a81a35caa 100644
--- a/proxmox-notify/src/context/mod.rs
+++ b/proxmox-notify/src/context/mod.rs
@@ -1,7 +1,7 @@
 use std::fmt::Debug;
 use std::sync::Mutex;
 
-use crate::Error;
+use crate::error::BoxedError;
 use crate::renderer::TemplateSource;
 
 #[cfg(any(feature = "pve-context", feature = "pbs-context"))]
@@ -13,6 +13,11 @@ pub mod pve;
 #[cfg(test)]
 mod test;
 
+// NOTE: Don't use proxmox_notify::Error in this trait, rather return a [`BoxedError`]. You
+// may wrap the boxed error into an appropriate variant of proxmox_notify::Error at
+// the callsite, but product-code (which includes the trait implementations of Context) should
+// not have to instantiate proxmox_notify::Error themselves.
+
 /// Product-specific context
 pub trait Context: Send + Sync + Debug {
     /// Look up a user's email address from users.cfg
@@ -31,7 +36,7 @@ pub trait Context: Send + Sync + Debug {
         filename: &str,
         namespace: Option<&str>,
         source: TemplateSource,
-    ) -> Result<Option<String>, Error>;
+    ) -> Result<Option<String>, BoxedError>;
 }
 
 #[cfg(not(test))]
diff --git a/proxmox-notify/src/context/pbs.rs b/proxmox-notify/src/context/pbs.rs
index a91215488..f484f90c8 100644
--- a/proxmox-notify/src/context/pbs.rs
+++ b/proxmox-notify/src/context/pbs.rs
@@ -6,8 +6,8 @@ use tracing::error;
 use proxmox_schema::{ObjectSchema, Schema, StringSchema};
 use proxmox_section_config::{SectionConfig, SectionConfigPlugin};
 
-use crate::Error;
 use crate::context::{Context, common};
+use crate::error::BoxedError;
 use crate::renderer::TemplateSource;
 
 const PBS_USER_CFG_FILENAME: &str = "/etc/proxmox-backup/user.cfg";
@@ -111,7 +111,7 @@ impl Context for PBSContext {
         filename: &str,
         namespace: Option<&str>,
         source: TemplateSource,
-    ) -> Result<Option<String>, Error> {
+    ) -> Result<Option<String>, BoxedError> {
         let path = match source {
             TemplateSource::Vendor => "/usr/share/proxmox-backup/templates",
             TemplateSource::Override => "/etc/proxmox-backup/notification-templates",
@@ -121,8 +121,8 @@ impl Context for PBSContext {
             .join(namespace.unwrap_or("default"))
             .join(filename);
 
-        let template_string = proxmox_sys::fs::file_read_optional_string(path)
-            .map_err(|err| Error::Generic(format!("could not load template: {err}")))?;
+        let template_string = proxmox_sys::fs::file_read_optional_string(path)?;
+
         Ok(template_string)
     }
 }
diff --git a/proxmox-notify/src/context/pve.rs b/proxmox-notify/src/context/pve.rs
index 3d9ff92e9..ba84da920 100644
--- a/proxmox-notify/src/context/pve.rs
+++ b/proxmox-notify/src/context/pve.rs
@@ -1,8 +1,9 @@
-use crate::Error;
-use crate::context::{Context, common};
-use crate::renderer::TemplateSource;
 use std::path::Path;
 
+use crate::context::{Context, common};
+use crate::error::BoxedError;
+use crate::renderer::TemplateSource;
+
 fn lookup_mail_address(content: &str, user: &str) -> Option<String> {
     common::normalize_for_return(content.lines().find_map(|line| {
         let fields: Vec<&str> = line.split(':').collect();
@@ -60,7 +61,7 @@ impl Context for PVEContext {
         filename: &str,
         namespace: Option<&str>,
         source: TemplateSource,
-    ) -> Result<Option<String>, Error> {
+    ) -> Result<Option<String>, BoxedError> {
         let path = match source {
             TemplateSource::Vendor => "/usr/share/pve-manager/templates",
             TemplateSource::Override => "/etc/pve/notification-templates",
@@ -70,8 +71,8 @@ impl Context for PVEContext {
             .join(namespace.unwrap_or("default"))
             .join(filename);
 
-        let template_string = proxmox_sys::fs::file_read_optional_string(path)
-            .map_err(|err| Error::Generic(format!("could not load template: {err}")))?;
+        let template_string = proxmox_sys::fs::file_read_optional_string(path)?;
+
         Ok(template_string)
     }
 }
diff --git a/proxmox-notify/src/context/test.rs b/proxmox-notify/src/context/test.rs
index 22da38d3e..7380a0545 100644
--- a/proxmox-notify/src/context/test.rs
+++ b/proxmox-notify/src/context/test.rs
@@ -1,5 +1,5 @@
-use crate::Error;
 use crate::context::Context;
+use crate::error::BoxedError;
 use crate::renderer::TemplateSource;
 
 #[derive(Debug)]
@@ -37,7 +37,7 @@ impl Context for TestContext {
         _filename: &str,
         _namespace: Option<&str>,
         _source: TemplateSource,
-    ) -> Result<Option<String>, Error> {
+    ) -> Result<Option<String>, BoxedError> {
         Ok(Some(String::new()))
     }
 }
diff --git a/proxmox-notify/src/endpoints/gotify.rs b/proxmox-notify/src/endpoints/gotify.rs
index 7d0f5cdc6..5ef82fd01 100644
--- a/proxmox-notify/src/endpoints/gotify.rs
+++ b/proxmox-notify/src/endpoints/gotify.rs
@@ -129,7 +129,8 @@ impl Endpoint for GotifyEndpoint {
         });
 
         let body = serde_json::to_vec(&body)
-            .map_err(|err| Error::NotifyFailed(self.name().to_string(), err.into()))?;
+            .map_err(|err| Error::other_with_source("could not serialize JSON body", err))?;
+
         let extra_headers = HashMap::from([
             (
                 http::header::AUTHORIZATION.to_string(),
@@ -146,7 +147,7 @@ impl Endpoint for GotifyEndpoint {
             .http_proxy_config()
             .map(|url| ProxyConfig::parse_proxy_url(&url))
             .transpose()
-            .map_err(|err| Error::NotifyFailed(self.name().to_string(), err.into()))?;
+            .map_err(|err| Error::invalid_config_with_source("invalid proxy configuration", err))?;
 
         let options = HttpOptions {
             proxy_config,
@@ -163,7 +164,7 @@ impl Endpoint for GotifyEndpoint {
                 Some("application/json"),
                 Some(&extra_headers),
             )
-            .map_err(|err| Error::NotifyFailed(self.name().to_string(), err.into()))?;
+            .map_err(Error::http_request_failed)?;
 
         Ok(())
     }
diff --git a/proxmox-notify/src/endpoints/sendmail.rs b/proxmox-notify/src/endpoints/sendmail.rs
index 4f26a1214..70f37eced 100644
--- a/proxmox-notify/src/endpoints/sendmail.rs
+++ b/proxmox-notify/src/endpoints/sendmail.rs
@@ -141,13 +141,15 @@ impl Endpoint for SendmailEndpoint {
 
                 recipients_str.iter().for_each(|r| mail.add_recipient(r));
 
-                mail.send()
-                    .map_err(|err| Error::NotifyFailed(self.config.name.clone(), err.into()))
+                mail.send().map_err(|err| {
+                    Error::other_with_source("could not send mail via sendmail", err)
+                })
             }
             #[cfg(feature = "mail-forwarder")]
             Content::ForwardedMail { raw, uid, .. } => {
-                Mail::forward(&recipients_str, &mailfrom, raw, *uid)
-                    .map_err(|err| Error::NotifyFailed(self.config.name.clone(), err.into()))
+                Mail::forward(&recipients_str, &mailfrom, raw, *uid).map_err(|err| {
+                    Error::other_with_source("could not forward mail via sendmail", err)
+                })
             }
         }
     }
diff --git a/proxmox-notify/src/endpoints/smtp.rs b/proxmox-notify/src/endpoints/smtp.rs
index b3d6e103c..49617e70c 100644
--- a/proxmox-notify/src/endpoints/smtp.rs
+++ b/proxmox-notify/src/endpoints/smtp.rs
@@ -160,7 +160,7 @@ pub struct SmtpEndpoint {
 impl Endpoint for SmtpEndpoint {
     fn send(&self, notification: &Notification) -> Result<(), Error> {
         let tls_parameters = TlsParameters::new(self.config.server.clone())
-            .map_err(|err| Error::NotifyFailed(self.name().into(), Box::new(err)))?;
+            .map_err(|err| Error::invalid_config_with_source("invalid smtp server URL", err))?;
 
         let (port, tls) = match self.config.mode.unwrap_or_default() {
             SmtpMode::Insecure => {
@@ -186,11 +186,8 @@ impl Endpoint for SmtpEndpoint {
             if let Some(password) = self.private_config.password.as_deref() {
                 transport_builder = transport_builder.credentials((username, password).into());
             } else {
-                return Err(Error::NotifyFailed(
-                    self.name().into(),
-                    Box::new(Error::Generic(
-                        "username is set but no password was provided".to_owned(),
-                    )),
+                return Err(Error::invalid_config(
+                    "username is set but no password was provided",
                 ));
             }
         }
@@ -204,8 +201,12 @@ impl Endpoint for SmtpEndpoint {
         let mail_from = self.config.from_address.clone();
 
         let parse_address = |addr: &str| -> Result<Mailbox, Error> {
-            addr.parse()
-                .map_err(|err| Error::NotifyFailed(self.name().into(), Box::new(err)))
+            addr.parse().map_err(|err| {
+                Error::invalid_config_with_source(
+                    format!("could not parse email address '{addr}'"),
+                    err,
+                )
+            })
         };
 
         let author = self
@@ -251,12 +252,12 @@ impl Endpoint for SmtpEndpoint {
                                     .body(html_part),
                             ),
                     )
-                    .map_err(|err| Error::NotifyFailed(self.name().into(), Box::new(err)))?
+                    .map_err(|err| {
+                        Error::invalid_config_with_source("could not build email message", err)
+                    })?
             }
             #[cfg(feature = "mail-forwarder")]
-            Content::ForwardedMail { raw, .. } => {
-                build_forwarded_message(email_builder, self.name(), raw)?
-            }
+            Content::ForwardedMail { raw, .. } => build_forwarded_message(email_builder, raw)?,
         };
 
         // `Auto-Submitted` is defined in RFC 5436 and describes how
@@ -268,9 +269,7 @@ impl Endpoint for SmtpEndpoint {
             "auto-generated;".into(),
         ));
 
-        transport
-            .send(&email)
-            .map_err(|err| Error::NotifyFailed(self.name().into(), err.into()))?;
+        transport.send(&email).map_err(Error::smtp_error)?;
 
         Ok(())
     }
@@ -289,7 +288,6 @@ impl Endpoint for SmtpEndpoint {
 #[cfg(feature = "mail-forwarder")]
 fn build_forwarded_message(
     email_builder: lettre::message::MessageBuilder,
-    endpoint_name: &str,
     raw: &[u8],
 ) -> Result<Message, Error> {
     use lettre::message::Body;
@@ -298,11 +296,11 @@ fn build_forwarded_message(
 
     let parsed_message = mail_parser::MessageParser::default()
         .parse(raw)
-        .ok_or_else(|| Error::Generic("could not parse forwarded email".to_string()))?;
+        .ok_or_else(|| Error::invalid_forwarded_message("could not parse forwarded email"))?;
 
     let root_part = parsed_message
         .part(0)
-        .ok_or_else(|| Error::Generic("root message part not present".to_string()))?;
+        .ok_or_else(|| Error::invalid_forwarded_message("root message part not present"))?;
 
     let raw_body = &parsed_message.raw_message()
         [root_part.offset_body as usize..root_part.offset_end as usize];
@@ -320,11 +318,13 @@ fn build_forwarded_message(
         proxmox_sendmail::normalize_line_endings(raw_body),
         ContentTransferEncoding::Binary,
     )
-    .map_err(|_| Error::Generic("could not create body".into()))?;
+    .map_err(|_| Error::invalid_forwarded_message("could not create body from raw bytes"))?;
     let mut message = email_builder
         .subject(parsed_message.subject().unwrap_or_default())
         .body(body)
-        .map_err(|err| Error::NotifyFailed(endpoint_name.into(), Box::new(err)))?;
+        .map_err(|err| {
+            Error::invalid_forwarded_message_with_source("could not build email message", err)
+        })?;
     message
         .headers_mut()
         .remove_raw("Content-Transfer-Encoding");
@@ -450,7 +450,7 @@ mod tests {
         email_builder = email_builder.to("Recipient <recipient@example.com>".parse().unwrap());
 
         let raw_mail = std::fs::read(input).unwrap();
-        let mut message = build_forwarded_message(email_builder, "test", &raw_mail).unwrap();
+        let mut message = build_forwarded_message(email_builder, &raw_mail).unwrap();
 
         // The Date header contains the current time, let's just remove it
         // for this test.
diff --git a/proxmox-notify/src/endpoints/webhook.rs b/proxmox-notify/src/endpoints/webhook.rs
index f0fd5b6ab..cbb3b1299 100644
--- a/proxmox-notify/src/endpoints/webhook.rs
+++ b/proxmox-notify/src/endpoints/webhook.rs
@@ -215,13 +215,13 @@ impl KeyAndBase64Val {
     pub fn decode_value(&self) -> Result<String, Error> {
         let value = self.value.as_deref().unwrap_or_default();
         let bytes = proxmox_base64::decode(value).map_err(|_| {
-            Error::Generic(format!(
+            Error::invalid_config(format!(
                 "could not decode base64 value with key '{}'",
                 self.name
             ))
         })?;
         let value = String::from_utf8(bytes).map_err(|_| {
-            Error::Generic(format!(
+            Error::invalid_config(format!(
                 "could not decode UTF8 string from base64, key '{}'",
                 self.name
             ))
@@ -245,7 +245,8 @@ impl Endpoint for WebhookEndpoint {
 
         self.create_client()?
             .request(request)
-            .map_err(|err| self.mask_secret_in_error(err))?;
+            .map_err(|err| self.mask_secret_in_error(err))
+            .map_err(Error::http_request_failed)?;
 
         Ok(())
     }
@@ -267,7 +268,7 @@ impl WebhookEndpoint {
             .http_proxy_config()
             .map(|url| ProxyConfig::parse_proxy_url(&url))
             .transpose()
-            .map_err(|err| Error::NotifyFailed(self.name().to_string(), err.into()))?;
+            .map_err(|err| Error::invalid_config_with_source("invalid proxy configuration", err))?;
 
         let options = HttpOptions {
             proxy_config,
@@ -322,12 +323,14 @@ impl WebhookEndpoint {
         let body = handlebars
             .render_template(&body_template, &data)
             .map_err(|err| self.mask_secret_in_error(err))
-            .map_err(|err| Error::Generic(format!("failed to render webhook body: {err}")))?;
+            .map_err(|err| {
+                Error::invalid_config(format!("failed to render webhook body: {err}"))
+            })?;
 
         let url = handlebars
             .render_template(&self.config.url, &data)
             .map_err(|err| self.mask_secret_in_error(err))
-            .map_err(|err| Error::Generic(format!("failed to render webhook url: {err}")))?;
+            .map_err(|err| Error::invalid_config(format!("failed to render webhook url: {err}")))?;
 
         let method: &str = self.config.method.into();
         let mut builder = http::Request::builder().uri(url).method(method);
@@ -339,7 +342,7 @@ impl WebhookEndpoint {
                 .render_template(&value, &data)
                 .map_err(|err| self.mask_secret_in_error(err))
                 .map_err(|err| {
-                    Error::Generic(format!(
+                    Error::invalid_config(format!(
                         "failed to render header value template: {value}: {err}"
                     ))
                 })?;
@@ -367,20 +370,21 @@ impl WebhookEndpoint {
         let request = builder
             .body(body)
             .map_err(|err| self.mask_secret_in_error(err))
-            .map_err(|err| Error::Generic(format!("failed to build http request: {err}")))?;
+            .map_err(|err| Error::invalid_config(format!("failed to build http request: {err}")))?;
 
         Ok(request)
     }
 
     fn base64_decode(&self, s: &str) -> Result<String, Error> {
-        // Also here, TODO: revisit Error variants for the *whole* crate.
-        let s = proxmox_base64::decode(s)
-            .map_err(|err| Error::Generic(format!("could not decode base64 value: {err}")))?;
+        let s = proxmox_base64::decode(s).map_err(|err| {
+            Error::invalid_config_with_source("could not decode base64 value", err)
+        })?;
 
         String::from_utf8(s).map_err(|err| {
-            Error::Generic(format!(
-                "base64 encoded value did not contain valid utf8: {err}"
-            ))
+            Error::invalid_config_with_source(
+                "base64 encoded value did not contain valid utf8",
+                err,
+            )
         })
     }
 
@@ -393,17 +397,17 @@ impl WebhookEndpoint {
     ///
     /// This function will only mask exact matches, but this should suffice
     /// for the majority of cases.
-    fn mask_secret_in_error(&self, error: impl std::fmt::Display) -> Error {
+    fn mask_secret_in_error(&self, error: impl std::fmt::Display) -> String {
         let mut s = error.to_string();
 
         for secret_value in &self.private_config.secret {
             match secret_value.decode_value() {
                 Ok(value) => s = s.replace(&value, "<masked>"),
-                Err(e) => return e,
+                Err(e) => return format!("could not decode secret while masking error: {e}"),
             }
         }
 
-        Error::Generic(s)
+        s
     }
 }
 
@@ -508,7 +512,7 @@ mod tests {
     use crate::Severity;
 
     #[test]
-    fn test_build_request() -> Result<(), Error> {
+    fn test_build_request() {
         let data = HashMap::from_iter([
             ("hello".into(), "hello world".into()),
             ("test".into(), "escaped\nstring".into()),
@@ -560,14 +564,12 @@ hello%20world
 
         let notification = Notification::from_template(Severity::Info, "foo", json!({}), data);
 
-        let request = endpoint.build_request(&notification)?;
+        let request = endpoint.build_request(&notification).unwrap();
 
         assert_eq!(request.uri(), "http://localhost/hello%20world");
         assert_eq!(request.body(), expected_body);
         assert_eq!(request.method(), "POST");
 
         assert_eq!(request.headers().get("X-Severity").unwrap(), "info");
-
-        Ok(())
     }
 }
diff --git a/proxmox-notify/src/error.rs b/proxmox-notify/src/error.rs
new file mode 100644
index 000000000..9655a02de
--- /dev/null
+++ b/proxmox-notify/src/error.rs
@@ -0,0 +1,165 @@
+#![allow(dead_code)]
+
+use std::borrow::Cow;
+
+/// Boxed, type-erased error that can be sent and shared across threads.
+pub type BoxedError = Box<dyn std::error::Error + Send + Sync>;
+
+#[derive(Debug, thiserror::Error)]
+#[non_exhaustive]
+/// Error type for `proxmox_notify`.
+pub enum Error {
+    /// The notification target with the given name does not exist.
+    #[error("target '{0}' does not exist")]
+    TargetDoesNotExist(String),
+
+    /// A notification template could not be rendered.
+    #[error("could not render notification template: {0}")]
+    TemplateRendering(String),
+
+    /// A notification template could not be loaded.
+    #[error("could not load notification template: {0}")]
+    TemplateCouldNotBeRead(#[source] BoxedError),
+
+    /// The notification configuration is invalid.
+    #[error("invalid configuration: {err}", err = print_optional_error(.message, .source))]
+    InvalidConfig {
+        /// Description of the error.
+        message: String,
+        /// Underlying error, if any.
+        source: Option<BoxedError>,
+    },
+
+    /// An HTTP request to a notification endpoint failed.
+    #[error("HTTP request failed: {0}")]
+    HttpRequestFailed(#[source] BoxedError),
+
+    /// Sending a mail via SMTP failed.
+    #[error("SMTP request failed: {0}")]
+    SmtpError(#[source] BoxedError),
+
+    /// A mail message to be forwarded could not be parsed or rebuilt.
+    #[error("forwarded email message is invalid: {err}", err = print_optional_error(.message, .source))]
+    InvalidForwardedMessage {
+        /// Description of the error.
+        message: String,
+        /// Underlying error, if any.
+        source: Option<BoxedError>,
+    },
+
+    /// The notification configuration could not be serialized.
+    #[error("could not serialize config: {0}")]
+    ConfigSerialization(#[source] BoxedError),
+
+    /// The notification configuration could not be deserialized.
+    #[error("could not deserialize config: {0}")]
+    ConfigDeserialization(#[source] BoxedError),
+
+    /// Any other error.
+    #[error("{err}", err = print_optional_error(.message, .source))]
+    Other {
+        /// Description of the error.
+        message: String,
+        /// Underlying error, if any.
+        source: Option<BoxedError>,
+    },
+}
+
+fn print_optional_error<'a>(message: &'a str, err: &Option<BoxedError>) -> Cow<'a, str> {
+    if let Some(err) = err {
+        Cow::Owned(format!("{message}: {err}"))
+    } else {
+        Cow::Borrowed(message)
+    }
+}
+
+impl Error {
+    /// Create an [`Error::InvalidForwardedMessage`] without an underlying error.
+    pub(crate) fn invalid_forwarded_message(s: impl Into<String>) -> Self {
+        Self::InvalidForwardedMessage {
+            message: s.into(),
+            source: None,
+        }
+    }
+
+    /// Create an [`Error::HttpRequestFailed`] from the given error.
+    pub(crate) fn http_request_failed(err: impl Into<BoxedError>) -> Self {
+        Self::HttpRequestFailed(err.into())
+    }
+
+    /// Create an [`Error::SmtpError`] from the given error.
+    pub(crate) fn smtp_error(err: impl Into<BoxedError>) -> Self {
+        Self::SmtpError(err.into())
+    }
+
+    /// Create an [`Error::InvalidForwardedMessage`] with an underlying error.
+    pub(crate) fn invalid_forwarded_message_with_source(
+        s: impl Into<String>,
+        source: impl Into<BoxedError>,
+    ) -> Self {
+        Self::InvalidForwardedMessage {
+            message: s.into(),
+            source: Some(source.into()),
+        }
+    }
+
+    /// Create an [`Error::TemplateCouldNotBeRead`] from the given error.
+    pub(crate) fn template_could_not_be_read(err: impl Into<BoxedError>) -> Self {
+        Self::TemplateCouldNotBeRead(err.into())
+    }
+
+    /// Create an [`Error::InvalidConfig`] without an underlying error.
+    pub(crate) fn invalid_config(s: impl Into<String>) -> Self {
+        Self::InvalidConfig {
+            message: s.into(),
+            source: None,
+        }
+    }
+
+    /// Create an [`Error::InvalidConfig`] with an underlying error.
+    pub(crate) fn invalid_config_with_source(
+        s: impl Into<String>,
+        source: impl Into<BoxedError>,
+    ) -> Self {
+        Self::InvalidConfig {
+            message: s.into(),
+            source: Some(source.into()),
+        }
+    }
+
+    /// Create an [`Error::ConfigDeserialization`] from the given error.
+    pub(crate) fn config_deserialization(err: impl Into<BoxedError>) -> Self {
+        Self::ConfigDeserialization(err.into())
+    }
+
+    /// Create an [`Error::ConfigSerialization`] from the given error.
+    pub(crate) fn config_serialization(err: impl Into<BoxedError>) -> Self {
+        Self::ConfigSerialization(err.into())
+    }
+
+    /// Create an [`Error::TargetDoesNotExist`] for the given target name.
+    pub(crate) fn target_does_not_exist(target: impl Into<String>) -> Self {
+        Self::TargetDoesNotExist(target.into())
+    }
+
+    /// Create an [`Error::TemplateRendering`] with the given message.
+    pub(crate) fn template_rendering(message: impl Into<String>) -> Self {
+        Self::TemplateRendering(message.into())
+    }
+
+    /// Create an [`Error::Other`].
+    pub(crate) fn other(s: impl Into<String>) -> Self {
+        Self::Other {
+            message: s.into(),
+            source: None,
+        }
+    }
+
+    /// Create an [`Error::Other`] with an underlying error.
+    pub(crate) fn other_with_source(s: impl Into<String>, source: impl Into<BoxedError>) -> Self {
+        Self::Other {
+            message: s.into(),
+            source: Some(source.into()),
+        }
+    }
+}
diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs
index 1ce6f89e6..270087ffc 100644
--- a/proxmox-notify/src/lib.rs
+++ b/proxmox-notify/src/lib.rs
@@ -2,7 +2,6 @@
 #![deny(unsafe_code)]
 
 use std::collections::HashMap;
-use std::error::Error as StdError;
 use std::fmt::Display;
 use std::str::FromStr;
 
@@ -26,71 +25,9 @@ pub mod endpoints;
 pub mod renderer;
 pub mod schema;
 
-#[derive(Debug)]
-pub enum Error {
-    /// There was an error serializing the config
-    ConfigSerialization(Box<dyn StdError + Send + Sync>),
-    /// There was an error deserializing the config
-    ConfigDeserialization(Box<dyn StdError + Send + Sync>),
-    /// An endpoint failed to send a notification
-    NotifyFailed(String, Box<dyn StdError + Send + Sync>),
-    /// A target does not exist
-    TargetDoesNotExist(String),
-    /// Testing one or more notification targets failed
-    TargetTestFailed(Vec<Box<dyn StdError + Send + Sync>>),
-    /// A filter could not be applied
-    FilterFailed(String),
-    /// The notification's template string could not be rendered
-    RenderError(Box<dyn StdError + Send + Sync>),
-    /// Generic error for anything else
-    Generic(String),
-}
+mod error;
+pub use error::Error;
 
-impl Display for Error {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Error::ConfigSerialization(err) => {
-                write!(f, "could not serialize configuration: {err}")
-            }
-            Error::ConfigDeserialization(err) => {
-                write!(f, "could not deserialize configuration: {err}")
-            }
-            Error::NotifyFailed(endpoint, err) => {
-                write!(f, "could not notify via endpoint(s): {endpoint}: {err}")
-            }
-            Error::TargetDoesNotExist(target) => {
-                write!(f, "notification target '{target}' does not exist")
-            }
-            Error::TargetTestFailed(errs) => {
-                for err in errs {
-                    writeln!(f, "{err}")?;
-                }
-
-                Ok(())
-            }
-            Error::FilterFailed(message) => {
-                write!(f, "could not apply filter: {message}")
-            }
-            Error::RenderError(err) => write!(f, "could not render notification template: {err}"),
-            Error::Generic(message) => f.write_str(message),
-        }
-    }
-}
-
-impl StdError for Error {
-    fn source(&self) -> Option<&(dyn StdError + 'static)> {
-        match self {
-            Error::ConfigSerialization(err) => Some(&**err),
-            Error::ConfigDeserialization(err) => Some(&**err),
-            Error::NotifyFailed(_, err) => Some(&**err),
-            Error::TargetDoesNotExist(_) => None,
-            Error::TargetTestFailed(errs) => Some(&*errs[0]),
-            Error::FilterFailed(_) => None,
-            Error::RenderError(err) => Some(&**err),
-            Error::Generic(_) => None,
-        }
-    }
-}
 
 #[api()]
 #[derive(Clone, Debug, Copy, Serialize, Deserialize, PartialEq, Eq, PartialOrd)]
@@ -123,14 +60,14 @@ impl Display for Severity {
 
 impl FromStr for Severity {
     type Err = Error;
-    fn from_str(s: &str) -> Result<Self, Error> {
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
         match s {
             "info" => Ok(Self::Info),
             "notice" => Ok(Self::Notice),
             "warning" => Ok(Self::Warning),
             "error" => Ok(Self::Error),
             "unknown" => Ok(Self::Unknown),
-            _ => Err(Error::Generic(format!("invalid severity {s}"))),
+            _ => Err(Error::invalid_config(format!("invalid severity {s}"))),
         }
     }
 }
@@ -233,7 +170,7 @@ impl Notification {
     pub fn new_forwarded_mail(raw_mail: &[u8], uid: Option<u32>) -> Result<Self, Error> {
         let message = mail_parser::MessageParser::default()
             .parse(raw_mail)
-            .ok_or_else(|| Error::Generic("could not parse forwarded email".to_string()))?;
+            .ok_or_else(|| Error::invalid_forwarded_message("could not parse forwarded email"))?;
 
         let title = message.subject().unwrap_or_default().into();
         let body = message.body_text(0).unwrap_or_default().into();
@@ -589,7 +526,7 @@ impl Bus {
         if let Some(endpoint) = self.endpoints.get(target) {
             endpoint.send(&notification)?;
         } else {
-            return Err(Error::TargetDoesNotExist(target.to_string()));
+            return Err(Error::target_does_not_exist(target));
         }
 
         Ok(())
diff --git a/proxmox-notify/src/matcher/calendar.rs b/proxmox-notify/src/matcher/calendar.rs
index a0377259a..72af94102 100644
--- a/proxmox-notify/src/matcher/calendar.rs
+++ b/proxmox-notify/src/matcher/calendar.rs
@@ -29,7 +29,7 @@ impl FromStr for DailyDurationWrapper {
 
     fn from_str(s: &str) -> Result<Self, Error> {
         let daily_duration = proxmox_time::parse_daily_duration(s)
-            .map_err(|e| Error::Generic(format!("could not parse schedule: {e}")))?;
+            .map_err(|err| Error::invalid_config_with_source("could not parse schedule", err))?;
 
         Ok(Self {
             daily_duration,
@@ -65,7 +65,7 @@ impl MatchDirective for CalendarMatcher {
         self.schedule
             .daily_duration
             .time_match(notification.metadata.timestamp, false)
-            .map_err(|err| Error::Generic(format!("could not match timestamp: {err}")))
+            .map_err(|err| Error::invalid_config_with_source("could not match timestamp", err))
     }
 
     fn validate(&self) -> Result<(), Error> {
diff --git a/proxmox-notify/src/matcher/field.rs b/proxmox-notify/src/matcher/field.rs
index e0d362383..0e145f81b 100644
--- a/proxmox-notify/src/matcher/field.rs
+++ b/proxmox-notify/src/matcher/field.rs
@@ -59,21 +59,21 @@ impl MatchDirective for FieldMatcher {
         match self {
             FieldMatcher::Exact { field, values } => {
                 if values.is_empty() {
-                    return Err(Error::Generic(
-                        "field matcher must contain values to match".to_string(),
+                    return Err(Error::invalid_config(
+                        "field matcher must contain values to match",
                     ));
                 }
                 if !SAFE_ID_REGEX.is_match(field) {
-                    return Err(Error::Generic(
-                        "field name does not match regex pattern".to_string(),
-                    ));
+                    return Err(Error::invalid_config(format!(
+                        "field name '{field}' does not match regex pattern",
+                    )));
                 }
             }
             FieldMatcher::Regex { field, .. } => {
                 if !SAFE_ID_REGEX.is_match(field) {
-                    return Err(Error::Generic(
-                        "field name does not match regex pattern".to_string(),
-                    ));
+                    return Err(Error::invalid_config(format!(
+                        "field name '{field}' does not match regex pattern",
+                    )));
                 }
             }
         }
@@ -156,19 +156,20 @@ pub mod inline {
         type Err = Error;
         fn from_str(s: &str) -> Result<Self, Error> {
             if !MATCH_FIELD_ENTRY_REGEX.is_match(s) {
-                return Err(Error::FilterFailed(format!(
+                return Err(Error::invalid_config(format!(
                     "invalid match-field statement: {s}"
                 )));
             }
 
             if let Some(remaining) = s.strip_prefix("regex:") {
                 match remaining.split_once('=') {
-                    None => Err(Error::FilterFailed(format!(
+                    None => Err(Error::invalid_config(format!(
                         "invalid match-field statement: {s}"
                     ))),
                     Some((field, expected_value_regex)) => {
-                        let regex = Regex::new(expected_value_regex)
-                            .map_err(|err| Error::FilterFailed(format!("invalid regex: {err}")))?;
+                        let regex = Regex::new(expected_value_regex).map_err(|err| {
+                            Error::invalid_config_with_source("invalid regex", err)
+                        })?;
 
                         Ok(Self(FieldMatcher::Regex {
                             field: field.into(),
@@ -178,7 +179,7 @@ pub mod inline {
                 }
             } else if let Some(remaining) = s.strip_prefix("exact:") {
                 match remaining.split_once('=') {
-                    None => Err(Error::FilterFailed(format!(
+                    None => Err(Error::invalid_config(format!(
                         "invalid match-field statement: {s}"
                     ))),
                     Some((field, expected_values)) => {
@@ -194,7 +195,7 @@ pub mod inline {
                     }
                 }
             } else {
-                Err(Error::FilterFailed(format!(
+                Err(Error::invalid_config(format!(
                     "invalid match-field statement: {s}"
                 )))
             }
diff --git a/proxmox-notify/src/matcher/mod.rs b/proxmox-notify/src/matcher/mod.rs
index af87a4ef3..59baeae4e 100644
--- a/proxmox-notify/src/matcher/mod.rs
+++ b/proxmox-notify/src/matcher/mod.rs
@@ -155,7 +155,10 @@ impl MatcherConfig {
         let expression: Expression<NotificationMatcher> = {
             if let Some(expression_str) = &self.expression {
                 serde_json::from_str(expression_str).map_err(|err| {
-                    Error::FilterFailed(format!("could not deserialize filter expression: {err:#}"))
+                    Error::invalid_config_with_source(
+                        "could not deserialize matcher expression",
+                        err,
+                    )
                 })?
             } else {
                 #[cfg(feature = "legacy-matchers")]
@@ -234,7 +237,7 @@ impl MatcherConfig {
 
             if !conflicting_properties.is_empty() {
                 let joined = conflicting_properties.join(", ");
-                return Err(Error::Generic(format!(
+                return Err(Error::invalid_config(format!(
                     "'expression' property is mutually exclusive with: {joined}"
                 )));
             }
@@ -252,13 +255,14 @@ impl MatcherConfig {
                     // Storing the *serialized* expression makes sure that
                     // we have a minified, single-line JSON string
                     self.expression = Some(serde_json::to_string(&expr).map_err(|err| {
-                        Error::Generic(format!("could not serialize expression: {err:#}"))
+                        Error::other_with_source("could not serialize expression", err)
                     })?);
                 }
                 Err(err) => {
-                    return Err(Error::Generic(format!(
-                        "'expression' is not valid: {err:#}"
-                    )));
+                    return Err(Error::invalid_config_with_source(
+                        "'expression' is not valid",
+                        err,
+                    ));
                 }
             }
         }
@@ -277,21 +281,21 @@ impl MatcherConfig {
         match expr {
             Expression::AllOf(expressions) => {
                 if expressions.is_empty() {
-                    return Err(Error::Generic(
+                    return Err(Error::invalid_config(
                         "'expression' may not contain an empty 'all-of' rule".to_string(),
                     ));
                 }
             }
             Expression::AnyOf(expressions) => {
                 if expressions.is_empty() {
-                    return Err(Error::Generic(
+                    return Err(Error::invalid_config(
                         "'expression' may not contain an empty 'any-of' rule".to_string(),
                     ));
                 }
             }
             Expression::OneOf(expressions) => {
                 if expressions.is_empty() {
-                    return Err(Error::Generic(
+                    return Err(Error::invalid_config(
                         "'expression' may not contain an empty 'one-of' rule".to_string(),
                     ));
                 }
diff --git a/proxmox-notify/src/matcher/severity.rs b/proxmox-notify/src/matcher/severity.rs
index b867d8b74..6818e5c22 100644
--- a/proxmox-notify/src/matcher/severity.rs
+++ b/proxmox-notify/src/matcher/severity.rs
@@ -25,8 +25,8 @@ impl MatchDirective for SeverityMatcher {
 
     fn validate(&self) -> Result<(), Error> {
         if self.severities.is_empty() {
-            return Err(Error::Generic(
-                "severity matcher must contain severities to match".to_string(),
+            return Err(Error::invalid_config(
+                "severity matcher must contain severities to match",
             ));
         }
 
@@ -75,7 +75,9 @@ pub mod inline {
 
             for element in s.split(',') {
                 let element = element.trim();
-                let severity: Severity = element.parse()?;
+                let severity: Severity = element
+                    .parse()
+                    .map_err(|err| Error::invalid_config_with_source("invalid severity", err))?;
 
                 severities.push(severity)
             }
diff --git a/proxmox-notify/src/renderer/mod.rs b/proxmox-notify/src/renderer/mod.rs
index a0b7df7bc..1bccf75bf 100644
--- a/proxmox-notify/src/renderer/mod.rs
+++ b/proxmox-notify/src/renderer/mod.rs
@@ -272,7 +272,9 @@ fn render_template_impl(
     filename: &str,
     source: TemplateSource,
 ) -> Result<Option<String>, Error> {
-    let template_string = context::context().lookup_template(filename, None, source)?;
+    let template_string = context::context()
+        .lookup_template(filename, None, source)
+        .map_err(Error::template_could_not_be_read)?;
 
     if let Some(template_string) = template_string {
         let mut handlebars = Handlebars::new();
@@ -290,7 +292,7 @@ fn render_template_impl(
 
         let rendered_template = handlebars
             .render_template(&template_string, data)
-            .map_err(|err| Error::RenderError(err.into()))?;
+            .map_err(|err| Error::template_rendering(err.to_string()))?;
 
         let rendered_template = renderer.postprocess(rendered_template);
 
@@ -357,9 +359,8 @@ pub fn render_template(
         }
     }
 
-    Err(Error::Generic(
-        "failed to render notification template, all template candidates are erroneous or missing"
-            .into(),
+    Err(Error::template_rendering(
+        "all template candidates are erroneous or missing",
     ))
 }
 
-- 
2.47.3





  parent reply	other threads:[~2026-11-13 15:16 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 15:07 [PATCH many 00/55] notify: maintenance, PDM preparations, queue + worker Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 01/55] notify: disallow `unsafe` code Lukas Wagner
2026-11-13 15:07 ` Lukas Wagner [this message]
2026-11-13 15:07 ` [PATCH proxmox 03/55] notify: move `Endpoint` trait to endpoint module as pub(crate) Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 04/55] notify: use ConfigDigest instead of raw byte arrays Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 05/55] notify: remove static context and pass context as parameter Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 06/55] notify: matcher: drop unused field matcher verifiers Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 07/55] notify: introduce 'send-impl', 'api-impl' and 'api-types' features Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 08/55] notify: matcher: make matcher validation methods public Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 09/55] notify: make SendmailEndpoint and SmtpEndpoint private types Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 10/55] notify: move `send`, `test_target` and `Bus` to new `send` module Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 11/55] notify: move Origin type to api_types module Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 12/55] notify: move Target " Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 13/55] notify: move Config to config module Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 14/55] notify: move Notification and sub-types to `notification` module Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 15/55] notify: move schema module to api_types Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 16/55] notify: move check_matches from api_types::matcher to send::Bus Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 17/55] notify: move TemplateSource to context module Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 18/55] notify: config: cleanup helpers names and visibility Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 19/55] notify: config: rename section config parser/writer methods Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 20/55] notify: config: pass builtins explicitly when parsing section config Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 21/55] notify: implement PartialEq for all Config types Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 22/55] notify: use typed SectionConfigData Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 23/55] notify: api: api types: rename Deleteable* -> Deletable* Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 24/55] notify: context: parse builtin config only once Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 25/55] notify: context: parse proxy config in trait impl, not at the callsite Lukas Wagner
2026-11-13 15:07 ` [PATCH proxmox 26/55] notify: gate sub-modules with the appropriate feature flags Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 27/55] notify: fold mail-forwarder feature into send-impl Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 28/55] notify: forwarded mails: don't hardcode severity and metadata fields Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 29/55] notify: don't pass uid when instantiating forwarded mail notifications Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 30/55] notify: derive PartialEq for Notification type Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 31/55] notify: add getters for severity and fields on " Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 32/55] notify: add test suite for " Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 33/55] notify: serialize raw, forwarded mail content as base64 Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 34/55] notify: unify code paths for legacy-sendmail and regular notifications Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 35/55] notify: add backwards-compat note to Notification type Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 36/55] notify: remove 'test_target' API Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 37/55] notify: replace notification instantiation with builder pattern Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 38/55] notify: add send receipts Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 39/55] notify: implement notification queue submitter Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 40/55] notify: context: add read_config Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 41/55] notify: queue: add queue consumer Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox 42/55] notify: queue: add worker task Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-backup 43/55] notifications: don't ignore verification errors in legacy-sendmail mode Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-backup 44/55] notifications: adapt to proxmox-notify API changes Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-backup 45/55] api: notification: send test notification via proxmox_notify::send Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-backup 46/55] notifications: send all notifications via proxmox-notify's queue Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-perl-rs 47/55] pve: notify: adapt to changes in the public API of proxmox-notify Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-perl-rs 48/55] pve: notify: add `PVE::RS::Notify::enqueue` method Lukas Wagner
2026-11-13 15:08 ` [PATCH pve-cluster 49/55] notify: send notifications via notification queue Lukas Wagner
2026-11-13 15:08 ` [PATCH manager 50/55] vzdump: send legacy-sendmail notifications via simplified API Lukas Wagner
2026-11-13 15:08 ` [PATCH manager 51/55] pve-notify-worker: add new rust-based notification worker daemon Lukas Wagner
2026-11-13 15:08 ` [PATCH manager 52/55] debian: add 'pve-notify-worker' as a dependency Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-mail-forward 53/55] forward mails via notification queue Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-mail-forward 54/55] use return code to signal permanent or temporary failure Lukas Wagner
2026-11-13 15:08 ` [PATCH proxmox-mail-forward 55/55] limit size of mail read from stdin Lukas Wagner
2026-11-17  9:35 ` [PATCH many 00/55] notify: maintenance, PDM preparations, queue + worker Lukas Wagner
2026-11-18  9:55 ` superseded: " Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261113150828.756836-3-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal