Mule
  1. Mule
  2. MULE-6279

URI encoded special characters cause some troubles at email transport

    Details

    • User impact:
      Medium
    • Configuration:
      Hide

      <pop3:inbound-endpoint name="myPOP" address="pop3://bob:foo%2Bfoo@host" />
      <pop3:inbound-endpoint name="myPOP" address="pop3://bob:%25foo@host" />
      <pop3:inbound-endpoint name="myPOP" address="pop3://bob:foo%23%5Bbar@host" />
      <pop3:inbound-endpoint user="bob" password="%25foo" host="host" />

      Show
      <pop3:inbound-endpoint name="myPOP" address="pop3://bob:foo%2Bfoo@host" /> <pop3:inbound-endpoint name="myPOP" address="pop3://bob:%25foo@host" /> <pop3:inbound-endpoint name="myPOP" address="pop3://bob:foo%23%5Bbar@host" /> <pop3:inbound-endpoint user="bob" password="%25foo" host="host" />
    • Log Output:
      Hide

      ********************************************************************************
      Message : Failed to start inbound endpoint "myPOP"
      Type : org.mule.api.lifecycle.LifecycleException
      Code : MULE_ERROR-70312
      JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/LifecycleException.html
      ********************************************************************************
      Exception stack is:
      1. URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "fo" (java.lang.IllegalArgumentException)
        java.net.URLDecoder:-1 (null)
      2. Failed to start inbound endpoint "myPOP" (org.mule.api.lifecycle.LifecycleException)
        org.mule.endpoint.DefaultInboundEndpoint:118 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/LifecycleException.html)
      ********************************************************************************
      Root Exception stack trace:
      java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "fo"
      at java.net.URLDecoder.decode(Unknown Source)
      at org.mule.transport.email.AbstractMailConnector.urlFromEndpoint(AbstractMailConnector.java:122)
      at org.mule.transport.email.AbstractMailConnector.newSession(AbstractMailConnector.java:185)
      at org.mule.transport.email.AbstractMailConnector.getSessionDetails(AbstractMailConnector.java:94)
      at org.mule.transport.email.RetrieveMessageReceiver.doConnect(RetrieveMessageReceiver.java:79)
      at org.mule.transport.AbstractTransportMessageHandler.connect(AbstractTransportMessageHandler.java:218)
      at org.mule.transport.AbstractConnector.registerListener(AbstractConnector.java:1248)
      at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:104)
      <snip>


      ********************************************************************************
      Message : The endpoint "pop3://bob:foo#[bar@pop:110" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic
      Type : org.mule.api.endpoint.MalformedEndpointException
      Code : MULE_ERROR-64051
      JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/endpoint/MalformedEndpointException.html
      ********************************************************************************
      Exception stack is:
      1. The endpoint "pop3://bob:foo#[bar@pop:110" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic (org.mule.api.endpoint.MalformedEndpointException)
        org.mule.endpoint.AbstractEndpointBuilder:183 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/endpoint/MalformedEndpointException.html)
      ********************************************************************************
      Root Exception stack trace:
      org.mule.api.endpoint.MalformedEndpointException: The endpoint "pop3://bob:foo#[bar@pop:110" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic
      at org.mule.endpoint.AbstractEndpointBuilder.doBuildInboundEndpoint(AbstractEndpointBuilder.java:183)
      at org.mule.endpoint.AbstractEndpointBuilder.buildInboundEndpoint(AbstractEndpointBuilder.java:117)
      at org.mule.endpoint.DefaultEndpointFactory.getInboundEndpoint(DefaultEndpointFactory.java:83)
      <snip>
      Show
      ******************************************************************************** Message : Failed to start inbound endpoint "myPOP" Type : org.mule.api.lifecycle.LifecycleException Code : MULE_ERROR-70312 JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/LifecycleException.html ******************************************************************************** Exception stack is: 1. URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "fo" (java.lang.IllegalArgumentException)   java.net.URLDecoder:-1 (null) 2. Failed to start inbound endpoint "myPOP" (org.mule.api.lifecycle.LifecycleException)   org.mule.endpoint.DefaultInboundEndpoint:118 ( http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/LifecycleException.html ) ******************************************************************************** Root Exception stack trace: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "fo" at java.net.URLDecoder.decode(Unknown Source) at org.mule.transport.email.AbstractMailConnector.urlFromEndpoint(AbstractMailConnector.java:122) at org.mule.transport.email.AbstractMailConnector.newSession(AbstractMailConnector.java:185) at org.mule.transport.email.AbstractMailConnector.getSessionDetails(AbstractMailConnector.java:94) at org.mule.transport.email.RetrieveMessageReceiver.doConnect(RetrieveMessageReceiver.java:79) at org.mule.transport.AbstractTransportMessageHandler.connect(AbstractTransportMessageHandler.java:218) at org.mule.transport.AbstractConnector.registerListener(AbstractConnector.java:1248) at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:104) <snip> ******************************************************************************** Message : The endpoint " pop3://bob:foo# [ bar@pop :110" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic Type : org.mule.api.endpoint.MalformedEndpointException Code : MULE_ERROR-64051 JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/endpoint/MalformedEndpointException.html ******************************************************************************** Exception stack is: 1. The endpoint " pop3://bob:foo# [ bar@pop :110" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic (org.mule.api.endpoint.MalformedEndpointException)   org.mule.endpoint.AbstractEndpointBuilder:183 ( http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/endpoint/MalformedEndpointException.html ) ******************************************************************************** Root Exception stack trace: org.mule.api.endpoint.MalformedEndpointException: The endpoint " pop3://bob:foo# [ bar@pop :110" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic at org.mule.endpoint.AbstractEndpointBuilder.doBuildInboundEndpoint(AbstractEndpointBuilder.java:183) at org.mule.endpoint.AbstractEndpointBuilder.buildInboundEndpoint(AbstractEndpointBuilder.java:117) at org.mule.endpoint.DefaultEndpointFactory.getInboundEndpoint(DefaultEndpointFactory.java:83) <snip>
    • Migration Impact:
      See MULE-8927
    • Similar Issues:
      None

      Description

      Some encoded special characters('+', '%', '#[' are misunderstood during building email endpoint.

      On email transport, it pass the user and password strings from EndpointURL to javax.net.URLName after decode twice.
      On endpoint builder, it use the strings after URL decode for checking the expression syntax.

        Activity

        Noriko Toyota created issue -
        Hide
        Pablo Kraan added a comment -

        Hi Noriko,

        Did you try adding escape characters to that special characters?

        Show
        Pablo Kraan added a comment - Hi Noriko, Did you try adding escape characters to that special characters?
        Pablo Kraan made changes -
        Field Original Value New Value
        Status Open [ 1 ] Pending 3rd-Party [ 10000 ]
        Hide
        Noriko Toyota added a comment -

        Hi Pablo,

        I tried and the result is java.net.URISyntaxException.
        I used "%foo" and "%25foo" for the value of password attribute.

        java.net.URISyntaxException: Illegal character in authority at index 7: pop3://toyota:%25foo@host
        at java.net.URI$Parser.fail(Unknown Source)
        at java.net.URI$Parser.parseAuthority(Unknown Source)
        at java.net.URI$Parser.parseHierarchical(Unknown Source)
        at java.net.URI$Parser.parse(Unknown Source)
        at java.net.URI.<init>(Unknown Source)
        at org.mule.endpoint.MuleEndpointURI.<init>(MuleEndpointURI.java:153)
        (snip)

        Show
        Noriko Toyota added a comment - Hi Pablo, I tried and the result is java.net.URISyntaxException. I used "%foo" and "%25foo" for the value of password attribute. java.net.URISyntaxException: Illegal character in authority at index 7: pop3://toyota:%25foo@host at java.net.URI$Parser.fail(Unknown Source) at java.net.URI$Parser.parseAuthority(Unknown Source) at java.net.URI$Parser.parseHierarchical(Unknown Source) at java.net.URI$Parser.parse(Unknown Source) at java.net.URI.<init>(Unknown Source) at org.mule.endpoint.MuleEndpointURI.<init>(MuleEndpointURI.java:153) (snip)
        Ramiro Rinaudo made changes -
        Priority To be reviewed [ 6 ] Major [ 3 ]
        Alejandro Sequeira made changes -
        Status Pending 3rd-Party [ 10000 ] Open [ 1 ]
        Ramiro Rinaudo made changes -
        Workflow Fixed Main Mule Workflow (after JIRA upgrade) [ 90638 ] Main Mule Workflow v1.0 [ 141224 ]
        Hide
        Rodrigo Merino added a comment -

        Fixed as per MULE-8927

        Show
        Rodrigo Merino added a comment - Fixed as per MULE-8927
        Rodrigo Merino made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Migration Impact See MULE-8927
        Assignee Rodrigo Merino [ rodrigo.merino ]
        Fix Version/s 3.8.0-development [ 16064 ]
        Resolution Fixed [ 1 ]
        Rodrigo Merino made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Rodrigo Merino made changes -
        Fix Version/s 3.8.0 M1 [ 15930 ]
        Fix Version/s 3.8.0-development [ 16064 ]
        Rodrigo Merino made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Alejandro Sequeira made changes -
        Fix Version/s 3.8.0 [ 16353 ]
        Fix Version/s 3.8.0 M1 [ 15930 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        To Do To Do Pending 3rd-Party Pending 3rd-Party
        7d 14h 37m 1 Pablo Kraan 12/Jun/12 01:12 PM
        Pending 3rd-Party Pending 3rd-Party To Do To Do
        339d 2h 15m 1 Alejandro Sequeira 17/May/13 03:28 PM
        To Do To Do Closed Closed
        844d 21h 2m 1 Rodrigo Merino 09/Sep/15 12:31 PM
        Closed Closed Reopened Reopened
        5d 2h 55m 1 Rodrigo Merino 14/Sep/15 03:26 PM
        Reopened Reopened Closed Closed
        29s 1 Rodrigo Merino 14/Sep/15 03:27 PM

          People

          • Assignee:
            Rodrigo Merino
            Reporter:
            Noriko Toyota
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development