Skip to content

Support setting SMTP timeouts in application.properties - #1465

Merged
labkey-adam merged 9 commits into
release26.7-SNAPSHOTfrom
26.7_fb_smtp_timeouts
Aug 13, 2026
Merged

Support setting SMTP timeouts in application.properties#1465
labkey-adam merged 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.

@labkey-adam
labkey-adam merged commit 9696735 into release26.7-SNAPSHOT Aug 13, 2026
10 checks passed
@labkey-adam
labkey-adam deleted the 26.7_fb_smtp_timeouts branch August 13, 2026 18:12
labkey-adam added a commit to LabKey/platform that referenced this pull request Aug 13, 2026
## Rationale
Having two places to configure SMTP properties (`application.properties`
and startup properties) leads to confusion and uncertainty over
merge/override behavior. Simplify to one place: application.properties.

We believe no one is configuring SMTP via startup properties, but I'm
leaving the startup property handler in place for now to provide a clear
error message and fail startup. We can remove that on develop.

## Related Pull Requests
- LabKey/server#1465
labkey-adam added a commit to LabKey/testAutomation that referenced this pull request Aug 13, 2026
## Rationale
Testing default values for these new properties

## Related Pull Requests
- LabKey/server#1465
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