1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Remove dependency on mas-email and lettre in mas-config

This commit is contained in:
Quentin Gliech
2022-12-15 12:27:12 +01:00
parent 5cc17921e0
commit fbbb842255
8 changed files with 90 additions and 104 deletions

View File

@ -35,16 +35,16 @@ impl Mailer {
/// Constructs a new [`Mailer`]
#[must_use]
pub fn new(
templates: &Templates,
transport: &MailTransport,
from: &Mailbox,
reply_to: &Mailbox,
templates: Templates,
transport: MailTransport,
from: Mailbox,
reply_to: Mailbox,
) -> Self {
Self {
templates: templates.clone(),
transport: transport.clone(),
from: from.clone(),
reply_to: reply_to.clone(),
templates,
transport,
from,
reply_to,
}
}
@ -110,4 +110,13 @@ impl Mailer {
self.transport.send(message).await?;
Ok(())
}
/// Test the connetion to the mail server
///
/// # Errors
///
/// Returns an error if the connection failed
pub async fn test_connection(&self) -> Result<(), anyhow::Error> {
self.transport.test_connection().await
}
}