From f61a1f66692dddeef5e6d41938a26129d6aacd56 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Wed, 23 Aug 2023 09:31:41 +0200 Subject: [PATCH] make sendmail-cmd optional Use the common /usr/sbin/sendmail the default. This is a common default hardcoded in many applications. Fixes: https://todo.sr.ht/~soywod/pimalaya/126 --- src/config/prelude.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config/prelude.rs b/src/config/prelude.rs index cf9c443..adc192f 100644 --- a/src/config/prelude.rs +++ b/src/config/prelude.rs @@ -368,10 +368,18 @@ pub enum SmtpOAuth2ScopesDef { #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(remote = "SendmailConfig", rename_all = "kebab-case")] pub struct SendmailConfigDef { - #[serde(rename = "sendmail-cmd", with = "CmdDef")] + #[serde( + rename = "sendmail-cmd", + with = "CmdDef", + default = "sendmail_default_cmd" + )] cmd: Cmd, } +fn sendmail_default_cmd() -> Cmd { + Cmd::from("/usr/sbin/sendmail") +} + /// Represents the email hooks. Useful for doing extra email /// processing before or after sending it. #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]