fix "from" address parsing

This commit is contained in:
Vincent Breitmoser 2019-06-06 18:17:58 +02:00
parent 38926b4cda
commit 117ea2c168
No known key found for this signature in database
GPG Key ID: 7BD18320DEADFA11
1 changed files with 3 additions and 3 deletions

View File

@ -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,