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
- Ignore all RCPT TO: parameters
([#651](https://github.com/chatmail/relay/pull/651))
- Use max username length in newemail.py, not min
([#648](https://github.com/chatmail/relay/pull/648))

View File

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