You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2008/01/09 08:49:08 UTC

svn commit: r610293 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail: Constants.java SimpleMailListener.java

Author: saminda
Date: Tue Jan  8 23:49:07 2008
New Revision: 610293

URL: http://svn.apache.org/viewvc?rev=610293&view=rev
Log:
If ReplyTo header is not available, the return path is obtained from "From". But "Return-path" header is the one that 
trase the return path. Thus, if "From" is not available, mail senders will fall back to "Return-path" header to 
comple the MEP. 

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java?rev=610293&r1=610292&r2=610293&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java Tue Jan  8 23:49:07 2008
@@ -82,6 +82,7 @@
     public static final String X_SERVICE_PATH = "X-Service-Path";
     public static final String MAIL_SYNC = "_MAIL_SYNC_";
     public static final String IN_REPLY_TO = "In-Reply-To";
+    public static final String RETURN_PATH = "Return-path";  
     public static final String MAILTO = "mailto";
     public static final String MAPPING_TABLE = "mappingTable";
     public static final String CALLBACK_TABLE = "callbackTable";

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java?rev=610293&r1=610292&r2=610293&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java Tue Jan  8 23:49:07 2008
@@ -343,6 +343,15 @@
                         org.apache.axis2.transport.mail.Constants.MAILTO + ":" +
                         msg.getFrom()[0].toString());
                 transportInfo.setFrom(fromEPR);
+            } else {
+                String returnPath =
+                        getMailHeader(msg, org.apache.axis2.transport.mail.Constants.RETURN_PATH);
+                returnPath = parseHeaderForLessThan(returnPath);
+                if (returnPath != null) {
+                    EndpointReference fromEPR = new EndpointReference(
+                            org.apache.axis2.transport.mail.Constants.MAILTO + ":" + returnPath);
+                    transportInfo.setFrom(fromEPR);
+                }
             }
 
             // Save Message-Id to set as In-Reply-To on reply
@@ -488,6 +497,15 @@
         } catch (MessagingException e) {
             throw new AxisFault(e.getMessage(),e);
         }
+    }
+
+    private String parseHeaderForLessThan(String value) {
+        if (value != null) {
+            if (value.length() > 1 && value.startsWith("<") && value.endsWith(">")) {
+                value = value.substring(1, value.length()-1);
+            }
+        }
+        return value;
     }
 
     private String parseHeaderForQuotes(String value) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org