Wednesday, August 3, 2016



In this Post I will explain How we can receive Emails through WSO2 ESB Mailto transport and perform some operations on it.

1. First lets Enable the transport. Open "repository/conf/axis2/axis2.xml" and uncomment the following section.


<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener">
        <!-- configure any optional POP3/IMAP properties
        check com.sun.mail.pop3 and com.sun.mail.imap package documentation for more details-->
    </transportReceiver>


2. Now lets create a proxy service to consumes the Emails. You can Copy and paste the following proxy service to source view to create the proxy. Make sure you change access parameters accordingly.



<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="JasperEmailPOP3"
       transports="mailto"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="senderAddress"
                   expression="get-property('transport', 'From')"
                   scope="default"
                   type="STRING"/>
         <log level="custom">
            <property name="Date" expression="$trp:Date"/>
            <property name="Subject" expression="$trp:Subject"/>
            <property name="Content-Type" expression="$trp:Content-Type"/>
            <property name="From" expression="$trp:From"/>
         </log>
         <drop/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
   <parameter name="transport.PollInterval">5</parameter>
   <parameter name="mail.pop3.host">pop.gmail.com</parameter>
   <parameter name="mail.pop3.user">ycwso2test</parameter>
   <parameter name="transport.mail.Protocol">pop3</parameter>
   <parameter name="mail.pop3.socketFactory.port">995</parameter>
   <parameter name="transport.mail.Address">ycwso2test@gmail.com</parameter>
   <parameter name="mail.pop3.password">wso2qa123</parameter>
   <parameter name="mail.pop3.port">995</parameter>
   <parameter name="mail.pop3.socketFactory.fallback">false</parameter>
   <description/>
</proxy>


3. Now Send a Email to your Email account and you will see the following log in backlogs.


[2016-08-03 12:10:05,232]  INFO - LogMediator Date = Wed, 3 Aug 2016 12:09:25 +0530, Subject = This is a Test, Content-Type = multipart/alternative; boundary=001a11402208fef0bb0539251978, From = Yasassri Ratnayake <ycrnet@gmail.com>


So thats it. If you cannot get this to work you can enable Debug logs and check whats wrong. To do this add the following line to repository/conf/log4j.properties and restart the ESB server.

log4j.logger.org.apache.axis2.transport.mail.MailTransportListener=DEBUG



Categories: ,

