gmail - Java: IMAP with Apache Commons Net - select root folder -


i using apache commons net , goal list of existing gmail folders. i'm trying following code:

imapclient imap = new imapsclient(); imap.setdefaultport(port); imap.addprotocolcommandlistener(new printcommandlistener(system.out, true)); imap.connect(server); imap.login(username, password); imap.list("", "*") 

but gives me:

i/system.out: * ok gimap ready requests 5.18.55.93 fi8mb55620436ldc i/system.out: aaaa login ******* i/system.out: * capability imap4rev1 unselect idle namespace quota id xlist children x-gm-ext-1 uidplus compress=deflate enable move condstore esearch utf8=accept list-extended list-status literal- appendlimit=35651584 i/system.out: aaaa ok rextuz@gmail.com authenticated (success) i/system.out: aaab list  * i/system.out: aaab bad not parse command 

i need server provide me list of folders because custom or localized ones might exist.

you can use

list()

method send list command gmail imap server. add appropriate

addprotocolcommandlistener

to list command response. should list folders logged in account.

imap command:

a11 list "" "*"


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -