Do not provide {auth_authen} Milter macro unless the user is authenticated

This commit is contained in:
mdecimus 2024-07-31 20:05:42 +02:00
parent 87f9736605
commit 336c4876e2

View file

@ -232,9 +232,13 @@ impl<T: SessionStream> Session<T> {
.mail_from(
&format!("<{addr}>"),
None::<&[&str]>,
Macros::new()
.with_mail_address(addr)
.with_sasl_login_name(&self.data.authenticated_as),
if !self.data.authenticated_as.is_empty() {
Macros::new()
.with_mail_address(addr)
.with_sasl_login_name(&self.data.authenticated_as)
} else {
Macros::new().with_mail_address(addr)
},
)
.await?
.assert_continue()?;