From 7426a168b66231322e302d43b8e3f033fedf77d3 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Mon, 10 Aug 2026 09:28:03 -0700 Subject: [PATCH 1/5] Stop supporting SMTP startup properties --- .../api/util/SmtpTransportProvider.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/api/src/org/labkey/api/util/SmtpTransportProvider.java b/api/src/org/labkey/api/util/SmtpTransportProvider.java index 5825b583aa4..0306d0528cc 100644 --- a/api/src/org/labkey/api/util/SmtpTransportProvider.java +++ b/api/src/org/labkey/api/util/SmtpTransportProvider.java @@ -56,7 +56,7 @@ public String getPropertyName() @Override public String getDescription() { - return "One property for each JavaMail SMTP setting, documented here: https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html"; + return "No longer supported. Configure SMTP setting in application.properties."; } } @@ -71,29 +71,25 @@ public void loadConfiguration() { try { - // Load from startup properties group "mail_smtp" + // TODO: Leave in place for now to provide clear error if startup properties are present. Remove in 25.11. ModuleLoader.getInstance().handleStartupProperties( new LenientStartupPropertyHandler<>("mail_smtp", new SmtpStartupProperty()) { @Override public void handle(Collection entries) { - entries.forEach(entry -> - _properties.put("mail.smtp." + entry.getName(), entry.getValue())); + throw new RuntimeException("Configuring SMTP via startup properties is no longer supported. Use application.properties."); } }); - // Fallback: check ServletContext for SMTP settings - if (_properties.isEmpty()) + // Load SMTP settings from ServletContext (populated from application.properties)) + ServletContext context = ModuleLoader.getServletContext(); + Enumeration names = Objects.requireNonNull(context).getInitParameterNames(); + while (names.hasMoreElements()) { - ServletContext context = ModuleLoader.getServletContext(); - Enumeration names = Objects.requireNonNull(context).getInitParameterNames(); - while (names.hasMoreElements()) - { - String name = names.nextElement(); - if (name.startsWith("mail.smtp.")) - _properties.put(name, context.getInitParameter(name)); - } + String name = names.nextElement(); + if (name.startsWith("mail.smtp.")) + _properties.put(name, context.getInitParameter(name)); } // Create session if configured From dd7500d41b8adfb5e67bdf19ed72def7ff699635 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Mon, 10 Aug 2026 10:34:22 -0700 Subject: [PATCH 2/5] Throw only if startup properties exist --- api/src/org/labkey/api/util/SmtpTransportProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/org/labkey/api/util/SmtpTransportProvider.java b/api/src/org/labkey/api/util/SmtpTransportProvider.java index 0306d0528cc..fcc695aeb53 100644 --- a/api/src/org/labkey/api/util/SmtpTransportProvider.java +++ b/api/src/org/labkey/api/util/SmtpTransportProvider.java @@ -78,7 +78,10 @@ public void loadConfiguration() @Override public void handle(Collection entries) { - throw new RuntimeException("Configuring SMTP via startup properties is no longer supported. Use application.properties."); + if (!entries.isEmpty()) + { + throw new ConfigurationException("Configuring SMTP via startup properties is no longer supported. Use application.properties."); + } } }); From a2656531fd1bb66f91c9fc4cec855fad850c4f34 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Mon, 10 Aug 2026 11:38:31 -0700 Subject: [PATCH 3/5] Correct version --- api/src/org/labkey/api/util/SmtpTransportProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/org/labkey/api/util/SmtpTransportProvider.java b/api/src/org/labkey/api/util/SmtpTransportProvider.java index fcc695aeb53..e6ff77b3926 100644 --- a/api/src/org/labkey/api/util/SmtpTransportProvider.java +++ b/api/src/org/labkey/api/util/SmtpTransportProvider.java @@ -71,7 +71,7 @@ public void loadConfiguration() { try { - // TODO: Leave in place for now to provide clear error if startup properties are present. Remove in 25.11. + // TODO: Leave in place for now to provide clear error if startup properties are present. Remove in 26.11. ModuleLoader.getInstance().handleStartupProperties( new LenientStartupPropertyHandler<>("mail_smtp", new SmtpStartupProperty()) { From 93b3684d29a6718811e953f64f10ee49f2bd5afd Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Mon, 10 Aug 2026 12:18:41 -0700 Subject: [PATCH 4/5] Fail startup if SMTP startup properties are present --- .../api/util/SmtpTransportProvider.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/src/org/labkey/api/util/SmtpTransportProvider.java b/api/src/org/labkey/api/util/SmtpTransportProvider.java index e6ff77b3926..0230fca4d96 100644 --- a/api/src/org/labkey/api/util/SmtpTransportProvider.java +++ b/api/src/org/labkey/api/util/SmtpTransportProvider.java @@ -69,22 +69,22 @@ public String getName() @Override public void loadConfiguration() { - try - { - // TODO: Leave in place for now to provide clear error if startup properties are present. Remove in 26.11. - ModuleLoader.getInstance().handleStartupProperties( - new LenientStartupPropertyHandler<>("mail_smtp", new SmtpStartupProperty()) + // TODO: Startup failure if SMTP startup properties are present, for now. Remove in 26.11. + ModuleLoader.getInstance().handleStartupProperties( + new LenientStartupPropertyHandler<>("mail_smtp", new SmtpStartupProperty()) + { + @Override + public void handle(Collection entries) { - @Override - public void handle(Collection entries) + if (!entries.isEmpty()) { - if (!entries.isEmpty()) - { - throw new ConfigurationException("Configuring SMTP via startup properties is no longer supported. Use application.properties."); - } + throw new ConfigurationException("Configuring SMTP via startup properties is no longer supported. Use application.properties."); } - }); + } + }); + try + { // Load SMTP settings from ServletContext (populated from application.properties)) ServletContext context = ModuleLoader.getServletContext(); Enumeration names = Objects.requireNonNull(context).getInitParameterNames(); From f5f54631e61b78f4fa8c3935de53ffddd202ab0e Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Mon, 10 Aug 2026 13:34:23 -0700 Subject: [PATCH 5/5] typo --- api/src/org/labkey/api/util/SmtpTransportProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/org/labkey/api/util/SmtpTransportProvider.java b/api/src/org/labkey/api/util/SmtpTransportProvider.java index 0230fca4d96..654af1599d9 100644 --- a/api/src/org/labkey/api/util/SmtpTransportProvider.java +++ b/api/src/org/labkey/api/util/SmtpTransportProvider.java @@ -56,7 +56,7 @@ public String getPropertyName() @Override public String getDescription() { - return "No longer supported. Configure SMTP setting in application.properties."; + return "No longer supported. Configure SMTP settings in application.properties."; } } @@ -85,7 +85,7 @@ public void handle(Collection entries) try { - // Load SMTP settings from ServletContext (populated from application.properties)) + // Load SMTP settings from ServletContext (populated from application.properties) ServletContext context = ModuleLoader.getServletContext(); Enumeration names = Objects.requireNonNull(context).getInitParameterNames(); while (names.hasMoreElements())