1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Flatten the email config

This commit is contained in:
Quentin Gliech
2024-03-21 13:53:38 +01:00
parent bf50469da1
commit 6d77d0ed25
5 changed files with 293 additions and 161 deletions

View File

@ -92,10 +92,13 @@ impl Transport {
/// Construct a Sendmail transport
#[must_use]
pub fn sendmail(command: impl Into<OsString>) -> Self {
Self::new(TransportInner::Sendmail(
AsyncSendmailTransport::new_with_command(command),
))
pub fn sendmail(command: Option<impl Into<OsString>>) -> Self {
let transport = if let Some(command) = command {
AsyncSendmailTransport::new_with_command(command)
} else {
AsyncSendmailTransport::new()
};
Self::new(TransportInner::Sendmail(transport))
}
}