From a599760891c652842848cb609fa08430f4e07974 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 3 Jan 2022 17:28:37 +0900 Subject: [PATCH] Use smtp module from plume_models instead of lettre directly --- plume-models/src/lib.rs | 1 + src/mail.rs | 13 +++++-------- src/routes/session.rs | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/plume-models/src/lib.rs b/plume-models/src/lib.rs index 408c7613..9b7f53e1 100644 --- a/plume-models/src/lib.rs +++ b/plume-models/src/lib.rs @@ -16,6 +16,7 @@ extern crate serde_json; #[macro_use] extern crate tantivy; +pub use lettre; pub use lettre::smtp; use once_cell::sync::Lazy; use plume_common::activity_pub::{inbox::InboxError, request, sign}; diff --git a/src/mail.rs b/src/mail.rs index e161effd..efb6172f 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -6,7 +6,7 @@ pub use self::mailer::*; #[cfg(feature = "debug-mailer")] mod mailer { - use lettre::{SendableEmail, Transport}; + use plume_models::smtp::{SendableEmail, Transport}; use std::io::Read; pub struct DebugTransport; @@ -46,13 +46,10 @@ mod mailer { #[cfg(not(feature = "debug-mailer"))] mod mailer { - use lettre::{ - smtp::{ - authentication::{Credentials, Mechanism}, - extension::ClientId, - ConnectionReuseParameters, - }, - SmtpClient, SmtpTransport, + use plume_models::smtp::{ + authentication::{Credentials, Mechanism}, + extension::ClientId, + ConnectionReuseParameters, SmtpClient, SmtpTransport, }; use plume_models::CONFIG; diff --git a/src/routes/session.rs b/src/routes/session.rs index 68ad84d3..3264868b 100644 --- a/src/routes/session.rs +++ b/src/routes/session.rs @@ -1,5 +1,5 @@ use crate::routes::RespondOrRedirect; -use lettre::Transport; +use plume_models::lettre::Transport; use rocket::http::ext::IntoOwned; use rocket::{ http::{uri::Uri, Cookie, Cookies, SameSite},