4 pub struct ProxyConfiguration {
6 pub remote_domain: String,
8 pub protocol: &'static str,
11 pub struct Configuration {
12 pub imap_configuration: Arc<ProxyConfiguration>,
13 pub smtp_configuration: Arc<ProxyConfiguration>,
17 pub fn new() -> Self {
19 imap_configuration: Arc::new(ProxyConfiguration {
20 local_port: env::var("LOCAL_IMAP_PORT")
21 .expect("LOCAL_IMAP_PORT not set")
23 .expect("Invalid LOCAL_IMAP_PORT"),
24 remote_domain: env::var("REMOTE_IMAP_DOMAIN").expect("REMOTE_IMAP_DOMAIN not set"),
25 remote_port: env::var("REMOTE_IMAP_PORT")
26 .expect("REMOTE_IMAP_PORT not set")
28 .expect("Invalid REMOTE_IMAP_PORT"),
31 smtp_configuration: Arc::new(ProxyConfiguration {
32 local_port: env::var("LOCAL_SMTP_PORT")
33 .expect("LOCAL_SMTP_PORT not set")
35 .expect("Invalid LOCAL_SMTP_PORT"),
36 remote_domain: env::var("REMOTE_SMTP_DOMAIN").expect("REMOTE_SMTP_DOMAIN not set"),
37 remote_port: env::var("REMOTE_SMTP_PORT")
38 .expect("REMOTE_SMTP_PORT not set")
40 .expect("Invalid REMOTE_SMTP_PORT"),