cloudiful-notifier 0.2.1

Async notification delivery library for ntfy, generic webhooks, DingTalk robots, and SMTP email.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::EmailTlsMode;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum TransportKind {
    Relay,
    StartTlsRelay,
    Plain,
}

pub(crate) fn transport_kind(tls_mode: EmailTlsMode) -> TransportKind {
    match tls_mode {
        EmailTlsMode::ImplicitTls => TransportKind::Relay,
        EmailTlsMode::StartTls => TransportKind::StartTlsRelay,
        EmailTlsMode::Plain => TransportKind::Plain,
    }
}