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