maddy icon indicating copy to clipboard operation
maddy copied to clipboard

Correct TO string is not working anymore after upgrade

Open dimm0 opened this issue 1 year ago • 4 comments

Describe the bug

After upgrading to 0.7.1 the correct TO string like To: Name Lastname <[email protected]>\r\n is causing the error:

Was expecting RCPT arg syntax of TO:

Just the [email protected] works.

Steps to reproduce

Send mail to above recipient

Log files

Nothing in logs, but client is getting the error

  • maddy version: 0.7.1

dimm0 avatar Jul 12 '24 23:07 dimm0

go-smtp update included in 0.7.1 removed the "lax" parser for RCPT argument, that might be the reason.

I need a log with I/O to troubleshoot the issue further. Add this to your config:

smtp tcp://0.0.0.0:25 {
  io_debug
  debug
  ...
}

and try again. Look for RCPT line in the log and post it here.

foxcpp avatar Jul 23 '24 19:07 foxcpp

I get something similar..

submission: incoming message {"msg_id":"e0762daa","sender":"[email protected]","src_host":"185217ff75c7","src_ip":"4.5.3.3:33184","username":"[email protected]"} submission: RCPT ok {"msg_id":"e0762daa","rcpt":"[email protected]"} submission: DATA error {"addr":"('Test UserFullName', '[email protected]')","modifier":"submission_prepare","msg_id":"e0762daa","reason":"mail: no angle-addr","smtp_code":554,"smtp_enchcode":"5.6.0","smtp_msg":"Invalid address in To"} submission: aborted {"msg_id":"e0762daa"}

senner avatar Aug 22 '24 14:08 senner

submission: DATA error {"addr":"('Test UserFullName', '[[email protected]](mailto:[email protected])')","modifier":"submission_prepare","msg_id":"e0762daa","reason":"mail: no angle-addr","smtp_code":554,"smtp_enchcode":"5.6.0","smtp_msg":"Invalid address in To"}

Looks like you have From: Test UserFullName '[email protected]' in your message whereas the standard syntax is From: Test UserFullName <[email protected]>. maddy enforces additional checks for messages created via submission.

foxcpp avatar Aug 23 '24 17:08 foxcpp

Yah the test is coming from the Authentik server. I'll go investigate there.

senner avatar Aug 23 '24 20:08 senner

Hi @foxcpp,

We're experiencing this issue in production with maddy 0.8.1.

Error:

501 5.5.2 Was expecting RCPT arg syntax of TO:<address>

System Information:

  • Maddy Version: 0.8.1 linux/amd64 go1.23.5
  • Configuration: Standard submission endpoint on ports 465 (TLS) and 587 (TCP)

Current Status: The error is occurring but not appearing in our standard logs (as noted in the original issue - "Nothing in logs, but client is getting the error"). Even with --debug.

Since this issue was originally reported for 0.7.1, and we're seeing it in 0.8.1, is there a known fix or workaround? Should we expect this to be resolved in a future release, or is there a configuration change we can make?

groundsada avatar Nov 24 '25 23:11 groundsada