You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by am...@apache.org on 2009/11/18 13:25:28 UTC
svn commit: r881747 - in
/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail:
MailTransportListener.java MailTransportSender.java
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);
Re: svn commit: r881747 - in /webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail:
MailTransportListener.java MailTransportSender.java
Posted by Amila Suriarachchi <am...@gmail.com>.
On Thu, Nov 19, 2009 at 7:20 AM, Ruwan Linton <ru...@gmail.com>wrote:
> Amila, has this change been committed to the branch as well?
>
commit to branch as well.
thanks,
Amila.
>
> Thanks,
> Ruwan
>
> On Wed, Nov 18, 2009 at 5:55 PM, <am...@apache.org> 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 <http://wso2.org/esb%0AWSO2> Inc.; http://wso2.org
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com
>
--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/
Re: svn commit: r881747 - in /webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail:
MailTransportListener.java MailTransportSender.java
Posted by Ruwan Linton <ru...@gmail.com>.
Amila, has this change been committed to the branch as well?
Thanks,
Ruwan
On Wed, Nov 18, 2009 at 5:55 PM, <am...@apache.org> 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: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com