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 failure;
use handlebars::Handlebars; use handlebars::Handlebars;
use lettre::{Transport as LettreTransport, SendmailTransport, file::FileTransport}; use lettre::{Transport as LettreTransport, SendmailTransport, file::FileTransport};
use lettre_email::EmailBuilder; use lettre_email::{Mailbox,EmailBuilder};
use url; use url;
use serde::Serialize; use serde::Serialize;
@ -29,7 +29,7 @@ mod context {
} }
pub struct Service { pub struct Service {
from: String, from: Mailbox,
base_uri: String, base_uri: String,
domain: String, domain: String,
templates: Handlebars, templates: Handlebars,
@ -63,7 +63,7 @@ impl Service {
?.host_str().ok_or_else(|| failure::err_msg("No host in base-URI")) ?.host_str().ok_or_else(|| failure::err_msg("No host in base-URI"))
?.to_string(); ?.to_string();
Ok(Self { Ok(Self {
from: from, from: from.parse().unwrap(),
base_uri: base_uri, base_uri: base_uri,
domain: domain, domain: domain,
templates: templates, templates: templates,