Layer7 API Management

 View Only
  • 1.  Mail gateway

    Posted Oct 12, 2015 11:42 AM


    Hi

     

    I'm trying to setup one gateway between one mail account and one web service.

    The problem is that I have to access the mail headers to make some king of routing decision.

    With ${request.mainpart} I only have access to the body.

    Is there a way to access mail headers like the Subject: ?

    Thanks in advance

     

    Best regards

    NM



  • 2.  Re: Mail gateway

    Broadcom Employee
    Posted Oct 12, 2015 08:01 PM

    Hi,

    It's not clear how the email properties are packaged into the request.

    If all the email properties, including subject, from, to, etc., are packaged into the request body in xml or json format, you can get them with xpath or json path assertion.

    If you have some email properties in the request header, you can access them with context variable ${request.http.headerValues.<name>}

     

    Regards,

    Mark



  • 3.  Re: Mail gateway

    Posted Oct 13, 2015 11:42 AM

    How have you created the policy? The normal way to have the Gateway receive email messages would be to set up an email listener that checks a particular mail server and account for messages. The Gateway is not designed to be its own mail server so it would be dependent upon the mail client sending messages to a mail server which the Gateway receives. If you must absolutely have the Gateway receive messages from a mail client directly then perhaps you can get the required functionality using a Raw TCP-enabled port.



  • 4.  Re: Mail gateway

    Posted Oct 13, 2015 11:59 AM


    Hi

     

    yes. I have email listener connecting to a particular email account.And the gateway retrieves the mail with success.

    But it can only "see" the main body of the mail. It can't see the subject or the From address.

     

    I've tested sending the mail with an attach and I can think that the gateway can access the attach but I don't know how to "parse" it.

    ${request.parts.1.contentType} = application/octet-stream
    ${request.parts.1.size} = 35
    -
    ${request.parts.2.contentType} = message/rfc822
    ${request.parts.2.size} = 770

     

    Best regards

    NM



  • 5.  Re: Mail gateway

    Posted Oct 14, 2015 10:10 AM

    Can you share some context on what you are trying to accomplish? That might help shed some light on a solution that will meet your needs.



  • 6.  Re: Mail gateway

    Posted Oct 14, 2015 11:01 AM

    I'm trying to setup a gateway between mail and one external web service. The info that I need to send to the web service is in the mail that I retrieve from one mail account. I need to construct the POST with the body of that mail, the subject and the is From address. From my tests, since I could only see the main body of the mail.

     

    I tried another way where the "original" mail is attached in another mail. I was trying to see if in this way , the main body of this new mail would show the mime block of the "original" mail that I need to parse. But it didn't worked and I don't like this workaround.

    Thanks



  • 7.  Re: Mail gateway

    Posted Oct 19, 2015 01:35 PM

    Sorry for the delay. I'm checking in with some folks from engineering on this. I had a look at the application code for this component and I am not overwhelmingly positive that mail headers are ever made available for consumption in a policy. I'm still waiting for final feedback but I do not believe the product can do what you are asking it to do at this time.



  • 8.  Re: Mail gateway

    Posted Apr 27, 2016 04:22 AM

    Hi,

     

    did anybody succeed or it's not possible to check email parameters or sections?

     

    Best regards,

    Andrés-J. Cremades