From 2903a3a13ad06a09805e8842511b4b715a686d8e Mon Sep 17 00:00:00 2001 From: Stefan Melmuk <509385+stefan0xC@users.noreply.github.com> Date: Sat, 25 Jan 2025 05:46:43 +0100 Subject: [PATCH] only validate SMTP_FROM if necessary (#5442) --- src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index da3bbd44..853f7cfa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -942,7 +942,7 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> { } } - if !is_valid_email(&cfg.smtp_from) { + if (cfg.smtp_host.is_some() || cfg.use_sendmail) && !is_valid_email(&cfg.smtp_from) { err!(format!("SMTP_FROM '{}' is not a valid email address", cfg.smtp_from)) }