You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2017/02/14 17:28:41 UTC

[jira] [Commented] (NET-614) IMAP fails to quote/encode mailbox names

    [ https://issues.apache.org/jira/browse/NET-614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866184#comment-15866184 ] 

Sebb commented on NET-614:
--------------------------

Also note that double-quotes and backslash need to be escaped in quoted strings. [2]

Care must be taken when fixing this to avoid breaking applications that don't expect NET to adjust the parameter, and which therefore do the quoting/encoding themselves.

The simplest might be to provide a separate method for processing the mailbox name which applications need to call before passing the name to a method that takes a mailbox name parameter.

However this would be awkard to use, so the code can perhaps be updated to do the processing automatically, at least common cases.

If the input string is not enclosed in quotes, then clearly it has not been quoted, and so it is safe to do so if neccesary.
Likewise if the input contains non-ASCII characters it cannot have been encoded.

However in general it's not possible to determine if a string has been encoded and/or quoted.
This is because the process of quoting and encoding generates a string which passes the tests for a valid mailbox name.

[2] https://tools.ietf.org/html/rfc2683#section-3.4.2

> IMAP fails to quote/encode mailbox names
> ----------------------------------------
>
>                 Key: NET-614
>                 URL: https://issues.apache.org/jira/browse/NET-614
>             Project: Commons Net
>          Issue Type: Bug
>          Components: IMAP
>    Affects Versions: 3.6
>            Reporter: Sebb
>
> Mailbox names need to be quoted if they contain spaces or double-quote.
> If they contain non-ASCII characters then they also need to be encoded [1]
> There may be other parameters that are not being encoded/quoted correctly.
> [1] https://tools.ietf.org/html/rfc3501#section-5.1.3



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)