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