Repository navigation
fix(exterrors): Keep 4.x.x enhanced code for temporary errors in SMTPEnchCode - #903
Open
kabeer7121 wants to merge 1 commit into
Open
kabeer7121 wants to merge 1 commit into
kabeer7121 wants to merge 1 commit into
Conversation
…EnchCode SMTPEnchCode set the class digit to 4 for temporary errors and then unconditionally overwrote it with 5, so every caller got a 5.x.x enhanced code. For remote delivery this produced replies like "451 5.4.0 No usable MXs" where the basic code says retry and the enhanced code says permanent failure. Only set 5 when the error is not temporary. Refs foxcpp#893 Signed-off-by: Kabeer Ahmed <kabeerahmed7121@gmail.com>
Owner
|
FYI Contributions written by LLMs must have Signed-Off-By trailer in commit description to indicate your agreement to the Developer Certificate of Origin. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SMTPEnchCodesets the first digit to 4 for temporary errors but then always overwrites it with 5:So every caller gets a 5.x.x enhanced code, even when
SMTPCodepicked a 4xx basic code for the same error. Intarget/remotethat shows up as451 5.4.0 No usable MXs, last err: ...for connection refused / no route to host, which is one of the cases reported in #893. The other callers (MX lookup, DNS errors in smtpconn, etc.) have the same mismatch.This only sets 5 when the error is not temporary, and adds a small test for
SMTPEnchCode. It doesn't change which errors are treated as temporary, so it's only part of #893.Tested with
go test ./framework/exterrors/ ./internal/target/remote/ ./internal/smtpconn/(the new test fails without the fix).