mail: set message id with own host in outgoing mail
This commit is contained in:
parent
ab3f4006dd
commit
03b5462744
|
@ -631,6 +631,7 @@ dependencies = [
|
|||
"tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ handlebars = "1.1.0"
|
|||
num_cpus = "1.0"
|
||||
ring = "0.13"
|
||||
base64 = "0.10"
|
||||
uuid = "0.7"
|
||||
|
||||
[dependencies.lettre]
|
||||
version = "0.9"
|
||||
|
|
|
@ -6,6 +6,7 @@ use lettre::{Transport as LettreTransport, SendmailTransport, file::FileTranspor
|
|||
use lettre_email::{Mailbox,EmailBuilder};
|
||||
use url;
|
||||
use serde::Serialize;
|
||||
use uuid::Uuid;
|
||||
|
||||
use database::types::Email;
|
||||
use Result;
|
||||
|
@ -136,7 +137,8 @@ impl Service {
|
|||
.alternative(
|
||||
html.ok_or(failure::err_msg("Email template failed to render"))?,
|
||||
txt.ok_or(failure::err_msg("Email template failed to render"))?,
|
||||
);
|
||||
)
|
||||
.message_id(format!("<{}@{}>", Uuid::new_v4(), self.domain));
|
||||
|
||||
let email = to.iter().fold(email, |email, to| email.to(to.to_string()));
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ extern crate handlebars;
|
|||
extern crate lettre;
|
||||
extern crate lettre_email;
|
||||
extern crate tempfile;
|
||||
extern crate uuid;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate regex;
|
||||
|
|
Loading…
Reference in New Issue