You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extra Jakarta Mail properties use reversed configuration precedence #685
Simple Java Mail documents configuration precedence as:
system property > environment variable > property file
ConfigLoader.readProperties() applies that order to ordinary properties. However, simplejavamail.extraproperties.* values are inserted into their result map in this order:
system properties -> environment variables -> supplied properties
Because later putAll() calls overwrite earlier entries, a supplied property-file value currently beats both runtime sources. This contradicts the documented contract and the ordering used for wildcard connection-pool cluster properties.
The extra Session-property namespace was introduced in #279; no collision test or documented exception indicates that the reversed precedence was intentional.
Expected behavior
Extra Jakarta Mail properties should follow the same precedence as the rest of ConfigLoader:
system property > environment variable > property file
Scope
apply extra properties in file -> environment -> system order;
add regression coverage for colliding values from all supported sources;
document that wildcard extra properties follow the normal precedence rules;
add a v9.2.0 migration/release note because applications relying on the accidental reverse order may observe a different value.
This is intentionally scheduled for the next minor release because it changes observable configuration behavior.
Fixed for v9.2.0. simplejavamail.extraproperties.* now follows the normal configuration order: system properties override environment variables, which override property-file values. Configurations that define an extra Jakarta Mail key in only one source are unchanged; when a key is duplicated, the deployment-time source now wins as documented. The 9.2 migration and release notes call out that compatibility detail.
Activity
bbottema commentedon Aug 6, 2026
Fixed for v9.2.0.
simplejavamail.extraproperties.*now follows the normal configuration order: system properties override environment variables, which override property-file values. Configurations that define an extra Jakarta Mail key in only one source are unchanged; when a key is duplicated, the deployment-time source now wins as documented. The 9.2 migration and release notes call out that compatibility detail.bbottema commentedon Aug 8, 2026
This issue's change is now available in Simple Java Mail 9.2.0 and from Maven Central.