Class IMAPImportMbox

java.lang.Object
org.apache.commons.net.examples.mail.IMAPImportMbox

public final class IMAPImportMbox extends Object
This is an example program demonstrating how to use the IMAP[S]Client class. This program connects to a IMAP[S] server and imports messages into the folder from an mbox file.

Usage: IMAPImportMbox imap[s]://user:password@host[:port]/folder/path [selectors]

An example selector might be:

  • 1,2,3,7-10
  • -142986- : this is useful for retrieving messages by apmail number, which appears as From xyz-return-142986-apmail-...

For example:
IMAPImportMbox imaps://user:pass@imap.googlemail.com/imported_messages 201401.mbox 1-10,20 -142986-