diff --git a/src/main.rs b/src/main.rs
index 22e1871..54bdb2d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -27,8 +27,12 @@ use std::{
thread,
};
use lettre::{
- SendmailTransport,
- Transport
+ SmtpClient,
+ smtp::authentication::{
+ Credentials,
+ Mechanism,
+ },
+ Transport,
};
fn main() {
@@ -57,17 +61,19 @@ fn main() {
None => config = config::get_main_config(PathBuf::from("/etc/Mention2Mail/config.toml"))
.expect("Could not get default config in /etc/Mention2Mail/default.toml"),
}
+
+ let mail_config = &config.get("email").expect("No email config found.");
let server_configs;
match server_conf_path {
- Some(p) => server_configs = config::get_server_configs(config, PathBuf::from(p))
+ Some(p) => server_configs = config::get_server_configs(config.clone(), PathBuf::from(p))
.expect("Could not get server config."),
- None => server_configs = vec![config],
+ None => server_configs = vec![config.clone()],
}
// TODO: This line has many problems…
- let (tx,rx): (std::sync::mpsc::Sender<(String, String, String, [Option<[String; 2]>; 5])>, std::sync::mpsc::Receiver<(String, String, String, [Option<[String; 2]>; 5])>)= channel();
+ let (tx,rx): (std::sync::mpsc::Sender<(String, String, String, Vec