/// Aggregated configuration for both proxies, already in a reference counter.
pub struct Configuration {
/// Aggregated configuration for both proxies, already in a reference counter.
pub struct Configuration {
- pub imap_configuration: Arc<ProxyConfiguration>,
- pub smtp_configuration: Arc<ProxyConfiguration>,
+ pub imap_configuration: Arc<Proxy>,
+ pub smtp_configuration: Arc<Proxy>,
}
impl Configuration {
/// Creates a new configuration object by reading the environment
/// variables. Exits if the right ones aren't found.
}
impl Configuration {
/// Creates a new configuration object by reading the environment
/// variables. Exits if the right ones aren't found.
local_port: get_env_number("LOCAL_IMAP_PORT", 143)?,
bind_address: get_env_var("LOCAL_IMAP_BIND_ADDRESS", Some("0.0.0.0".to_string()))?,
local_port: get_env_number("LOCAL_IMAP_PORT", 143)?,
bind_address: get_env_var("LOCAL_IMAP_BIND_ADDRESS", Some("0.0.0.0".to_string()))?,
local_port: get_env_number("LOCAL_SMTP_PORT", 25)?,
bind_address: get_env_var("LOCAL_SMTP_BIND_ADDRESS", Some("0.0.0.0".to_string()))?,
local_port: get_env_number("LOCAL_SMTP_PORT", 25)?,
bind_address: get_env_var("LOCAL_SMTP_BIND_ADDRESS", Some("0.0.0.0".to_string()))?,
match env::var(name) {
Ok(value) => Ok(value),
Err(_) => match default {
Some(default_value) => Ok(default_value),
match env::var(name) {
Ok(value) => Ok(value),
Err(_) => match default {
Some(default_value) => Ok(default_value),