Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 64178 invoked from network); 13 May 2010 17:09:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 May 2010 17:09:09 -0000 Received: (qmail 18966 invoked by uid 500); 13 May 2010 17:09:09 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 18862 invoked by uid 500); 13 May 2010 17:09:09 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 18746 invoked by uid 99); 13 May 2010 17:09:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 May 2010 17:09:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 May 2010 17:09:06 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4DH8j6I000174 for ; Thu, 13 May 2010 17:08:45 GMT Message-ID: <32747884.20961273770525078.JavaMail.jira@thor> Date: Thu, 13 May 2010 13:08:45 -0400 (EDT) From: "Siegfried Goeschl (JIRA)" To: issues@commons.apache.org Subject: [jira] Issue Comment Edited: (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. In-Reply-To: <1639401853.1257642034722.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/EMAIL-91?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12867180#action_12867180 ] Siegfried Goeschl edited comment on EMAIL-91 at 5/13/10 1:07 PM: ----------------------------------------------------------------- Corrected patch (issue-91a_patch.txt) was (Author: sgoeschl): Corrected patch > Incorrect SMTP Port number shown in error message when an email fails to send due to a blocked port and SSL is used. > -------------------------------------------------------------------------------------------------------------------- > > Key: EMAIL-91 > URL: https://issues.apache.org/jira/browse/EMAIL-91 > Project: Commons Email > Issue Type: Bug > Affects Versions: 1.0, 1.1, 1.2 > Environment: Windows XP, JRE 1.6.0_16, JavaMail 1.4.1, Commons Email 1.2 [latest from svn], jaf 1.1.1 > Reporter: Kevin Lester > Assignee: Siegfried Goeschl > Priority: Minor > Attachments: issue-91_patch.txt, issue-91a_patch.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > An incorrect error message is being returned from the email class when a message fails to send due to a blocked port and SSL is specified. Specificaly, the port number in the error message is incorrect; it will show the stmp port that is set on the object (normally 25), when it should be showing the port that was set in the session when the session was created [465 when SSL is used]. > This issue is only visible to the user if the email fails to send because the SSL port is blocked. > The following code reproduces the issue: > public void testErrorMessage(){ > HtmlEmail email = new HtmlEmail(); > try { > email.addTo("abc@d.com"); > email.setSubject("Testing Apache Error message "); > email.setFrom("abc@d.com"); > email.setMsg("Sending through gmail"); > email.setSSL(true); > email.setHostName("anyhost.com"); > email.send(); > } catch (EmailException e) { > e.printStackTrace(); > } > } > If port 465 is blocked, then you wil ge the following stacktrace: > org.apache.commons.mail.EmailException: Sending the email to the following server failed : anyhost.com:25 > at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1138) > at org.apache.commons.mail.Email.send(Email.java:1163) > at EmailTester.testErrorMessage(EmailTester.java:27) > at EmailTester.main(EmailTester.java:14) > Caused by: javax.mail.MessagingException: Could not connect to SMTP host: anyhost.com, port: 465; > nested exception is: > java.net.ConnectException: Connection refused: connect > at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391) > at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412) > at javax.mail.Service.connect(Service.java:288) > ... > Note that the port is listed correctly in the inner exception, but it is incorrect in the topmost exception. > I have fixed this issue in my sandbox, and will attach the patch to this issue. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.