Use smtp module from plume_models instead of lettre directly
This commit is contained in:
parent
00324f668f
commit
a599760891
@ -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};
|
||||||
|
13
src/mail.rs
13
src/mail.rs
@ -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;
|
||||||
|
|
||||||
|
@ -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},
|
||||||
|
Loading…
Reference in New Issue
Block a user