[jira] [Commented] (GERONIMO-6565) Store.getDefaultFolder().list("*") sends wrong command

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Commented] (GERONIMO-6565) Store.getDefaultFolder().list("*") sends wrong command

JIRA jira@apache.org

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

Matthew Broadhead commented on GERONIMO-6565:

Another response from the Dovecot team
"A non-empty reference name argument is the name of a mailbox or a level of mailbox hierarchy, and indicates the context in which the mailbox name is interpreted."

If Dovecot is using "." as the separator in the base level of hierarchy, then it correctly is returning nothing for 'LIST / "*"' - since no mailboxes in Dovecot live under that base level of hierarchy.

Gmail returns data because it is using "/" as a separator.

If you want Dovecot to return LIST entries for 'LIST "/" "*"', then configure the base namespace to use "/" as a separator.  Of course then 'LIST "." "*"' would return nothing...

Should there be a "separator" setting that tells JavaMail which one is being used?

> Store.getDefaultFolder().list("*") sends wrong command
> ------------------------------------------------------
>                 Key: GERONIMO-6565
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6565
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues)
>         Environment: TomEE 7.0.2
>            Reporter: Matthew Broadhead
>         Attachments: filterFolders.diff
> using TomEE 7.0.2 with package geronimo-javamail_1.4_mail-1.9.0-alpha-2.jar.  i try to list folders in a store
> {code:java}
> import javax.mail.Folder;
> import javax.mail.Session;
> import javax.mail.Store;
> ...
> Properties properties = System.getProperties();
> properties.setProperty("mail.debug", "true");
> Session session = Session.getDefaultInstance(properties, null);
> session.setDebug(true);
> Store store = session.getStore("imaps");
> store.connect("imap.domain.tld", "username", password);
> Folder[] folders = store.getDefaultFolder().list("*");
> {code}
> Debugging shows that it sends the following command which results in a blank list
> {code}
> a90 LIST / "*"
> a90 OK List completed.
> {code}
> Whereas testing with the tutorial on https://delog.wordpress.com/2011/05/10/access-imap-server-from-the-command-line-using-openssl/ the command works correctly as
> {code}
> LIST "" "*"
> {code}
> Is there a setting somewhere to tell it to omit the slash at the beginning?  i.e. define the root namespace

This message was sent by Atlassian JIRA