Allow null EHLO when reject-non-fqdn is not set

This commit is contained in:
mdecimus 2025-07-03 21:21:55 -04:00
parent 49bb6ad61d
commit b2f0525423

View file

@ -299,12 +299,17 @@ impl<T: SessionStream> Session<T> {
Details = syntax Details = syntax
); );
if !self.params.ehlo_reject_non_fqdn && syntax.starts_with("EHLO ")
{
self.handle_ehlo("null".to_string(), true).await?
} else {
self.write( self.write(
format!("501 5.5.2 Syntax error, expected: {syntax}\r\n") format!("501 5.5.2 Syntax error, expected: {syntax}\r\n")
.as_bytes(), .as_bytes(),
) )
.await?; .await?;
} }
}
Error::InvalidParameter { param } => { Error::InvalidParameter { param } => {
trc::event!( trc::event!(
Smtp(SmtpEvent::InvalidParameter), Smtp(SmtpEvent::InvalidParameter),