Skip to main content

smtp_test_tool/
lib.rs

1//! email-tester core library.
2//!
3//! Pure-Rust, single-binary mail-server diagnostic.  Used by both the
4//! CLI (`bin/cli.rs`) and the GUI (`bin/gui.rs`).
5//!
6//! All protocol tests emit progress through [`tracing`] events with a
7//! `protocol` field (`"smtp"`, `"imap"`, or `"pop3"`) so any subscriber
8//! (terminal formatter, GUI log widget, file writer) can route them.
9
10pub mod config;
11pub mod diagnostics;
12pub mod imap;
13pub mod pop3;
14pub mod providers;
15pub mod runner;
16pub mod smtp;
17pub mod theme;
18pub mod tls;
19
20pub use config::{Config, Profile};
21pub use runner::{run_tests, TestOutcome, TestResults};
22
23/// Built-in Outlook.com / Office 365 defaults.
24pub fn outlook_defaults() -> Profile {
25    Profile {
26        user: None,
27        password: None,
28        oauth_token: None,
29
30        smtp_enabled: true,
31        smtp_host: "smtp-mail.outlook.com".into(),
32        smtp_port: 587,
33        smtp_security: tls::Security::StartTls,
34        auth_mech: smtp::AuthMech::Auto,
35
36        imap_enabled: true,
37        imap_host: "outlook.office365.com".into(),
38        imap_port: 993,
39        imap_security: tls::Security::Implicit,
40        imap_folder: "INBOX".into(),
41
42        pop_enabled: false,
43        pop_host: "outlook.office365.com".into(),
44        pop_port: 995,
45        pop_security: tls::Security::Implicit,
46
47        send_test: true,
48        mail_from: None,
49        from_addr: None,
50        to: Vec::new(),
51        cc: Vec::new(),
52        bcc: Vec::new(),
53        reply_to: None,
54        subject: "Email server connectivity test".into(),
55        body: "This is a connectivity test sent by email-tester.\n".into(),
56
57        ehlo_name: None,
58        timeout_secs: 20,
59        insecure_tls: false,
60        ca_file: None,
61
62        log_level: "info".into(),
63        wire_trace: false,
64        theme: "auto".into(),
65    }
66}