commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgoes...@apache.org
Subject svn commit: r943938 - in /commons/proper/email/trunk/src: changes/changes.xml java/org/apache/commons/mail/Email.java
Date Thu, 13 May 2010 17:08:19 GMT
Author: sgoeschl
Date: Thu May 13 17:08:19 2010
New Revision: 943938

URL: http://svn.apache.org/viewvc?rev=943938&view=rev
Log:
[EMAIL-91] Incorrect SMTP Port number shown in error message when an email fails to send due
to a blocked port and SSL is used. Applied issue-91a_patch.txt.

Modified:
    commons/proper/email/trunk/src/changes/changes.xml
    commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java

Modified: commons/proper/email/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/changes/changes.xml?rev=943938&r1=943937&r2=943938&view=diff
==============================================================================
--- commons/proper/email/trunk/src/changes/changes.xml (original)
+++ commons/proper/email/trunk/src/changes/changes.xml Thu May 13 17:08:19 2010
@@ -22,6 +22,12 @@
   </properties>
 
   <body>
+    <release version="1.3-SNAPSHOT" date="as in SVN">
+      <action dev="sgoeschl" type="add" issue="EMAIL-91" date="2010-05-13" due-to="Kevin
Lester">
+        Incorrect SMTP Port number shown in error message when an email fails
+        to send due to a blocked port and SSL is used.
+      </action>        
+    </release>
     <release version="1.2" date="2009-10-26">
       <action dev="sgoeschl" type="update" date="2009-06-26">
         Changing groupId from "commons-email" to "org.apache.commons" 

Modified: commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java?rev=943938&r1=943937&r2=943938&view=diff
==============================================================================
--- commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java (original)
+++ commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java Thu May 13 17:08:19
2010
@@ -1325,13 +1325,13 @@ public abstract class Email
      */
     public String getHostName()
     {
-        if (EmailUtils.isNotEmpty(this.hostName))
+        if (this.session != null && EmailUtils.isNotEmpty(this.session.getProperty(MAIL_HOST)))
         {
-            return this.hostName;
-        }
-        else if (this.session != null)
+            return this.session.getProperty(MAIL_HOST);   
+        } 
+        else if (EmailUtils.isNotEmpty(this.hostName))
         {
-            return this.session.getProperty(MAIL_HOST);
+            return this.hostName;
         }
         return null;
     }
@@ -1343,13 +1343,13 @@ public abstract class Email
      */
     public String getSmtpPort()
     {
-        if (EmailUtils.isNotEmpty(this.smtpPort))
-        {
-            return this.smtpPort;
-        }
-        else if (this.session != null)
+        if (this.session != null && EmailUtils.isNotEmpty(this.session.getProperty(MAIL_PORT)))
         {
             return this.session.getProperty(MAIL_PORT);
+        } 
+        else if (EmailUtils.isNotEmpty(this.smtpPort))
+        {
+            return this.smtpPort;
         }
         return null;
     }
@@ -1427,13 +1427,13 @@ public abstract class Email
      */
     public String getSslSmtpPort()
     {
-        if (EmailUtils.isNotEmpty(this.sslSmtpPort))
+        if (this.session != null && EmailUtils.isNotEmpty(this.session.getProperty(MAIL_SMTP_SOCKET_FACTORY_PORT)))
         {
-            return this.sslSmtpPort;
+            return this.session.getProperty(MAIL_SMTP_SOCKET_FACTORY_PORT);
         }
-        else if (this.session != null)
+        if (EmailUtils.isNotEmpty(this.sslSmtpPort))
         {
-            return this.session.getProperty(MAIL_SMTP_SOCKET_FACTORY_PORT);
+            return this.sslSmtpPort;
         }
         return null;
     }



Mime
View raw message