Skip to content

Commit

Permalink
only validate SMTP_FROM if necessary (#5442)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan0xC authored Jan 25, 2025
1 parent 952992c commit 2903a3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 2903a3a

Please sign in to comment.