Service Virtualization

Expand all | Collapse all

Virtualize Mailbox from outlook.com or office365

  • 1.  Virtualize Mailbox from outlook.com or office365

    Posted 07-05-2018 08:05 AM

    Hello All

             I need to virtualize my email inbox from outlook.com. We have a feature in our product that opens a designated mailbox and read mails to create tickets in the ticketing system.

     

    As I understand, there is no direct protocol support (and I could be wrong) for IMAP protocol. I tried to achieve the desired result using ODP. I could do a basic use case recording of opening the mailbox, get the count of emails and read the mails. I deployed the virtual service and have my program point to virtual service instead of outlook.com.

     

     I am facing the following error when my program tries to connect to virtual service, open the mailbox and read the emails. Any ideas/suggestions/hints will help.

     

    javax.mail.MessagingException: Error parsing extensions: extra data;
    nested exception is:
    javax.net.ssl.SSLProtocolException: Error parsing extensions: extra data
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:735)
    at javax.mail.Service.connect(Service.java:366)
    at javax.mail.Service.connect(Service.java:246)
    at javax.mail.Service.connect(Service.java:195)
    at com.ca.experiments.MailReader.login(MailReader.java:54)
    at com.ca.experiments.MailReaderService.main(MailReaderService.java:49)
    Caused by: javax.net.ssl.SSLProtocolException: Error parsing extensions: extra data
    at java.base/sun.security.ssl.HelloExtensions.<init>(HelloExtensions.java:105)
    at java.base/sun.security.ssl.HandshakeMessage$ServerHello.<init>(HandshakeMessage.java:536)
    at java.base/sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:246)
    at java.base/sun.security.ssl.Handshaker.processLoop(Handshaker.java:1098)
    at java.base/sun.security.ssl.Handshaker.processRecord(Handshaker.java:1026)
    at java.base/sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1137)
    at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1074)
    at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
    at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1402)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1429)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:598)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:372)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
    at com.sun.mail.iap.Protocol.<init>(Protocol.java:123)
    at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:126)
    at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPStore.java:756)
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:691)
    ... 5 more



  • 2.  Re: Virtualize Mailbox from outlook.com or office365

    Posted 07-05-2018 10:10 AM

    What version of DevTest are you trying this? 



  • 3.  Re: Virtualize Mailbox from outlook.com or office365

    Posted 07-05-2018 11:20 AM

    Hello Abraham

                    Its 10.3

     

    -Sankar



  • 4.  Re: Virtualize Mailbox from outlook.com or office365

    Posted 07-05-2018 10:28 AM

    Correct, there is no direct support for virtualizing IMAP protocol.

    Which DevTest protocol you are using when the client calls this virtual service?  Is com.ca.experiments.MailReader.login(MailReader.java:54) a CA product package/class? I do not recognize this class, but, it seems as though something extraneous is being passed. It also seems that the service is not really virtualizing Email, rather it is connecting to an Email box and sending answers from that box. Did I miss something?   



  • 5.  Re: Virtualize Mailbox from outlook.com or office365

    Posted 07-05-2018 11:23 AM

    HI Joel

               I am trying to use ODP transport protocol. 

     You are right about the class. The core logic of our product code has been extracted into a small java program that connects to imap-mail.outlook.com over IMAPS protocol. 

     

    The product functionality is such that it opens a mailbox and reads the mails and acts upon them by creating tickets. The read mails are deleted upon creation/updation of a ticket.

     

    -Sankar



  • 6.  Re: Virtualize Mailbox from outlook.com or office365

    Posted 07-05-2018 12:35 PM

    This seems to be too difficult to solve in this forum because we do not have implementation details.

    It is not clear to me how ODP solves the virtualization of this User Story. 

    The exception appears to indicate that there is extraneous data in the connection... 

        at com.ca.experiments.MailReader.login(MailReader.java:54)
        at com.ca.experiments.MailReaderService.main(MailReaderService.java:49)
        Caused by: javax.net.ssl.SSLProtocolException: Error parsing extensions: extra data

    Assuming the classes in the com.ca.experiments package are invoking the virtual service, there would seem to be something about the handshaking mechanism used in SSL and IMAP that the virtual service is not handling correctly. This is only a guess since we do not have any implementation details.

     

    As a different approach, is it possible to use Java virtualization and virtualize the various methods in the com.ca.experiments package (e.g., MailReader login and other methods)? This might get you away from the specifics of the IMAP protocol and payloads and let you trap higher in the application stack.

     

    Perhaps, another colleague has some ideas.