1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-07-29 23:29:09 +00:00

only validate SMTP_FROM if necessary

This commit is contained in:
Stefan Melmuk 2025-01-25 05:34:06 +01:00
commit fe3aff4852
No known key found for this signature in database
GPG key ID: 817020C608FE9C09

View file

@ -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))
}