Skip to main content

mail_auth/common/
mod.rs

1/*
2 * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <hello@stalw.art>
3 *
4 * SPDX-License-Identifier: Apache-2.0 OR MIT
5 */
6
7use crate::DnsError;
8use crate::{Error, IprevResult};
9
10pub mod auth_results;
11pub mod base32;
12pub mod cache;
13pub mod crypto;
14#[cfg(feature = "dns-doh")]
15pub mod doh;
16pub mod headers;
17pub mod message;
18pub mod parse;
19pub mod resolver;
20pub mod verify;
21
22impl From<Error> for IprevResult {
23    fn from(err: Error) -> Self {
24        if matches!(&err, Error::Dns(DnsError::Resolver(_))) {
25            IprevResult::TempError(err)
26        } else {
27            IprevResult::PermError(err)
28        }
29    }
30}