smtp_server: allow 8bit envelopes

We'll accept these in MAIL FROM and RCPT TO, and leave it to the
client to indicate whether 8bit is in use.

This is partially supporting 8BITMIME and SMTPUTF8, without
explicitly claiming support for it via the EHLO capabilities.

This is probably sufficient to approximate support for sites that are
willing to try it and advertise those extensions for themselves via
https://docs.kumomta.com/reference/events/smtp_server_ehlo/

```lua
kumo.on('smtp_server_ehlo', function(domain, conn_meta, extensions)
  table.insert(extensions, 'SMTPUTF8')
  table.insert(extensions, '8BITMIME')
  return extensions
end)
```

refs: https://github.com/KumoCorp/kumomta/issues/327
This commit is contained in:
Wez Furlong
2025-01-11 06:53:44 -07:00
parent 45802ff8a6
commit 49eb103fc2
+2 -21
View File
@@ -1418,17 +1418,7 @@ impl SmtpServer {
.await?;
continue;
}
let address = address.to_string();
if !address.is_ascii() {
self.write_response(
501,
"Syntax error: address is not ASCII and SMTPUTF8 is not supported by this server",
Some(line),
).await?;
continue;
}
let address = EnvelopeAddress::parse(&address)?;
let address = EnvelopeAddress::parse(&address.to_string())?;
if let Err(rej) = self
.call_callback::<(), _, _>(
"smtp_server_mail_from",
@@ -1462,16 +1452,7 @@ impl SmtpServer {
.await?;
continue;
}
let address = address.to_string();
if !address.is_ascii() {
self.write_response(
501,
"Syntax error: address is not ASCII and SMTPUTF8 is not supported by this server",
Some(line),
).await?;
continue;
}
let address = EnvelopeAddress::parse(&address)?;
let address = EnvelopeAddress::parse(&address.to_string())?;
let sender = self.state.as_ref().unwrap().sender.clone();
let relay_disposition = self.check_relaying(&sender, &address).await?;