You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that multiline errors aren't being handled properly. Consider this example:
ErrRecipientDomainMxCheckFailed=&smtp.SMTPError{
Code: 550,
EnhancedCode: smtp.EnhancedCode{5, 1, 2},
Message: "Recipient domain MX check failed\nthis is another line\nand another one",
}
Returning this error will cause the following exchange:
~> RCPT TO:<someone@invalidemaildomain.com>
<~* 550 5.1.2 Recipient domain MX check failed
~> QUIT
<~ this is another line
<~ and another one
<~ 221 2.0.0 Bye
This causes incorrect/premature QUIT and breaks client response readers.
Correct response should be:
<~* 550-5.1.2 Recipient domain MX check failed
<~* 550-5.1.2 this is another line
<~* 550 5.1.2 and another one
This function looks to be handling multiline responses correclty, but it's expecting text to be multiple arguments and it's getting a single multiline string.
The use case is handling gmail responses in a go-smtp server (relay mode). Here's what gmail returns:
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 https://support.google.com/mail/?p=NoSuchUser f199si8487887wmf.58 - gsmtp
Currently, it's not possible to return this error back to the client in the original form, because it's being formatted incorrectly.
The text was updated successfully, but these errors were encountered:
I believe that multiline errors aren't being handled properly. Consider this example:
Returning this error will cause the following exchange:
This causes incorrect/premature QUIT and breaks client response readers.
Correct response should be:
The issue seems to be here:
This function looks to be handling multiline responses correclty, but it's expecting
text
to be multiple arguments and it's getting a single multiline string.A (naive) fix would be something like:
Use case
The use case is handling gmail responses in a go-smtp server (relay mode). Here's what gmail returns:
Currently, it's not possible to return this error back to the client in the original form, because it's being formatted incorrectly.
The text was updated successfully, but these errors were encountered: