Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
364e40f5d9 | ||
|
|
cb08bc5527 | ||
|
|
6c7c3ba9fa | ||
|
|
53e79c0ac4 |
@@ -1,3 +1,12 @@
|
||||
### v0.6.2 (2017-02-18)
|
||||
|
||||
#### Features
|
||||
|
||||
* **all**
|
||||
* Update uuid crate to 0.4
|
||||
* Update env-logger crate to 0.4
|
||||
* Update openssl crate to 0.9
|
||||
|
||||
### v0.6.1 (2016-10-19)
|
||||
|
||||
#### Features
|
||||
|
||||
22
Cargo.toml
22
Cargo.toml
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
|
||||
name = "lettre"
|
||||
version = "0.6.1"
|
||||
version = "0.6.2"
|
||||
description = "Email client"
|
||||
readme = "README.md"
|
||||
documentation = "https://lettre.github.io/lettre/"
|
||||
@@ -11,18 +11,18 @@ authors = ["Alexis Mousset <contact@amousset.me>"]
|
||||
keywords = ["email", "smtp", "mailer"]
|
||||
|
||||
[dependencies]
|
||||
bufstream = "0.1"
|
||||
email = "0.0"
|
||||
log = "0.3"
|
||||
mime = "0.2"
|
||||
openssl = "0.8"
|
||||
rustc-serialize = "0.3"
|
||||
rust-crypto = "0.2"
|
||||
time = "0.1"
|
||||
uuid = { version = "0.3", features = ["v4"] }
|
||||
bufstream = "^0.1"
|
||||
email = "^0.0"
|
||||
log = "^0.3"
|
||||
mime = "^0.2"
|
||||
openssl = "^0.9"
|
||||
rustc-serialize = "^0.3"
|
||||
rust-crypto = "^0.2"
|
||||
time = "^0.1"
|
||||
uuid = { version = "^0.4", features = ["v4"] }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.3"
|
||||
env_logger = "^0.4"
|
||||
|
||||
[features]
|
||||
unstable = []
|
||||
|
||||
@@ -22,6 +22,7 @@ Lettre provides the following features:
|
||||
Released versions:
|
||||
|
||||
* [latest](https://lettre.github.io/lettre/)
|
||||
* [v0.6.2](https://lettre.github.io/lettre/v0.6.2/lettre/)
|
||||
* [v0.6.1](https://lettre.github.io/lettre/v0.6.1/lettre/)
|
||||
* [v0.6.0](https://lettre.github.io/lettre/v0.6.0/lettre/)
|
||||
* [v0.5.1](https://lettre.github.io/lettre/v0.5.1/lettre/)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//! A trait to represent a stream
|
||||
|
||||
|
||||
use openssl::ssl::{SslContext, SslStream};
|
||||
use openssl::ssl::{Ssl, SslContext, SslStream};
|
||||
use std::fmt;
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::io;
|
||||
@@ -24,9 +23,13 @@ impl Connector for NetworkStream {
|
||||
|
||||
match ssl_context {
|
||||
Some(context) => {
|
||||
match SslStream::connect(context, tcp_stream) {
|
||||
Ok(stream) => Ok(NetworkStream::Ssl(stream)),
|
||||
Err(err) => Err(io::Error::new(ErrorKind::Other, err)),
|
||||
match Ssl::new(context) {
|
||||
Ok(ssl) => {
|
||||
ssl.connect(tcp_stream)
|
||||
.map(|s| NetworkStream::Ssl(s))
|
||||
.map_err(|e| io::Error::new(ErrorKind::Other, e))
|
||||
}
|
||||
Err(e) => Err(io::Error::new(ErrorKind::Other, e)),
|
||||
}
|
||||
}
|
||||
None => Ok(NetworkStream::Plain(tcp_stream)),
|
||||
@@ -37,11 +40,16 @@ impl Connector for NetworkStream {
|
||||
|
||||
*self = match *self {
|
||||
NetworkStream::Plain(ref mut stream) => {
|
||||
match SslStream::connect(ssl_context, stream.try_clone().unwrap()) {
|
||||
match Ssl::new(ssl_context) {
|
||||
Ok(ssl) => {
|
||||
match ssl.connect(stream.try_clone().unwrap()) {
|
||||
Ok(ssl_stream) => NetworkStream::Ssl(ssl_stream),
|
||||
Err(err) => return Err(io::Error::new(ErrorKind::Other, err)),
|
||||
}
|
||||
}
|
||||
Err(e) => return Err(io::Error::new(ErrorKind::Other, e)),
|
||||
}
|
||||
}
|
||||
NetworkStream::Ssl(_) => return Ok(()),
|
||||
};
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ impl SmtpTransportBuilder {
|
||||
Some(addr) => {
|
||||
Ok(SmtpTransportBuilder {
|
||||
server_addr: addr,
|
||||
ssl_context: SslContext::new(SslMethod::Tlsv1).unwrap(),
|
||||
ssl_context: SslContext::builder(SslMethod::tls()).unwrap().build(),
|
||||
security_level: SecurityLevel::Opportunistic,
|
||||
smtp_utf8: false,
|
||||
credentials: None,
|
||||
|
||||
Reference in New Issue
Block a user