@Test void createFinalJavaxPropertiesShouldProvidePropertiesWithMinimalConfiguration() { String helo = "domain.com"; FakeMailetConfig mailetConfig = FakeMailetConfig.builder() .setProperty(RemoteDeliveryConfiguration.HELO_NAME, helo) .build(); Properties properties = new RemoteDeliveryConfiguration(mailetConfig, mock(DomainList.class)).createFinalJavaxProperties(); assertThat(properties) .containsOnly(MapEntry.entry("mail.smtp.ssl.enable", "false"), MapEntry.entry("mail.smtp.sendpartial", "false"), MapEntry.entry("mail.smtp.ehlo", "true"), MapEntry.entry("mail.smtp.connectiontimeout", "60000"), MapEntry.entry("mail.smtp.localhost", helo), MapEntry.entry("mail.smtp.timeout", "180000"), MapEntry.entry("mail.debug", "false"), MapEntry.entry("mail.smtp.starttls.enable", "false")); }
public Properties createFinalJavaxProperties() { Properties props = new Properties(); props.put("mail.debug", "false"); props.put("mail.smtp.ehlo", "true"); props.put("mail.smtp.timeout", String.valueOf(smtpTimeout)); props.put("mail.smtp.connectiontimeout", String.valueOf(connectionTimeout)); props.put("mail.smtp.sendpartial", String.valueOf(sendPartial)); props.put("mail.smtp.localhost", heloNameProvider.getHeloName()); props.put("mail.smtp.starttls.enable", String.valueOf(startTLS)); props.put("mail.smtp.ssl.enable", String.valueOf(isSSLEnable)); if (isBindUsed()) { props.put("mail.smtp.socketFactory.class", RemoteDeliverySocketFactory.class); props.put("mail.smtp.socketFactory.fallback", "false"); } if (authUser != null) { props.put("mail.smtp.auth", "true"); } props.putAll(javaxAdditionalProperties); return props; }
RemoteDeliveryConfiguration { public Properties createFinalJavaxProperties() { Properties props = new Properties(); props.put("mail.debug", "false"); props.put("mail.smtp.ehlo", "true"); props.put("mail.smtp.timeout", String.valueOf(smtpTimeout)); props.put("mail.smtp.connectiontimeout", String.valueOf(connectionTimeout)); props.put("mail.smtp.sendpartial", String.valueOf(sendPartial)); props.put("mail.smtp.localhost", heloNameProvider.getHeloName()); props.put("mail.smtp.starttls.enable", String.valueOf(startTLS)); props.put("mail.smtp.ssl.enable", String.valueOf(isSSLEnable)); if (isBindUsed()) { props.put("mail.smtp.socketFactory.class", RemoteDeliverySocketFactory.class); props.put("mail.smtp.socketFactory.fallback", "false"); } if (authUser != null) { props.put("mail.smtp.auth", "true"); } props.putAll(javaxAdditionalProperties); return props; } }
RemoteDeliveryConfiguration { public Properties createFinalJavaxProperties() { Properties props = new Properties(); props.put("mail.debug", "false"); props.put("mail.smtp.ehlo", "true"); props.put("mail.smtp.timeout", String.valueOf(smtpTimeout)); props.put("mail.smtp.connectiontimeout", String.valueOf(connectionTimeout)); props.put("mail.smtp.sendpartial", String.valueOf(sendPartial)); props.put("mail.smtp.localhost", heloNameProvider.getHeloName()); props.put("mail.smtp.starttls.enable", String.valueOf(startTLS)); props.put("mail.smtp.ssl.enable", String.valueOf(isSSLEnable)); if (isBindUsed()) { props.put("mail.smtp.socketFactory.class", RemoteDeliverySocketFactory.class); props.put("mail.smtp.socketFactory.fallback", "false"); } if (authUser != null) { props.put("mail.smtp.auth", "true"); } props.putAll(javaxAdditionalProperties); return props; } RemoteDeliveryConfiguration(MailetConfig mailetConfig, DomainList domainList); }
RemoteDeliveryConfiguration { public Properties createFinalJavaxProperties() { Properties props = new Properties(); props.put("mail.debug", "false"); props.put("mail.smtp.ehlo", "true"); props.put("mail.smtp.timeout", String.valueOf(smtpTimeout)); props.put("mail.smtp.connectiontimeout", String.valueOf(connectionTimeout)); props.put("mail.smtp.sendpartial", String.valueOf(sendPartial)); props.put("mail.smtp.localhost", heloNameProvider.getHeloName()); props.put("mail.smtp.starttls.enable", String.valueOf(startTLS)); props.put("mail.smtp.ssl.enable", String.valueOf(isSSLEnable)); if (isBindUsed()) { props.put("mail.smtp.socketFactory.class", RemoteDeliverySocketFactory.class); props.put("mail.smtp.socketFactory.fallback", "false"); } if (authUser != null) { props.put("mail.smtp.auth", "true"); } props.putAll(javaxAdditionalProperties); return props; } RemoteDeliveryConfiguration(MailetConfig mailetConfig, DomainList domainList); Properties createFinalJavaxProperties(); boolean isDebug(); List<Duration> getDelayTimes(); int getMaxRetries(); long getSmtpTimeout(); boolean isSendPartial(); int getConnectionTimeout(); Collection<String> getGatewayServer(); String getAuthUser(); String getAuthPass(); boolean isBindUsed(); String getBounceProcessor(); boolean isUsePriority(); boolean isStartTLS(); boolean isSSLEnable(); HeloNameProvider getHeloNameProvider(); MailQueueName getOutGoingQueueName(); Properties getJavaxAdditionalProperties(); int getDnsProblemRetry(); String getBindAddress(); }
RemoteDeliveryConfiguration { public Properties createFinalJavaxProperties() { Properties props = new Properties(); props.put("mail.debug", "false"); props.put("mail.smtp.ehlo", "true"); props.put("mail.smtp.timeout", String.valueOf(smtpTimeout)); props.put("mail.smtp.connectiontimeout", String.valueOf(connectionTimeout)); props.put("mail.smtp.sendpartial", String.valueOf(sendPartial)); props.put("mail.smtp.localhost", heloNameProvider.getHeloName()); props.put("mail.smtp.starttls.enable", String.valueOf(startTLS)); props.put("mail.smtp.ssl.enable", String.valueOf(isSSLEnable)); if (isBindUsed()) { props.put("mail.smtp.socketFactory.class", RemoteDeliverySocketFactory.class); props.put("mail.smtp.socketFactory.fallback", "false"); } if (authUser != null) { props.put("mail.smtp.auth", "true"); } props.putAll(javaxAdditionalProperties); return props; } RemoteDeliveryConfiguration(MailetConfig mailetConfig, DomainList domainList); Properties createFinalJavaxProperties(); boolean isDebug(); List<Duration> getDelayTimes(); int getMaxRetries(); long getSmtpTimeout(); boolean isSendPartial(); int getConnectionTimeout(); Collection<String> getGatewayServer(); String getAuthUser(); String getAuthPass(); boolean isBindUsed(); String getBounceProcessor(); boolean isUsePriority(); boolean isStartTLS(); boolean isSSLEnable(); HeloNameProvider getHeloNameProvider(); MailQueueName getOutGoingQueueName(); Properties getJavaxAdditionalProperties(); int getDnsProblemRetry(); String getBindAddress(); static final String USE_PRIORITY; static final String MAX_DNS_PROBLEM_RETRIES; static final String HELO_NAME; static final String JAVAX_PREFIX; static final String BIND; static final String GATEWAY_PASSWORD; static final String GATEWAY_USERNAME_COMPATIBILITY; static final String GATEWAY_USERNAME; static final String GATEWAY_PORT; static final String GATEWAY; static final String SSL_ENABLE; static final String START_TLS; static final String BOUNCE_PROCESSOR; static final String SENDPARTIAL; static final String TIMEOUT; static final String CONNECTIONTIMEOUT; static final String OUTGOING; static final String MAX_RETRIES; static final String DELAY_TIME; static final String DEBUG; static final int DEFAULT_SMTP_TIMEOUT; static final MailQueueName DEFAULT_OUTGOING_QUEUE_NAME; static final int DEFAULT_CONNECTION_TIMEOUT; static final int DEFAULT_DNS_RETRY_PROBLEM; static final int DEFAULT_MAX_RETRY; static final String ADDRESS_PORT_SEPARATOR; }