Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Error raised on bounce deliver_to &outbound_delivery #711

Open
qjebbs opened this issue Jul 2, 2024 · 0 comments
Open

Bug: Error raised on bounce deliver_to &outbound_delivery #711

qjebbs opened this issue Jul 2, 2024 · 0 comments
Labels
bug Something isn't working.

Comments

@qjebbs
Copy link

qjebbs commented Jul 2, 2024

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

  1. 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"
            }
        }
    }
  2. Submit an email with invalid RCPT invalid@example.org to submission tls://0.0.0.0:465

  3. DSN delivery reports error

Log files

queue: delivery attempt failed	{"msg_id":"74303153","rcpt":"invalid@example.org","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":"invalid@example.org"}
queue: generated failed DSN	{"dsn_id":"44714bcf","msg_id":"74303153"}
queue: failed to enqueue DSN	{"dsn_id":"9ffc9be2","effective_rcpt":"xxx@xxxx.com","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.

dsnDelivery, err := q.dsnPipeline.Start(mailCtx, dsnMeta, "")

The error is caused by address.ToASCII(from) with from being empty:

if opts.UTF8 {
if ok, _ := c.cl.Extension("SMTPUTF8"); ok {
outOpts.UTF8 = true
} else {
var err error
from, err = address.ToASCII(from)
if err != nil {
return &exterrors.SMTPError{
Code: 550,
EnhancedCode: exterrors.EnhancedCode{5, 6, 7},
Message: "SMTPUTF8 is unsupported, cannot convert sender address",
Misc: map[string]interface{}{
"remote_server": c.serverName,
},
Err: err,
}
}
}
}

The message is misleading, and the expected actions cannot be done.

@qjebbs qjebbs added the bug Something isn't working. label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant