Martin Peřina has uploaded a new change for review. Change subject: tools: Removes option MAIL_PORT_SSL ......................................................................
tools: Removes option MAIL_PORT_SSL Removes option MAIL_PORT_SSL. IMO this option is redundant since currently MAIL_PORT or MAIL_PORT_SSL are used based on SSL turned on/off. So it's easier to specify port number only in one option (MAIL_PORT). Change-Id: I76cd77d7f7227e0ae81467189c06c8841ff7f775 Signed-off-by: Martin Perina <[email protected]> --- M backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java M backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java M backend/manager/tools/src/test/resources/conf/notifier-mail-test-plain.conf M backend/manager/tools/src/test/resources/conf/notifier-mail-test-secured.conf M packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in 5 files changed, 4 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/95/22295/1 diff --git a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java index 9a57df7..91d6360 100644 --- a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java +++ b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java @@ -17,7 +17,6 @@ */ public static final String MAIL_SERVER = "MAIL_SERVER"; public static final String MAIL_PORT = "MAIL_PORT"; - public static final String MAIL_PORT_SSL = "MAIL_PORT_SSL"; public static final String MAIL_USER = "MAIL_USER"; public static final String MAIL_PASSWORD = "MAIL_PASSWORD"; public static final String MAIL_ENABLE_SSL = "MAIL_ENABLE_SSL"; diff --git a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java index fd705a7..7139134 100644 --- a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java +++ b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java @@ -38,15 +38,13 @@ Properties mailSessionProps = setCommonProperties(aMailProps); mailSessionProps.put("mail.smtp.host", aMailProps.getProperty(NotificationProperties.MAIL_SERVER)); + mailSessionProps.put("mail.smtp.port", aMailProps.getProperty(NotificationProperties.MAIL_PORT)); // enable SSL if (aMailProps.getBoolean(NotificationProperties.MAIL_ENABLE_SSL, false)) { - mailSessionProps.put("mail.smtp.port", aMailProps.getProperty(NotificationProperties.MAIL_PORT_SSL)); mailSessionProps.put("mail.smtp.auth", "true"); mailSessionProps.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); mailSessionProps.put("mail.smtp.socketFactory.fallback", false); - mailSessionProps.put("mail.smtp.socketFactory.port", aMailProps.getProperty(NotificationProperties.MAIL_PORT_SSL)); - } else { - mailSessionProps.put("mail.smtp.port", aMailProps.getProperty(NotificationProperties.MAIL_PORT)); + mailSessionProps.put("mail.smtp.socketFactory.port", aMailProps.getProperty(NotificationProperties.MAIL_PORT)); } String password = aMailProps.getProperty(NotificationProperties.MAIL_PASSWORD, true); diff --git a/backend/manager/tools/src/test/resources/conf/notifier-mail-test-plain.conf b/backend/manager/tools/src/test/resources/conf/notifier-mail-test-plain.conf index 29605ac..91ae87c 100644 --- a/backend/manager/tools/src/test/resources/conf/notifier-mail-test-plain.conf +++ b/backend/manager/tools/src/test/resources/conf/notifier-mail-test-plain.conf @@ -13,6 +13,5 @@ MAIL_SERVER=smtp.redhat.com MAIL_PORT=25 -MAIL_PORT_SSL=465 [email protected] HTML_MESSAGE_FORMAT=true diff --git a/backend/manager/tools/src/test/resources/conf/notifier-mail-test-secured.conf b/backend/manager/tools/src/test/resources/conf/notifier-mail-test-secured.conf index d57face..1e0d854 100644 --- a/backend/manager/tools/src/test/resources/conf/notifier-mail-test-secured.conf +++ b/backend/manager/tools/src/test/resources/conf/notifier-mail-test-secured.conf @@ -12,8 +12,7 @@ engineLib=/usr/local/jboss-eap-5.1/jboss-as/server/default/deploy/engine.ear/lib MAIL_SERVER=smtp.gmail.com -MAIL_PORT=25 -MAIL_PORT_SSL=465 +MAIL_PORT=465 [email protected] MAIL_PASSWORD="q1!w2@e3#!" [email protected] diff --git a/packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in b/packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in index e35ec8c..21ba7ad 100644 --- a/packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in +++ b/packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in @@ -46,9 +46,8 @@ # The SMTP mail server address. Required. MAIL_SERVER= -# The SMTP port +# The SMTP port (usually 25 for plain SMTP, 465 for SMTP with SSL) MAIL_PORT=25 -MAIL_PORT_SSL=465 # Required if SSL enabled to authenticate the user. Used also to specify 'from' user address if mail server # supports, when MAIL_FROM is not set. Address is in RFC822 format -- To view, visit http://gerrit.ovirt.org/22295 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76cd77d7f7227e0ae81467189c06c8841ff7f775 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Peřina <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
