]> git.r.bdr.sh - rbdr/olden-mail/blobdiff - src/main.rs
Actually check for the command
[rbdr/olden-mail] / src / main.rs
index 863b2eef928240c9ba809f8ea8f1967af6d6d635..832b6e239053cafbb52947d6baf198fb7d099373 100644 (file)
@@ -11,8 +11,8 @@
 //!
 //! ### Pre-built binaries and packages
 //!
 //!
 //! ### Pre-built binaries and packages
 //!
-//! Binaries are available for macos and linux, for both aarch64 and x86_64
-//! from https://build.r.bdr.sh/olden-mail, including `.deb` and `.rpm`
+//! Binaries are available for macos and linux, for both aarch64 and `x86_64`
+//! from <https://build.r.bdr.sh/olden-mail>, including `.deb` and `.rpm`
 //! packages.
 //!
 //! ### Homebrew
 //! packages.
 //!
 //! ### Homebrew
 //! no options.
 //!
 //! * `LOCAL_IMAP_PORT` u16, the port in which the server will listen for
 //! no options.
 //!
 //! * `LOCAL_IMAP_PORT` u16, the port in which the server will listen for
-//! IMAP clients. Defaults to 143.
+//!   IMAP clients. Defaults to 143.
 //! * `LOCAL_IMAP_BIND_ADDRESS` String, the address on which to listen for
 //! * `LOCAL_IMAP_BIND_ADDRESS` String, the address on which to listen for
-//! IMAP clients. Defaults to 0.0.0.0.
+//!   IMAP clients. Defaults to 0.0.0.0.
 //! * `REMOTE_IMAP_PORT` u16, the port to which the server will forward the
 //! * `REMOTE_IMAP_PORT` u16, the port to which the server will forward the
-//! IMAP messages. Defaults to 993.
+//!   IMAP messages. Defaults to 993.
 //! * `REMOTE_IMAP_HOST` String, the host to which the server will forward the
 //! * `REMOTE_IMAP_HOST` String, the host to which the server will forward the
-//! IMAP messages. Required.
+//!   IMAP messages. Required.
 //!
 //! * `LOCAL_SMTP_PORT` u16, the port in which the server will listen for
 //!
 //! * `LOCAL_SMTP_PORT` u16, the port in which the server will listen for
-//! SMTP clients. Defaults to 25.
+//!   SMTP clients. Defaults to 25.
 //! * `LOCAL_SMTP_BIND_ADDRESS` String, the address on which to listen for
 //! * `LOCAL_SMTP_BIND_ADDRESS` String, the address on which to listen for
-//! SMTP clients. Defaults to 0.0.0.0.
+//!   SMTP clients. Defaults to 0.0.0.0.
 //! * `REMOTE_SMTP_PORT` u16, the port to which the server will forward the
 //! * `REMOTE_SMTP_PORT` u16, the port to which the server will forward the
-//! SMTP messages. Defaults to 465.
+//!   SMTP messages. Defaults to 465.
 //! * `REMOTE_SMTP_HOST` String, the host to which the server will forward the
 //! * `REMOTE_SMTP_HOST` String, the host to which the server will forward the
-//! SMTP messages. Required.
+//!   SMTP messages. Required.
 //!
 //! This means the minimum invocation is this (Shown here with inline
 //! environment variables)
 //!
 //! ```
 //!
 //! This means the minimum invocation is this (Shown here with inline
 //! environment variables)
 //!
 //! ```
-//! % REMOTE_IMAP_DOMAIN=imap.coolmailsite.example REMOTE_SMTP_DOMAIN=smtp.coolmailsite.example olden-mail
+//! % REMOTE_IMAP_HOST=imap.coolmailsite.example REMOTE_SMTP_HOST=smtp.coolmailsite.example olden-mail
 //! ```
 //!
 //! ## Debugging
 //! ```
 //!
 //! ## Debugging
@@ -71,10 +71,11 @@ use std::process::exit;
 use std::sync::mpsc;
 
 mod configuration;
 use std::sync::mpsc;
 
 mod configuration;
+mod middleware;
 mod proxy;
 
 use configuration::Configuration;
 mod proxy;
 
 use configuration::Configuration;
-use proxy::ProxyServer;
+use proxy::Server;
 
 fn main() {
     Builder::from_env(Env::default().default_filter_or("info"))
 
 fn main() {
     Builder::from_env(Env::default().default_filter_or("info"))
@@ -88,8 +89,8 @@ fn main() {
 
     let (tx, rx) = mpsc::channel();
 
 
     let (tx, rx) = mpsc::channel();
 
-    let mut imap_proxy = ProxyServer::new(configuration.imap_configuration);
-    let mut smtp_proxy = ProxyServer::new(configuration.smtp_configuration);
+    let mut imap_proxy = Server::new(configuration.imap_configuration);
+    let mut smtp_proxy = Server::new(configuration.smtp_configuration);
 
     ctrlc::set_handler(move || {
         info!("Shutting down...");
 
     ctrlc::set_handler(move || {
         info!("Shutting down...");