mirror of
https://github.com/soywod/himalaya.git
synced 2024-11-25 04:20:22 +00:00
generate Message-Id header with uuid and from address domain (#171)
This commit is contained in:
parent
8e40cc3ddb
commit
fadebf0997
1 changed files with 5 additions and 2 deletions
|
@ -291,8 +291,11 @@ impl<'m> Msg<'m> {
|
|||
|
||||
match h.get_key().to_lowercase().as_str() {
|
||||
"in-reply-to" => msg.in_reply_to(value.parse().unwrap()),
|
||||
"from" => match value.parse() {
|
||||
Ok(addr) => msg.from(addr),
|
||||
"from" => match value.parse::<lettre::message::Mailbox>() {
|
||||
Ok(addr) => {
|
||||
let msg_id = format!("{}@{}", Uuid::new_v4().to_string(), addr.email.domain());
|
||||
msg.from(addr).message_id(Some(msg_id))
|
||||
}
|
||||
Err(_) => msg,
|
||||
},
|
||||
"to" => value
|
||||
|
|
Loading…
Reference in a new issue