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( .mail_from(
&format!("<{addr}>"), &format!("<{addr}>"),
None::<&[&str]>, None::<&[&str]>,
Macros::new() if !self.data.authenticated_as.is_empty() {
.with_mail_address(addr) Macros::new()
.with_sasl_login_name(&self.data.authenticated_as), .with_mail_address(addr)
.with_sasl_login_name(&self.data.authenticated_as)
} else {
Macros::new().with_mail_address(addr)
},
) )
.await? .await?
.assert_continue()?; .assert_continue()?;