From 117ea2c168c2e3478982404d0c5efa74879ec108 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 6 Jun 2019 18:17:58 +0200 Subject: [PATCH] fix "from" address parsing --- src/mail.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mail.rs b/src/mail.rs index 002a22c..8e8af1a 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use failure; use handlebars::Handlebars; use lettre::{Transport as LettreTransport, SendmailTransport, file::FileTransport}; -use lettre_email::EmailBuilder; +use lettre_email::{Mailbox,EmailBuilder}; use url; use serde::Serialize; @@ -29,7 +29,7 @@ mod context { } pub struct Service { - from: String, + from: Mailbox, base_uri: String, domain: String, templates: Handlebars, @@ -63,7 +63,7 @@ impl Service { ?.host_str().ok_or_else(|| failure::err_msg("No host in base-URI")) ?.to_string(); Ok(Self { - from: from, + from: from.parse().unwrap(), base_uri: base_uri, domain: domain, templates: templates,