This commit is contained in:
naskya 2024-07-01 20:11:43 +09:00
parent 5388e7cb7b
commit f7175d685f
Signed by: naskya
GPG key ID: 712D413B3A9FED5C
2 changed files with 4 additions and 0 deletions

View file

@ -375,6 +375,7 @@ fn create_new_server_config(
let email = match meta.email.as_ref() { let email = match meta.email.as_ref() {
Some(address) => Some(server::Email { Some(address) => Some(server::Email {
enabled: meta.enable_email, enabled: meta.enable_email,
require_for_signup: meta.email_required_for_signup,
address: address.to_owned(), address: address.to_owned(),
host: meta host: meta
.smtp_host .smtp_host
@ -387,6 +388,7 @@ fn create_new_server_config(
.map_err(|_| Error::InvalidConfig("SMTP port is out of range"))?, .map_err(|_| Error::InvalidConfig("SMTP port is out of range"))?,
user: meta.smtp_user.to_owned(), user: meta.smtp_user.to_owned(),
password: meta.smtp_pass.to_owned(), password: meta.smtp_pass.to_owned(),
use_implicit_ssl: meta.smtp_secure,
}), }),
None => None, None => None,
}; };

View file

@ -60,12 +60,14 @@ pub struct Listen {
#[derive(Deserialize, Serialize, Validate, Debug, Clone)] #[derive(Deserialize, Serialize, Validate, Debug, Clone)]
pub struct Email { pub struct Email {
pub enabled: bool, pub enabled: bool,
pub require_for_signup: bool,
#[validate(email)] #[validate(email)]
pub address: String, pub address: String,
pub host: String, pub host: String,
pub port: u16, pub port: u16,
pub user: Option<String>, pub user: Option<String>,
pub password: Option<String>, pub password: Option<String>,
pub use_implicit_ssl: bool,
} }
#[derive(Deserialize, Serialize, Validate, Debug, Clone)] #[derive(Deserialize, Serialize, Validate, Debug, Clone)]