Skip to content

[JENKINS-68518] Email-ext treats transient SMTP errors as fatal errors#1473

Open
akash-manna-sky wants to merge 12 commits intojenkinsci:mainfrom
akash-manna-sky:JENKINS-68518
Open

[JENKINS-68518] Email-ext treats transient SMTP errors as fatal errors#1473
akash-manna-sky wants to merge 12 commits intojenkinsci:mainfrom
akash-manna-sky:JENKINS-68518

Conversation

@akash-manna-sky
Copy link
Contributor

[JENKINS-68518] Email-ext treats transient SMTP errors as fatal errors

Fixes #1380

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@akash-manna-sky akash-manna-sky marked this pull request as ready for review February 27, 2026 11:33
@akash-manna-sky akash-manna-sky requested a review from a team as a code owner February 27, 2026 11:33
@akash-manna-sky
Copy link
Contributor Author

Please review the changes. @slide

Copy link
Member

@slide slide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment

@akash-manna-sky akash-manna-sky requested a review from slide March 7, 2026 20:07
@slide
Copy link
Member

slide commented Mar 18, 2026

Please rebase

@akash-manna-sky
Copy link
Contributor Author

Please rebase

I updated my branch. Please review. @slide

@ArpanC6
Copy link

ArpanC6 commented Mar 18, 2026

Hi @akash-manna-sky! The implementation looks solid. A few observations after reviewing the code:
Strengths:

isTransientSmtpError() correctly handles exception chaining via getNextException() and getCause()
Reflection-based getSmtpReturnCode() is a smart approach to avoid compile-time dependency on SMTP classes
Test coverage is comprehensive — boundary cases (399, 400, 499, 500) are well covered

One suggestion: In parseSmtpErrorCode(), the regex ^(\d{3})\s only matches codes at the start of the message. Some SMTP servers return messages like "Temporary error: 421 Service unavailable" where the code is not at the start. Consider also checking mid-message patterns.
All 17 CI checks are passing and the rebase looks clean. Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-68518] Email-ext treats transient SMTP errors as fatal errors

3 participants