Update dependencies

This commit is contained in:
Alexis Mousset
2019-11-14 19:49:17 +01:00
parent 24d694db3b
commit 75c640b4a9
4 changed files with 21 additions and 13 deletions

View File

@@ -24,8 +24,8 @@ log = "^0.4"
nom = { version = "^5.0", optional = true }
bufstream = { version = "^0.1", optional = true }
native-tls = { version = "^0.2", optional = true }
base64 = { version = "^0.10", optional = true }
hostname = { version = "^0.1", optional = true }
base64 = { version = "^0.11", optional = true }
hostname = { version = "^0.2", optional = true }
serde = { version = "^1.0", optional = true }
serde_json = { version = "^1.0", optional = true }
serde_derive = { version = "^1.0", optional = true }
@@ -33,7 +33,7 @@ fast_chemail = "^0.9"
r2d2 = { version = "^0.8", optional = true}
[dev-dependencies]
env_logger = "^0.6"
env_logger = "^0.7"
glob = "^0.3"
criterion = "^0.3"

View File

@@ -4,7 +4,6 @@ use crate::smtp::authentication::Mechanism;
use crate::smtp::error::Error;
use crate::smtp::response::Response;
use crate::smtp::util::XText;
use hostname::get_hostname;
use std::collections::HashSet;
use std::fmt::{self, Display, Formatter};
use std::net::{Ipv4Addr, Ipv6Addr};
@@ -47,7 +46,12 @@ impl ClientId {
/// Defines a `ClientId` with the current hostname, of `localhost` if hostname could not be
/// found
pub fn hostname() -> ClientId {
ClientId::Domain(get_hostname().unwrap_or_else(|| DEFAULT_DOMAIN_CLIENT_ID.to_string()))
ClientId::Domain(
hostname::get()
.map_err(|_| ())
.and_then(|s| s.into_string().map_err(|_| ()))
.unwrap_or_else(|_| DEFAULT_DOMAIN_CLIENT_ID.to_string()),
)
}
}

View File

@@ -342,17 +342,21 @@ impl<'a> SmtpTransport {
{
found = true;
try_smtp!(
self.client
.auth(mechanism, self.client_info.credentials.as_ref().unwrap(),),
self
);
self.client
.auth(mechanism, self.client_info.credentials.as_ref().unwrap(),),
self
);
break;
}
}
} else {
try_smtp!(
self.client.auth(self.client_info.authentication_mechanism.expect(
"force_set_auth set to true, but no authentication mechanism set"), self.client_info.credentials.as_ref().unwrap(),),
self.client.auth(
self.client_info.authentication_mechanism.expect(
"force_set_auth set to true, but no authentication mechanism set"
),
self.client_info.credentials.as_ref().unwrap(),
),
self
);
found = true;

View File

@@ -27,6 +27,6 @@ glob = "0.3"
email = "^0.0.20"
mime = "^0.3"
time = "^0.1"
uuid = { version = "^0.7", features = ["v4"] }
uuid = { version = "^0.8", features = ["v4"] }
lettre = { version = "^0.9", path = "../lettre", default-features = false }
base64 = "^0.10"
base64 = "^0.11"