fix: ignore all RCPT TO: parameters

Stalwart sends `NOTIFY=DELAY,FAILURE`
to request Delivery Status Notifications.
aiosmtpd does not support any parameters,
not just ORCPT, so we have to ignore all of them.
This commit is contained in:
link2xt
2025-10-04 02:47:07 +00:00
committed by l
parent 6e28cf9ca1
commit d091b865c7
2 changed files with 10 additions and 5 deletions

View File

@@ -2,6 +2,9 @@
## untagged ## untagged
- Ignore all RCPT TO: parameters
([#651](https://github.com/chatmail/relay/pull/651))
- Use max username length in newemail.py, not min - Use max username length in newemail.py, not min
([#648](https://github.com/chatmail/relay/pull/648)) ([#648](https://github.com/chatmail/relay/pull/648))

View File

@@ -197,11 +197,13 @@ class HackedController(Controller):
class SMTPDiscardRCPTO_options(SMTP): class SMTPDiscardRCPTO_options(SMTP):
def _getparams(self, params): def _getparams(self, params):
# aiosmtpd's SMTP daemon fails to handle a request if there are RCPT TO options # Ignore RCPT TO parameters.
# We just ignore them for our incoming filtermail purposes #
if len(params) == 1 and params[0].startswith("ORCPT"): # Otherwise parameters such as `ORCPT=...`
return {} # or `NOTIFY=DELAY,FAILURE` (generated by Stalwart)
return super()._getparams(params) # make aiosmtpd reject the message here:
# <https://github.com/aio-libs/aiosmtpd/blob/98f578389ae86e5345cc343fa4e5a17b21d9c96d/aiosmtpd/smtp.py#L1379-L1384>
return {}
class OutgoingBeforeQueueHandler: class OutgoingBeforeQueueHandler: