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