Amila, has this change been committed to the branch as well? Thanks, Ruwan
On Wed, Nov 18, 2009 at 5:55 PM, <[email protected]> wrote: > Author: amilas > Date: Wed Nov 18 12:25:28 2009 > New Revision: 881747 > > URL: http://svn.apache.org/viewvc?rev=881747&view=rev > Log: > ignoring the case when processing the smtp headers > > Modified: > > > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java > > > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java > > Modified: > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java > URL: > http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java?rev=881747&r1=881746&r2=881747&view=diff > > ============================================================================== > --- > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java > (original) > +++ > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java > Wed Nov 18 12:25:28 2009 > @@ -561,7 +561,17 @@ > } > > private Map getTransportHeaders(Message message, PollTableEntry entry) > { > - Map trpHeaders = new HashMap(); > + > + //use a comaprator to ignore the case for headers. > + Comparator comparator = new Comparator(){ > + public int compare(Object o1, Object o2) { > + String string1 = (String) o1; > + String string2 = (String) o2; > + return string1.compareToIgnoreCase(string2); > + } > + }; > + > + Map trpHeaders = new TreeMap(comparator); > try { > Enumeration e = message.getAllHeaders(); > while (e.hasMoreElements()) { > > Modified: > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java > URL: > http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java?rev=881747&r1=881746&r2=881747&view=diff > > ============================================================================== > --- > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java > (original) > +++ > webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java > Wed Nov 18 12:25:28 2009 > @@ -195,7 +195,7 @@ > > (msgContext.getProperty(org.apache.axis2.Constants.PIGGYBACK_MESSAGE) == > null)) { > return; > } > - > + > ConfigurationContext configContext = > msgContext.getConfigurationContext(); > // if the mail message listner has not started we need to start it > if > (!configContext.getListenerManager().isListenerRunning(MailConstants.TRANSPORT_NAME)) > { > @@ -249,7 +249,14 @@ > messageFormatter.getClass().getSimpleName()); > } > > - WSMimeMessage message = new WSMimeMessage(session, > outInfo.getFromAddress().getAddress()); > + WSMimeMessage message = null; > + if (outInfo.getFromAddress() != null) { > + message = new WSMimeMessage(session, > outInfo.getFromAddress().getAddress()); > + } else { > + message = new WSMimeMessage(session, ""); > + } > + > + > Map trpHeaders = (Map) > msgContext.getProperty(MessageContext.TRANSPORT_HEADERS); > if (log.isDebugEnabled() && trpHeaders != null) { > log.debug("Using transport headers: " + trpHeaders); > > > -- Ruwan Linton Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb WSO2 Inc.; http://wso2.org email: [email protected]; cell: +94 77 341 3097 blog: http://ruwansblog.blogspot.com
