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]
extern crate tantivy;
pub use lettre;
pub use lettre::smtp;
use once_cell::sync::Lazy;
use plume_common::activity_pub::{inbox::InboxError, request, sign};

View file

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

View file

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