increase smtp timeout (#87)

This commit is contained in:
Clément DOUIN 2021-04-12 00:37:05 +02:00
parent e8ae4b025f
commit 926f476194
No known key found for this signature in database
GPG key ID: 69C9B9CFFDEE2DEF
2 changed files with 8 additions and 0 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed
- SMTP timeout [#87]
## [0.2.5] - 2021-04-12 ## [0.2.5] - 2021-04-12
### Fixed ### Fixed
@ -153,4 +157,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#75]: https://github.com/soywod/himalaya/issues/75 [#75]: https://github.com/soywod/himalaya/issues/75
[#79]: https://github.com/soywod/himalaya/issues/79 [#79]: https://github.com/soywod/himalaya/issues/79
[#83]: https://github.com/soywod/himalaya/issues/83 [#83]: https://github.com/soywod/himalaya/issues/83
[#87]: https://github.com/soywod/himalaya/issues/87
[#89]: https://github.com/soywod/himalaya/issues/89 [#89]: https://github.com/soywod/himalaya/issues/89

View file

@ -1,3 +1,5 @@
use std::time::Duration;
use error_chain::error_chain; use error_chain::error_chain;
use lettre::{self, transport::smtp::SmtpTransport, Transport}; use lettre::{self, transport::smtp::SmtpTransport, Transport};
@ -21,6 +23,7 @@ pub fn send(account: &Account, msg: &lettre::Message) -> Result<()> {
smtp_relay(&account.smtp_host)? smtp_relay(&account.smtp_host)?
.credentials(account.smtp_creds()?) .credentials(account.smtp_creds()?)
.timeout(Some(Duration::new(1000, 0)))
.build() .build()
.send(msg)?; .send(msg)?;