You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/10/27 16:16:15 UTC

svn commit: r708217 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java

Author: bodewig
Date: Mon Oct 27 08:16:14 2008
New Revision: 708217

URL: http://svn.apache.org/viewvc?rev=708217&view=rev
Log:
Make <mail> work for SSL + authentication with javamail 1.4.1.  PR 46063.  Submitted by Craig Richardson

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=708217&r1=708216&r2=708217&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Oct 27 08:16:14 2008
@@ -274,6 +274,10 @@
    work as TaskContainers at the same time.
    Bugzilla Report 41647.
 
+ * combining SSL and authentication in <mail> and MailLogger failed in
+   some setups.
+   Bugzilla Report 46063.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java?rev=708217&r1=708216&r2=708217&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java Mon Oct 27 08:16:14 2008
@@ -247,7 +247,10 @@
             }
             msg.setContent(attachments);
             try {
-                Transport.send(msg);
+                // Send the message using SMTP, or SMTPS if the host uses SSL
+                Transport transport = sesh.getTransport(SSL ? "smtps" : "smtp");
+                transport.connect(host, user, password);
+                transport.sendMessage(msg, msg.getAllRecipients());
             } catch (SendFailedException sfe) {
                 if (!shouldIgnoreInvalidRecipients()) {
                     throw new BuildException(GENERIC_ERROR, sfe);



Re: svn commit: r708217 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 27 Oct 2008, <bo...@apache.org> wrote:

> URL: http://svn.apache.org/viewvc?rev=708217&view=rev Log:
> Make <mail> work for SSL + authentication with javamail 1.4.1.

I'm not completely comfortable with this change since I couldn't
test all combinations I would have needed to feel OK.

The patch changes the protocol from "smtp" to "smtps" if the SSL
flag has been set on the <mail> task, aparently it doesn't work with
JavaMail 1.4.1 any other way.

If anybody around here uses the <mail> task or a MailLogger with
SSL, please do me a favour and check that it still works with the
current trunk.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org