How do I find out if an IMAP server supports a particular capability?

John Zukowski

If you have a folder open, you can do this:

import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.protocol.IMAPProtocol;

       IMAPProtocol p = ((IMAPFolder)folder).getProtocol();
       if (p.hasCapability("FOO"))
See the com.sun.mail.imap package javadocs for additional details and important disclaimers.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.