Use smtp module from plume_models instead of lettre directly

This commit is contained in:
Kitaiti Makoto 2022-01-03 17:28:37 +09:00
parent 00324f668f
commit a599760891
3 changed files with 7 additions and 9 deletions

View File

@ -16,6 +16,7 @@ extern crate serde_json;
#[macro_use] #[macro_use]
extern crate tantivy; extern crate tantivy;
pub use lettre;
pub use lettre::smtp; pub use lettre::smtp;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use plume_common::activity_pub::{inbox::InboxError, request, sign}; use plume_common::activity_pub::{inbox::InboxError, request, sign};

View File

@ -6,7 +6,7 @@ pub use self::mailer::*;
#[cfg(feature = "debug-mailer")] #[cfg(feature = "debug-mailer")]
mod mailer { mod mailer {
use lettre::{SendableEmail, Transport}; use plume_models::smtp::{SendableEmail, Transport};
use std::io::Read; use std::io::Read;
pub struct DebugTransport; pub struct DebugTransport;
@ -46,13 +46,10 @@ mod mailer {
#[cfg(not(feature = "debug-mailer"))] #[cfg(not(feature = "debug-mailer"))]
mod mailer { mod mailer {
use lettre::{ use plume_models::smtp::{
smtp::{ authentication::{Credentials, Mechanism},
authentication::{Credentials, Mechanism}, extension::ClientId,
extension::ClientId, ConnectionReuseParameters, SmtpClient, SmtpTransport,
ConnectionReuseParameters,
},
SmtpClient, SmtpTransport,
}; };
use plume_models::CONFIG; use plume_models::CONFIG;

View File

@ -1,5 +1,5 @@
use crate::routes::RespondOrRedirect; use crate::routes::RespondOrRedirect;
use lettre::Transport; use plume_models::lettre::Transport;
use rocket::http::ext::IntoOwned; use rocket::http::ext::IntoOwned;
use rocket::{ use rocket::{
http::{uri::Uri, Cookie, Cookies, SameSite}, http::{uri::Uri, Cookie, Cookies, SameSite},