Skip to content

Support setting SMTP timeouts in application.properties - #1465

Open
labkey-adam wants to merge 9 commits into
release26.7-SNAPSHOTfrom
26.7_fb_smtp_timeouts
Open

Support setting SMTP timeouts in application.properties#1465
labkey-adam wants to merge 9 commits into
release26.7-SNAPSHOTfrom
26.7_fb_smtp_timeouts

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Rationale

Lack of SMTP timeouts can lead to unresponsive servers:

Changes

  • Wire up three SMTP timeout properties: application.properties -> MailProperties -> StandardContext
  • Move a few constants from LabKeyServer to LabKeyTomcatServletWebServerFactory (the one place where they're used)

// GitHub Issue #1416 - default values for SMTP timeouts
put("mail.smtpConnectionTimeout", 10 * 1000);
put("mail.smtpTimeout", 60 * 1000);
// Unlike the socket-level timeouts above, JavaMail implements writetimeout with a ScheduledThreadPool per connection - one per message, since Transport.send() doesn't pool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this comment helpful?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Claude was insistent. It did inspire some ideas that I documented here: https://github.com/LabKey/internal-issues/issues/1438

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Feel free to tell Claude I find it irrelevant.

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.

2 participants