Skip to content

Commit 1bc2544

Browse files
committed
v0.7.1
1 parent e759793 commit 1bc2544

File tree

4 files changed

+28
-41
lines changed

4 files changed

+28
-41
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
mail-auth 0.7.1
2+
================================
3+
- Bump `hickory-resolver`to 0.26.0-alpha.1
4+
- Bump `zip` to 4.0
5+
16
mail-auth 0.7.0
27
================================
3-
- Bump to `mail-parser` 0.11.
4-
- Bump to `hickory-resolver` 0.25.
8+
- Bump `mail-parser` to 0.11.
9+
- Bump `hickory-resolver` to 0.25.
510
- Added `rkyv` support.
611
- Make `zip` dependency optional.
712

813
mail-auth 0.6.1
914
================================
10-
- Bump to `mail-parser` 0.10.0.
15+
- Bump `mail-parser` to 0.10.0.
1116

1217
mail-auth 0.6.0
1318
================================

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "mail-auth"
33
description = "DKIM, ARC, SPF and DMARC library for Rust"
4-
version = "0.7.0"
4+
version = "0.7.1"
55
edition = "2021"
6-
authors = [ "Stalwart Labs <[email protected]>"]
6+
authors = [ "Stalwart Labs LLC <[email protected]>"]
77
license = "Apache-2.0 OR MIT"
88
repository = "https://github.com/stalwartlabs/mail-auth"
99
homepage = "https://github.com/stalwartlabs/mail-auth"
@@ -37,8 +37,8 @@ serde = { version = "1.0", features = ["derive"] }
3737
serde_json = "1.0"
3838
sha1 = { version = "0.10", features = ["oid"], optional = true }
3939
sha2 = { version = "0.10.6", features = ["oid"], optional = true }
40-
hickory-resolver = { version = "0.25", features = ["tls-ring", "dnssec-ring"] }
41-
zip = { version = "2.1.1", optional = true }
40+
hickory-resolver = { version = "=0.26.0-alpha.1", features = ["tls-ring", "dnssec-ring"] }
41+
zip = { version = "4.0", optional = true }
4242
rand = { version = "0.8.5", optional = true }
4343
quick_cache = "0.6.9"
4444
rkyv = { version = "0.8.10", optional = true }

src/common/resolver.rs

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use std::{
1414
use hickory_resolver::{
1515
config::{ResolverConfig, ResolverOpts},
1616
name_server::TokioConnectionProvider,
17-
proto::ProtoErrorKind,
17+
proto::{ProtoError, ProtoErrorKind},
1818
system_conf::read_system_conf,
19-
Name, ResolveError, ResolveErrorKind, TokioResolver,
19+
Name, TokioResolver,
2020
};
2121

2222
use crate::{
@@ -35,32 +35,32 @@ pub struct DnsEntry<T> {
3535
}
3636

3737
impl MessageAuthenticator {
38-
pub fn new_cloudflare_tls() -> Result<Self, ResolveError> {
38+
pub fn new_cloudflare_tls() -> Result<Self, ProtoError> {
3939
Self::new(ResolverConfig::cloudflare_tls(), ResolverOpts::default())
4040
}
4141

42-
pub fn new_cloudflare() -> Result<Self, ResolveError> {
42+
pub fn new_cloudflare() -> Result<Self, ProtoError> {
4343
Self::new(ResolverConfig::cloudflare(), ResolverOpts::default())
4444
}
4545

46-
pub fn new_google() -> Result<Self, ResolveError> {
46+
pub fn new_google() -> Result<Self, ProtoError> {
4747
Self::new(ResolverConfig::google(), ResolverOpts::default())
4848
}
4949

50-
pub fn new_quad9() -> Result<Self, ResolveError> {
50+
pub fn new_quad9() -> Result<Self, ProtoError> {
5151
Self::new(ResolverConfig::quad9(), ResolverOpts::default())
5252
}
5353

54-
pub fn new_quad9_tls() -> Result<Self, ResolveError> {
54+
pub fn new_quad9_tls() -> Result<Self, ProtoError> {
5555
Self::new(ResolverConfig::quad9_tls(), ResolverOpts::default())
5656
}
5757

58-
pub fn new_system_conf() -> Result<Self, ResolveError> {
58+
pub fn new_system_conf() -> Result<Self, ProtoError> {
5959
let (config, options) = read_system_conf()?;
6060
Self::new(config, options)
6161
}
6262

63-
pub fn new(config: ResolverConfig, options: ResolverOpts) -> Result<Self, ResolveError> {
63+
pub fn new(config: ResolverConfig, options: ResolverOpts) -> Result<Self, ProtoError> {
6464
Ok(MessageAuthenticator(
6565
TokioResolver::builder_with_config(config, TokioConnectionProvider::default())
6666
.with_options(options)
@@ -406,28 +406,19 @@ impl MessageAuthenticator {
406406
)
407407
})),
408408
Err(err) => match err.kind() {
409-
ResolveErrorKind::Proto(proto) => {
410-
if let ProtoErrorKind::NoRecordsFound { .. } = proto.kind() {
411-
Ok(false)
412-
} else {
413-
Err(err.into())
414-
}
415-
}
409+
ProtoErrorKind::NoRecordsFound { .. } => Ok(false),
416410
_ => Err(err.into()),
417411
},
418412
}
419413
}
420414
}
421415

422-
impl From<ResolveError> for Error {
423-
fn from(err: ResolveError) -> Self {
416+
impl From<ProtoError> for Error {
417+
fn from(err: ProtoError) -> Self {
424418
match err.kind() {
425-
ResolveErrorKind::Proto(proto) => match proto.kind() {
426-
ProtoErrorKind::NoRecordsFound { response_code, .. } => {
427-
Error::DnsRecordNotFound(*response_code)
428-
}
429-
_ => Error::DnsError(err.to_string()),
430-
},
419+
ProtoErrorKind::NoRecordsFound(response_code) => {
420+
Error::DnsRecordNotFound(response_code.response_code)
421+
}
431422
_ => Error::DnsError(err.to_string()),
432423
}
433424
}

src/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use arc::Set;
1010
use common::{crypto::HashAlgorithm, headers::Header, verify::DomainKey};
1111
use dkim::{Atps, Canonicalization, DomainKeyReport};
1212
use dmarc::Dmarc;
13-
use hickory_resolver::{
14-
proto::{op::ResponseCode, ProtoError},
15-
TokioResolver,
16-
};
13+
use hickory_resolver::{proto::op::ResponseCode, TokioResolver};
1714
use mta_sts::{MtaSts, TlsRpt};
1815
use spf::{Macro, Spf};
1916
use std::{
@@ -352,12 +349,6 @@ impl From<io::Error> for Error {
352349
}
353350
}
354351

355-
impl From<ProtoError> for Error {
356-
fn from(err: ProtoError) -> Self {
357-
Error::DnsError(err.to_string())
358-
}
359-
}
360-
361352
#[cfg(feature = "rsa")]
362353
impl From<rsa::errors::Error> for Error {
363354
fn from(err: rsa::errors::Error) -> Self {

0 commit comments

Comments
 (0)