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 runner;
15pub mod smtp;
16pub mod theme;
17pub mod tls;
18
19pub use config::{Config, Profile};
20pub use runner::{run_tests, TestOutcome, TestResults};
21
22/// Built-in Outlook.com / Office 365 defaults.
23pub fn outlook_defaults() -> Profile {
24    Profile {
25        user: None,
26        password: None,
27        oauth_token: None,
28
29        smtp_enabled: true,
30        smtp_host: "smtp-mail.outlook.com".into(),
31        smtp_port: 587,
32        smtp_security: tls::Security::StartTls,
33        auth_mech: smtp::AuthMech::Auto,
34
35        imap_enabled: true,
36        imap_host: "outlook.office365.com".into(),
37        imap_port: 993,
38        imap_security: tls::Security::Implicit,
39        imap_folder: "INBOX".into(),
40
41        pop_enabled: false,
42        pop_host: "outlook.office365.com".into(),
43        pop_port: 995,
44        pop_security: tls::Security::Implicit,
45
46        send_test: false,
47        mail_from: None,
48        from_addr: None,
49        to: Vec::new(),
50        cc: Vec::new(),
51        bcc: Vec::new(),
52        reply_to: None,
53        subject: "Email server connectivity test".into(),
54        body: "This is a connectivity test sent by email-tester.\n".into(),
55
56        ehlo_name: None,
57        timeout_secs: 20,
58        insecure_tls: false,
59        ca_file: None,
60
61        log_level: "info".into(),
62        wire_trace: false,
63        theme: "auto".into(),
64    }
65}