From 43535a878df75dbece146f850e0d6b624144aa07 Mon Sep 17 00:00:00 2001 From: Shlomi Date: Tue, 26 Nov 2024 18:29:15 +0200 Subject: [PATCH] fix handling of `greenmail.sieve.ignore.detail` --- .../PropertiesBasedGreenMailConfigurationBuilder.java | 2 +- .../PropertiesBasedGreenMailConfigurationBuilderTest.java | 2 +- .../greenmail/standalone/GreenMailStandaloneRunnerTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilder.java b/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilder.java index 22b91b1e0a..d2d99c93db 100644 --- a/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilder.java +++ b/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilder.java @@ -80,7 +80,7 @@ public GreenMailConfiguration build(Properties properties) { } String sieveIgnoreDetail = properties.getProperty(GREENMAIL_SIEVE_IGNORE_DETAIL, "false"); - if (null != sieveIgnoreDetail) { + if (Boolean.TRUE.toString().equalsIgnoreCase(sieveIgnoreDetail)) { configuration.withSieveIgnoreDetail(); } diff --git a/greenmail-core/src/test/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilderTest.java b/greenmail-core/src/test/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilderTest.java index 889545fc00..bddf10a7d3 100644 --- a/greenmail-core/src/test/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilderTest.java +++ b/greenmail-core/src/test/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilderTest.java @@ -60,7 +60,7 @@ public void testBuildWithSieveIgnoreDetailEnabledSetting() { GreenMailConfiguration config = new PropertiesBasedGreenMailConfigurationBuilder().build(props); assertThat(config).isNotNull(); - assertThat(config.isSieveIgnoreDetailEnabled()).isTrue(); + assertThat(config.isSieveIgnoreDetailEnabled()).isFalse(); } @Test diff --git a/greenmail-standalone/src/test/java/com/icegreen/greenmail/standalone/GreenMailStandaloneRunnerTest.java b/greenmail-standalone/src/test/java/com/icegreen/greenmail/standalone/GreenMailStandaloneRunnerTest.java index c0c5dd4e72..4f0d49d0ac 100644 --- a/greenmail-standalone/src/test/java/com/icegreen/greenmail/standalone/GreenMailStandaloneRunnerTest.java +++ b/greenmail-standalone/src/test/java/com/icegreen/greenmail/standalone/GreenMailStandaloneRunnerTest.java @@ -81,7 +81,7 @@ public void testApi() { "{\"port\":3143,\"address\":\"127.0.0.1\",\"protocol\":\"imap\",\"isSecure\":false,\"readTimeout\":-1," + "\"writeTimeout\":-1,\"connectionTimeout\":-1,\"serverStartupTimeout\":2000,\"isDynamicPort\":false}]," + "\"authenticationDisabled\":false," + - "\"sieveIgnoreDetail\":true," + + "\"sieveIgnoreDetail\":false," + "\"preloadDirectory\":null" + "}");