diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 4ceba75..c153085 100644 --- a/src/config.rs +++ b/src/config.rs @@ -9,6 +9,7 @@ use std::str; pub struct Config { pub server: ServerConfig, pub database: DbConfig, + pub email: EmailConfig, } #[derive(Deserialize)] @@ -23,6 +24,18 @@ pub struct DbConfig { pub max_connections: u32, } +#[derive(Deserialize)] +pub struct EmailConfig { + pub smtp_server: String, + pub smtp_port: u16, + pub smtp_tls: bool, + pub smtp_starttls: bool, + pub smtp_username: Option<String>, + pub smtp_password: Option<String>, + pub email_from: String, + pub email_helo: String, +} + impl Config { pub fn init(path: String) -> Result<Config, ServiceError> { if let Ok(c) = fs::read(path) { |