48 comments:

  1. Tipper trucks have the capacity to carry the heaviest of loads while traversing through harsh terrains and tough conditions. Listed below are the most reliable vehicle brands in the 25 tonnes gross vehicle weight category. T.C. Tippers

    ReplyDelete
  2. Thailand is known as 'The Land of Smiles' for good reason - the Thai people are among the friendliest & most helpful you will ever encounter on your travels. As such, travelling in Thailand is not only easy but a lot of fun too. There are, however, some aspects of travelling in Thailand that you should consider in order to make your holiday not only memorable, but a safe and happy experience too. this page

    ReplyDelete
  3. Thailand is known as 'The Land of Smiles' for good reason - the Thai people are among the friendliest & most helpful you will ever encounter on your travels. As such, travelling in Thailand is not only easy but a lot of fun too. There are, however, some aspects of travelling in Thailand that you should consider in order to make your holiday not only memorable, but a safe and happy experience too. caribbean airlines

    ReplyDelete
  4. Travelling for people with disabilities is still a challenge. Below is a guide to help them with all forms of disabilities to travel safely and enjoyable 부산달리기

    ReplyDelete
  5. Travelling for people with disabilities is still a challenge. Below is a guide to help them with all forms of disabilities to travel safely and enjoyable 광주 아이러브밤

    ReplyDelete
  6. While some bed and breakfasts offer unique amenities not easily found elsewhere, like on-site spas, a saltwater pool, or a movie theater room,often times a bed and breakfast does not have the space for standard hotel amenities like a fitness center. montreal travel restrictions

    ReplyDelete
  7. Necessary to send you that little or no remark just to many thanks yet again of these spectacular techniques you might have provided in this article. It’s so particularly generous with normal folks just like you to provide unreservedly what many of us may have marketed just as one guide to earn some dough on their own, primarily considering that you might have completed it in case you wanted. The tactics also acted to become fantastic way to understand that most people have similar desire equally as my to know significantly more concerning this condition. I’m there are many easier opportunities beforehand those of you that read through your site post.

    ReplyDelete
  8. What a lovely blog. I’ll certainly be back. Please preserve writing! 사설토토

    ReplyDelete
  9. I have been reading out some of your articles and i must say nice stuff. I will definitely bookmark your blog. 토토

    ReplyDelete
  10. I have read several good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a wonderful informative web site. so de theo 12 con giap

    ReplyDelete
  11. This really is such a wonderful resource that youre offering and you give it away for free. I take pleasure in seeing sites that realize the worth of delivering a prime resource for no cost. I really loved reading your post. Thanks! 토토사이트

    ReplyDelete
  12. very good post, i definitely really like this site, keep on it 먹튀검증커뮤니티

    ReplyDelete
  13. Appreciate it to get a incredibly apparent and very helpful publish. I’m positively a violator of many of these rules. I generally uncover personally conflicted when producing a blog posting because I see myself personally creating more than people prefer to read, but I feel that I have got to do the subject matter proper rights by completely protecting it. I think that by pursuing some of these policies I finish up cutting out critical factors to the dialogue. I guess you could have to acquire a stability. obniv

    ReplyDelete
  14. I’d ought to seek advice from you here. Which isn’t some thing I usually do! I spend time reading an article which will make people believe. Also, thank you permitting me to comment! situs judi slot online

    ReplyDelete
  15. Hi! I’ve been reading your web site for a while now and finally got the bravery to go ahead and give you a shout out from Kingwood Texas! Just wanted to mention keep up the great job! 무료 스포츠 중계

    ReplyDelete
  16. Thanks for this post. I definitely agree with what you are saying. I have been talking about this subject a lot lately with my brother so hopefully this will get him to see my point of view. Fingers crossed! Joker99

    ReplyDelete
  17. Over and over again I like to think about this problems. As a matter of fact it wasn’t even a month ago that I thought about this very thing. To be honest, what is the answer though? godji-doujin

    ReplyDelete
  18. Have you ever thought about publishing an e-book or guest authoring on other blogs? I have a blog based on the same ideas you discuss and would really like to have you share some stories/information. I know my visitors would enjoy your work. If you are even remotely interested, feel free to send me an e mail. daftar rekomendasi situs slot online terpercaya

    ReplyDelete
  19. I dont usually post on many Blogs, still I simply must give you thanks keep up the astonishing work. Ok unfortunately its time to access school. travel agency

    ReplyDelete
  20. I want to convey my passion for your generosity giving support to men and women that must have help with the concern. Your real dedication to passing the solution up and down had become rather invaluable and have frequently permitted folks much like me to achieve their targets. Your personal valuable guidelines means a great deal to me and far more to my peers. With thanks; from everyone of us. 메이저놀이터

    ReplyDelete
  21. Who designed your website. I think you did a good job. click

    ReplyDelete
  22. I am glad to be one of several visitants on this outstanding internet site (:, appreciate it for posting . visit

    ReplyDelete
  23. You ought to be a part of a contest for just one of the finest blogs on the web. I am going to suggest this site! 안전놀이터

    ReplyDelete
  24. Hello, very helpful posting. My sister and I have recently been looking to find detailed facts on this subject type of stuff for a while, yet we could hardly until now. Do you think you can also make a few youtube video clips about this, I do think your webblog would be far more complete in case you did. In any other case, oh well. I am going to be checking out on this web-site within the not too distant future. E-mail me to maintain me up-to-date. granite countertops cleveland 안전놀이터

    ReplyDelete
  25. I love reading through and I think this website got some truly utilitarian stuff on it! . check out this link

    ReplyDelete
  26. You could certainly see your enthusiasm in the paintings you write. The world hopes for even more passionate writers such as you who aren’t afraid to mention how they believe. Always go after your heart. Best mattress 2022

    ReplyDelete
  27. I am curious to find out what blog platform you have been utilizing? I’m having some minor security issues with my latest site and I would like to find something more safe. Do you have any recommendations? slot game online indonesia

    ReplyDelete
  28. A round of applause for your post.Thanks Again. Really Cool. Serverqiu

    ReplyDelete
  29. A round of applause for your blog article.Really thank you! Want more. slot demo indonesia

    ReplyDelete
  30. Thanks a lot for the article.Thanks Again. Want more. blog Comments Backlinks

    ReplyDelete
  31. I really liked your blog post.Really looking forward to read more. Great. ข่าวกีฬา

    ReplyDelete
  32. Great, thanks for sharing this article post.Really looking forward to read more. Fantastic. เว็บข่าวกีฬา

    ReplyDelete

Subscribe to RSS Feed Follow me on Twitter!