Mule
  1. Mule
  2. MULE-6279

URI encoded special characters cause some troubles at email transport

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Labels:
      None
    • 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>
    • Similar Issues:
      MULE-1238Documention change for specifying special characters in URIs
      MULE-6396Path url field http/https connector fails url encoding
      MULE-3236Default transformer doesn't URL-encode parameters and incorrectly URL-decodes endpoint query string
      MULE-6450SFTP transport does not URL encode attributes
      MULE-697Some transformers mangle unicode characters (e.g. XsltTransformer)
      MULE-4428default durableName should not use special charachters in the string
      MULE-890Replace uses of FileWriter/Reader with encoding-aware code
      MULE-4274file-to-string-transformer doesn't respect endpoint encoding
      MULE-1234Endpoint addresses are not appropriately encoded or quoted respectively
      MULE-1229Incorrect composition of filename in email transport

      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 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Pending 3rd-Party Pending 3rd-Party
        7d 14h 37m 1 Pablo Kraan 12/Jun/12 01:12 PM
        Pending 3rd-Party Pending 3rd-Party Open Open
        339d 2h 15m 1 Alejandro Sequeira 17/May/13 03:28 PM

          People

          • Assignee:
            Unassigned
            Reporter:
            Noriko Toyota
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development