[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15865962#comment-15865962 ] Sebb commented on NET-601: -- Good to know. Regarding the test code: as far as I know, you don't need to enclose mailbox names in quotes unless they contain a space. For example, this works: {code} AAAB SELECT M {code} However, it does seem to be necessary to quote-wrap names containing double-quotes. As you suggest in the previous comment, one way to simplify the code is to always quote the mailbox name. However, both the following are valid mailbox names: Unquoted "Quoted" So in general it's not possible to determine whether or not a string representing a mailbox name has already been quoted. The application must keep track of the quoted status separately. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > {code} > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > {code} > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15865656#comment-15865656 ] Johnny Haugen Sørgård commented on NET-601: --- Tried rewriting the selectFolder in my mail-object: // encode foldername without quotes String fName = BASE64MailboxEncoder.encode(StringFormatNO.removeQuotes(getFolderName())); // escape quotes and \\ fName = fName.replace("\"", "\\\"").replace("\\", ""); // add quotes fName = "\"" + fName + "\""; result = imapClient.select(fName); Works with the samples tested. i.e both with/without spaces and with/without æøå. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > {code} > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > {code} > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15865541#comment-15865541 ] Sebb commented on NET-601: -- I think I have found the reference: https://tools.ietf.org/html/rfc2683#section-3.4.2 In which case, Domino is correct. The problems do not arise with GMail and Yahoo because they use / as the folder separator. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > {code} > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > {code} > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15865507#comment-15865507 ] Sebb commented on NET-601: -- It looks as though Domino wants backslashes to be doubled if they are in a quoted string. {code} Presis\Done - works "Precis\Done" - fails "Presis\\Done" - works {code} (Of course in Java you have to double-up the backslashes in strings) This may be a bug in IBM Domino - it certainly seems odd to have to do this. However Thunderbird obviously does it; this could either be a specific workround for Domino, or maybe it really is a requirement of the IMAP standard. It would be useful to know which. In the meantime it is of course possible to work round the issue in user code. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > {code} > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > {code} > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15864208#comment-15864208 ] Johnny Haugen Sørgård commented on NET-601: --- Configured Thunderbird to maximum verbose level. (since it works). Looking at the log I found that in some cases the transferred foldername used \\ as folder - subfolder separator. In other cases Thunderbird transferred as folder - subfolder separator. So rewriting folder-select routine seems to work: if (!imapClient.select(fName)){ fName = fName.replace("\\", ""); imapClient.select(fName)); } > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15864064#comment-15864064 ] Johnny Haugen Sørgård commented on NET-601: --- Even at highest debug-verbose level there was no information at the server log when failing to select a folder. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15864032#comment-15864032 ] Johnny Haugen Sørgård commented on NET-601: --- Have create 2 subfolders: Presis\\asciiOnly Presis\\ascii subfolder with spaces Sorry, that I didn't test against other servers. Have tested against outlook.com. Seems to work without any flaws. The server with issues runs IBM Domino. I will configure server, add some more debug-information, and see if it will shed some light to the problem. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15863883#comment-15863883 ] Sebb commented on NET-601: -- I don't get the same problem when using IMAP with Yahoo. I've not tried non-ASCII, but spaces in sub-folders work fine. Likewise with GMail, though that is not true IMAP. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15863795#comment-15863795 ] Sebb commented on NET-601: -- I can reproduce the problems. There does not seem to be a sub-folder with a non-ascii name and with no space - would it be possible to set one up? > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15863687#comment-15863687 ] Sebb commented on NET-601: -- Thanks, I have managed to login now. I had to use Java 1.7 as well as add the cert (I added that locally, and defined javax.net.ssl.trustStore as I don't want to change the default Java store) > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: import_startssl_to_javahome.windows.zip, > testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15860945#comment-15860945 ] Johnny Haugen Sørgård commented on NET-601: --- Tested the code this morning. Connected ok. My guess is that this has to do with certificates installed in cacerts. This server uses startssl. On Ubuntu I run: sudo keytool -import -file /etc/ssl/certs/StartCom_Certification_Authority.pem -keystore $JAVA_HOME/jre/lib/security/cacerts If you run on windows I have attached a batch-file and the certificate. It expects JAVA_HOME to be defined. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15860384#comment-15860384 ] Sebb commented on NET-601: -- Sorry, only just got around to running the code. Could not connect to the demo. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > Attachments: testCommonsNetIMAPselect.java > > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15443518#comment-15443518 ] Johnny Haugen Sørgård commented on NET-601: --- Sebb - Here's test-code Comments: * the config is up and running, so it can be used for testing purposes. * problematic folders have been created. * In production BASE64MailboxEncoder and BASE64MailboxDecoder from javamail have been used to encode and decode foldernames. * The test routine: - logs on, - gets the list of folders - tries to select some folders using the encoder - finally tries to select all the folders as returned from LIST public static void test(){ // config String host = "munin02.prpr.no"; String user = "tte"; String password = "g6o623ds"; // login AuthenticatingIMAPClient imapClient = new AuthenticatingIMAPClient(/*getProtocol(), */true);// implicit // listener -> System.out final PrintCommandListener listener = new PrintCommandListener(System.out, true) { @Override public void protocolReplyReceived(ProtocolCommandEvent event) { if (event.getReplyCode() != IMAPReply.PARTIAL){ // This is dealt with by the chunk listener super.protocolReplyReceived(event); } } }; imapClient.addProtocolCommandListener(listener); try { imapClient.connect(host); // Try oauth = e.g. gmail ((AuthenticatingIMAPClient) imapClient).authenticate(AuthenticatingIMAPClient.AUTH_METHOD.PLAIN, user, password); } catch (IOException | InvalidKeyException | NoSuchAlgorithmException | InvalidKeySpecException e) { out("Error.connect: " + e.getMessage()); throw new RuntimeException("Could not connect to server. " + e.getMessage(), e); } // get Folders String[] folders = getFoldersAsArray(imapClient); // try selected folders testFolder(imapClient, "Backup log", true); // ok testFolder(imapClient, "Møter", true); // ok testFolder(imapClient, "Presis\\Bank2", true); // ok testFolder(imapClient, "Presis\\Bodø Industri", true); testFolder(imapClient, "Presis\\Done", true); // ok testFolder(imapClient, "Presis\\id filer", true); testFolder(imapClient, "Sendte elementer", true); // ok // try all folders for(String folder: folders){ testFolder(imapClient, folder, false); } } private static void testFolder(AuthenticatingIMAPClient imapClient, String folder, boolean convertFoldername){ // select folder try { String fName = convertFoldername ? BASE64MailboxEncoder.encode(folder) : folder.trim(); if (((!fName.equals(folder)) || (fName.contains(" "))) && (!fName.startsWith("\"")) ) { fName = "\"" + fName + "\""; } out("imapFoldername: " + folder + " -> " + fName); out(folder + ": " + String.valueOf(imapClient.select(fName))); } catch (NumberFormatException | IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } private static String[] getFoldersAsArray(AuthenticatingIMAPClient imapClient) { String[] result = null; try { imapClient.sendCommand("LIST \"\" \"*\""); String[] folders = imapClient.getReplyStrings(); List folderList = new ArrayList(); boolean acceptNext = false;; for (int i = 0; i < folders.length; i++) { out(folders[i]); String line = folders[i]; if (! acceptNext) { if (line.startsWith("* LIST")) { int delTo = line.indexOf("\"\""); // domino format int delCount = 5;
[jira] [Commented] (NET-601) IMAPClient.select cannot select mailbox in some cases with æøå, spaces and sub-folders
[ https://issues.apache.org/jira/browse/NET-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15439704#comment-15439704 ] Sebb commented on NET-601: -- Can you provide sample code which exhibits the problem? Encoding issues are tricky to test and fix because they depend on exactly how the program is coded. > IMAPClient.select cannot select mailbox in some cases with æøå, spaces and > sub-folders > -- > > Key: NET-601 > URL: https://issues.apache.org/jira/browse/NET-601 > Project: Commons Net > Issue Type: Bug > Components: IMAP >Affects Versions: 3.5 > Environment: eclipse on ubuntu workstation and ibm domino server on > ubuntu server. Connecting to IMAP on an IBM Domino server. >Reporter: Johnny Haugen Sørgård > > Partial response from LIST: > AAAB LIST "" "*" > * LIST (\HasNoChildren) "\\" "Backup log" > * LIST (\Noinferiors \HasNoChildren) "\\" Inbox > * LIST (\HasNoChildren) "\\" M > * LIST (\HasChildren) "\\" Presis > * LIST (\HasNoChildren) "\\" {24} > Presis\Bod Industri > * LIST (\HasNoChildren) "\\" {11} > Presis\Done > * LIST (\HasNoChildren) "\\" {15} > Presis\id filer > Trying to select Presis\Bodø Industri fails like this > AAAB SELECT "Presis\Bod Industri" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > And trying to select Presis\id filer fails like this > AAAB SELECT "Presis\id filer" > AAAB NO SELECT failure, cannot select mailbox: Folder not found in IMAP name > space > So far it seems like select fails when folder has more than one: > * none US-ASCII > * space > * sub-folder separator -- This message was sent by Atlassian JIRA (v6.3.4#6332)