Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
folderlist Sample Program with JavaMail 1.5.4
What is the folderlist.java in javamail-samples.zip? I downloaded it together with javax.mail-1.5.4.jar.
✍: FYIcenter.com
folderlist.java in javamail-samples.zip is a sample program that lists information about the folders in an email account on a mail server.
If you downloaded and installed javamail-samples.zip together with javax.mail-1.5.4.jar, folderlist.java is located at \local\javamail-1.5.4\javamail-samples\folderlist.java. Below is the usage description of folderlist.java:
Description:
This program lists information about the folders in a Store.
Usage:
java folderlist -L <url> -T <protocol> -H <host> -U <user>
-P <passwd> [-R <root>] [-r] [-v] [-D] <pattern>
Options:
-L <url> : URL of the Store. The URL should include
the password as well (if needed).
Example: "imap://john:password@mailstore.com"
-T <protocol> : store protocol (Ex: "imap")
-H <host> : hostname of store.
-U <user> : username (if needed)
-P <passwd> : password (if needed)
-R <root> : root of the folder hierarchy. This is optional. If
not present, listing starts from the default folder.
-r : list recursively - folder and all subfolders.
-v : verbose - show more info about each folder.
-D : Turn on session debugging
<pattern> : folders that match this pattern are listed. Use "*"
as wildcard to match everything.
Here is an execution session of folderlist.java:
fyicenter>cd \local\javamail-1.5.4\javamail-samples
local\javamail-1.5.4\javamail-samples>java -version
java version "1.8.0_45"
local\javamail-1.5.4\javamail-samples>javac -cp .;..\javax.mail-1.5.4.jar
folderlist.java
local\javamail-1.5.4\javamail-samples>java -cp .;..\javax.mail-1.5.4.jar
folderlist -D -L imap://john:password@mailstore.com
DEBUG: setDebug: JavaMail version 1.5.4
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.
IMAPStore,Oracle]
DEBUG IMAP: mail.imap.fetchsize: 16384
DEBUG IMAP: mail.imap.ignorebodystructuresize: false
DEBUG IMAP: mail.imap.statuscachetimeout: 1000
DEBUG IMAP: mail.imap.appendbuffersize: -1
DEBUG IMAP: mail.imap.minidletime: 10
DEBUG IMAP: closeFoldersOnStoreFailure
DEBUG IMAP: trying to connect to host "mailstore.com", port 143, isSSL false
Exception in thread "main" com.sun.mail.util.MailConnectException: Couldn't conn
ect to host, port: mailstore.com, 143; timeout -1;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:731)
at javax.mail.Service.connect(Service.java:364)
at javax.mail.Service.connect(Service.java:245)
at javax.mail.Service.connect(Service.java:194)
at folderlist.main(folderlist.java:107)
...
The output shows that:
⇒ Run folderlist.java 1.5.4 with Gmail SSL IMAP
⇐ Download and Install javamail-samples.zip
2016-01-11, ∼3218🔥, 0💬
Popular Posts:
Where Can I get source code files of jsse.jar? You can get source code files of jsse.jar (JSSE) from...
JDK 11 jdk.rmic.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) Compiler Tool tool, ...
Where to find answers to frequently asked questions on Downloading and Installing ojdbc.jar - JDBC D...
Jetty provides an HTTP server, HTTP client, and javax.servlet container. These components are open s...
JDK 17 jdk.xml.dom.jmod is the JMOD file for JDK 17 XML DOM module. JDK 17 XML DOM module compiled c...