Commit 94b07a07 authored by MrMan's avatar MrMan

dovecot component compiles

parent b0182f27
Pipeline #50026843 passed with stage
in 6 minutes and 42 seconds
......@@ -186,6 +186,7 @@ pub struct AuthCfg {
pub struct AppCfg {
pub file_path: Option<String>,
pub postfix: PostfixCfg,
pub dovecot: DovecotCfg,
pub web_admin: WebAdminCfg,
}
......
......@@ -6,6 +6,7 @@ use std::thread;
use postmgr::components::db::{MailboxDB, Connectable};
use postmgr::components::web_admin::WebAdmin;
use postmgr::components::postfix::Postfix;
use postmgr::components::dovecot::Dovecot;
use postmgr::components::{Component, HasReqRespCommandBus, FileConfigurable, Configurable};
use postmgr::models::user::MailboxUser;
use postmgr::{setup_logging, generate_app_config, parse_arguments};
......@@ -26,7 +27,7 @@ fn main() {
let mut postfix = Postfix::new(app_cfg.postfix.clone(), None).expect("postfix component init failed");
// Create Dovecot component
let mut dovecot = Dovecot::new(app_cfg.dovecot.clone(), None).expect("dovecot component init failed");
let mut dovecot = Dovecot::new(app_cfg.dovecot.clone()).expect("dovecot component init failed");
// Create Web Admin component
let postfix_tx = postfix.get_cmd_bus_tx().expect("failed to create WebAdmin -> Postfix communication channel");
......@@ -43,13 +44,19 @@ fn main() {
process::exit(1);
}
// Start components threaded
// Start dovecot
let dovecot_thread = thread::spawn(move|| { dovecot.start() });
debug!("successfully started threaded dovecot component");
// Start postfix
let postfix_thread = thread::spawn(move|| { postfix.start() });
debug!("successfully started threaded postfix component");
// Start web admin
let admin_thread = thread::spawn(move|| { admin.start() });
debug!("successfully started threaded admin component");
let _ = dovecot_thread.join();
let _ = postfix_thread.join();
let _ = admin_thread.join();
},
......
......@@ -145,7 +145,7 @@
# Query to get a list of all usernames.
#iterate_query = SELECT username AS user FROM users
driver = {{ settings.driver.dovecot_setting_name() }}
driver = {{ settings.driver.clone().dovecot_setting_name() }}
connect = {{ settings.connect }}
pass_query = {{ settings.query }}
......
......@@ -145,7 +145,7 @@
# Query to get a list of all usernames.
#iterate_query = SELECT username AS user FROM users
driver = {{ settings.driver.dovecot_setting_name() }}
driver = {{ settings.driver.clone().dovecot_setting_name() }}
connect = {{ settings.connect }}
user_query = {{ settings.query }}
......
{% match userdb %}
{% when Some with (userdb_settings) %}
userdb {
driver = {{ userdb_settings.driver.dovecot_setting_name() }}
driver = {{ userdb_settings.driver.clone().dovecot_setting_name() }}
args = {{ userdb_conf_abs_path }}
}
{% when None %}
......@@ -10,7 +10,7 @@ userdb {
{% match passdb %}
{% when Some with (passdb_settings) %}
passdb {
driver = {{ passdb_settings.driver.dovecot_setting_name() }}
driver = {{ passdb_settings.driver.clone().dovecot_setting_name() }}
args = {{ passdb_conf_abs_path }}
}
{% when None %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment