cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asav...@apache.org
Subject svn commit: r452128 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java src/blocks/mail/samples/mail/docs/mid-col-2/mail-action.xml status.xml
Date Mon, 02 Oct 2006 17:16:32 GMT
Author: asavory
Date: Mon Oct  2 10:16:31 2006
New Revision: 452128

URL: http://svn.apache.org/viewvc?view=rev&rev=452128
Log:
Apply COCOON-1818 patch

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/mail/samples/mail/docs/mid-col-2/mail-action.xml
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java?view=diff&rev=452128&r1=452127&r2=452128
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
Mon Oct  2 10:16:31 2006
@@ -452,8 +452,10 @@
     /**
      *
      */
-    private void sendMail() {
+    private void sendMail() throws SAXException {
         try {
+        	this.ignoreHooksCount++;
+            super.sendStartElementEventNS(ELEMENT_RESULT);
             Properties props = new Properties();
             props.put("mail.smtp.host", this.mailHost);
             props.put("mail.smtp.port", String.valueOf(this.mailPort));
@@ -482,9 +484,6 @@
 
             this.smtpMessage = setUpMessage(session);
 
-	        this.ignoreHooksCount++;
-            super.sendStartElementEventNS(ELEMENT_RESULT);
-
             if (this.sendPartial) {
                 for (int i = 0; i < this.toAddresses.size(); i++) {
                     List v = new ArrayList(1);
@@ -496,12 +495,16 @@
             }
 
             trans.close();
-            super.sendEndElementEventNS(ELEMENT_RESULT);
-            this.ignoreHooksCount--;
+        } catch (SAXException e){
+        	throw e;
         } catch (Exception e) {
             getLogger().error("Exception sending mail", e);
             sendExceptionElement(e);
         }
+        finally {
+        	super.sendEndElementEventNS(ELEMENT_RESULT);
+            this.ignoreHooksCount--;
+        }
     }
 
     /**
@@ -512,13 +515,12 @@
                    throws Exception {
         AddressHandler[] iA = new AddressHandler[newAddresses.size()];
 
-        for (int i = 0; i < newAddresses.size(); i++) {
-            InternetAddress inA = new InternetAddress((String) newAddresses.get(i));
-            iA[i] = new AddressHandler(inA);
-        }
-
         try {
-            InternetAddress[] iaArr = SendMailTransformer.getAddresses(iA);
+        	for (int i = 0; i < newAddresses.size(); i++) {
+                InternetAddress inA = new InternetAddress((String) newAddresses.get(i));
+                iA[i] = new AddressHandler(inA);
+            }
+        	InternetAddress[] iaArr = SendMailTransformer.getAddresses(iA);
             this.smtpMessage.setRecipients(Message.RecipientType.TO, iaArr);
             trans.sendMessage(this.smtpMessage, iaArr);
         } catch (SendFailedException e) {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/mail/samples/mail/docs/mid-col-2/mail-action.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/mail/samples/mail/docs/mid-col-2/mail-action.xml?view=diff&rev=452128&r1=452127&r2=452128
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/mail/samples/mail/docs/mid-col-2/mail-action.xml
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/mail/samples/mail/docs/mid-col-2/mail-action.xml
Mon Oct  2 10:16:31 2006
@@ -104,7 +104,7 @@
   </map:action>
   
   <!-- access javamail objects -->
-  <map:generator type="serverpages" src="docs/{1}.xsp"/>
+  <map:generate type="serverpages" src="docs/{1}.xsp"/>
   <map:transform src="stylesheets/mail2html.xsl"/>
   <map:transform type="html"/>
 </map:match>

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&rev=452128&r1=452127&r2=452128
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Mon Oct  2 10:16:31 2006
@@ -184,6 +184,9 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
+    <action dev="AS" type="fix" fixes-bug="COCOON-1818" due-to="Jasha Joachimsthal">
+      Apply patch to handle malformed recipient address exception correctly.
+    </action>
     <action dev="VG" type="fix" fixes-bug="COCOON-1906" due-to="Lars Trieloff" due-to-email="lars@trieloff.net">
       CForms: Apply patch to disambiguate toSAX method call.
     </action>



Mime
View raw message