You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-07 17:03:01 +03:00
Move some common dependencies on the workspace level
Also deprecates the AWS SESv2 transport for emails
This commit is contained in:
@@ -89,7 +89,7 @@ impl Options {
|
||||
let templates = templates_from_config(&config.templates, &url_builder).await?;
|
||||
|
||||
if !self.no_worker {
|
||||
let mailer = mailer_from_config(&config.email, &templates).await?;
|
||||
let mailer = mailer_from_config(&config.email, &templates)?;
|
||||
mailer.test_connection().await?;
|
||||
|
||||
#[allow(clippy::disallowed_methods)]
|
||||
|
@@ -46,7 +46,7 @@ impl Options {
|
||||
// Load and compile the templates
|
||||
let templates = templates_from_config(&config.templates, &url_builder).await?;
|
||||
|
||||
let mailer = mailer_from_config(&config.email, &templates).await?;
|
||||
let mailer = mailer_from_config(&config.email, &templates)?;
|
||||
mailer.test_connection().await?;
|
||||
|
||||
let http_client_factory = HttpClientFactory::new(50);
|
||||
|
@@ -55,7 +55,7 @@ pub async fn password_manager_from_config(
|
||||
PasswordManager::new(schemes)
|
||||
}
|
||||
|
||||
pub async fn mailer_from_config(
|
||||
pub fn mailer_from_config(
|
||||
config: &EmailConfig,
|
||||
templates: &Templates,
|
||||
) -> Result<Mailer, anyhow::Error> {
|
||||
@@ -83,7 +83,8 @@ pub async fn mailer_from_config(
|
||||
.context("failed to build SMTP transport")?
|
||||
}
|
||||
EmailTransportConfig::Sendmail { command } => MailTransport::sendmail(command),
|
||||
EmailTransportConfig::AwsSes => MailTransport::aws_ses().await?,
|
||||
#[allow(deprecated)]
|
||||
EmailTransportConfig::AwsSes => anyhow::bail!("AWS SESv2 backend has been removed"),
|
||||
};
|
||||
|
||||
Ok(Mailer::new(templates.clone(), transport, from, reply_to))
|
||||
|
Reference in New Issue
Block a user