|
|
|
@ -749,11 +749,15 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if cfg.use_sendmail {
|
|
|
|
|
if let Some(ref command) = cfg.sendmail_command {
|
|
|
|
|
let path = std::path::Path::new(&command);
|
|
|
|
|
let command = cfg.sendmail_command.as_deref().unwrap_or("sendmail");
|
|
|
|
|
|
|
|
|
|
let mut path = std::path::PathBuf::from(command);
|
|
|
|
|
|
|
|
|
|
if !path.is_absolute() {
|
|
|
|
|
err!(format!("path to sendmail command `{path:?}` is not absolute"));
|
|
|
|
|
match which::which(command) {
|
|
|
|
|
Ok(result) => path = result,
|
|
|
|
|
Err(_) => err!(format!("sendmail command {command:?} not found in $PATH")),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
match path.metadata() {
|
|
|
|
@ -777,7 +781,6 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if cfg.smtp_host.is_some() == cfg.smtp_from.is_empty() {
|
|
|
|
|
err!("Both `SMTP_HOST` and `SMTP_FROM` need to be set for email support without `USE_SENDMAIL`")
|
|
|
|
|