Bug: Error raised on bounce deliver_to &outbound_delivery
Describe the bug
What do you think is wrong?
The config:
remote_queue.bounce.deliver_to &outbound_delivery
leads to error
SMTPUTF8 is unsupported, cannot convert sender address
Background: I use Maddy as a side submission service, I want to deliver DSN to remote main service instead of local
Steps to reproduce
-
Change the default config file:
target.queue remote_queue { target &outbound_delivery autogenerated_msg_domain $(primary_domain) bounce { destination $(local_domains) { - deliver_to &local_routing + deliver_to &outbound_delivery } default_destination { reject 550 5.0.0 "Refusing to send DSNs to non-local addresses" } } } -
Submit an email with invalid RCPT
[email protected]tosubmission tls://0.0.0.0:465 -
DSNdelivery reports error
Log files
queue: delivery attempt failed {"msg_id":"74303153","rcpt":"[email protected]","reason":"Domain does not accept email (null MX)","smtp_code":556,"smtp_enchcode":"5.1.10","smtp_msg":"Domain does not accept email (null MX)"}
queue: not delivered, permanent error {"msg_id":"74303153","rcpt":"[email protected]"}
queue: generated failed DSN {"dsn_id":"44714bcf","msg_id":"74303153"}
queue: failed to enqueue DSN {"dsn_id":"9ffc9be2","effective_rcpt":"[email protected]","msg_id":"3a4d2026","reason":"address: missing at-sign","remote_server":"xxxx.com.","smtp_code":550,"smtp_enchcode":"5.6.7","smtp_msg":"SMTPUTF8 is unsupported, cannot convert sender address"}
Environment information
Did some debugging:
dsnPipeline started with empty RCPT.
https://github.com/foxcpp/maddy/blob/1d6cd8c35f4c4a1279084ae974ecfcf73a426743/internal/target/queue/queue.go#L961
The error is caused by address.ToASCII(from) with from being empty:
https://github.com/foxcpp/maddy/blob/1d6cd8c35f4c4a1279084ae974ecfcf73a426743/internal/smtpconn/smtpconn.go#L309-L327
The message is misleading, and the expected actions cannot be done.