JavaMail Library
Name | ⬇️ libJavaMail |
---|---|
Version | 4.9.1 (pas) |
Description | This library offers advanced features such as imap/imaps/smtps support, ssl/starttls encryption or selective access by folder, date and time, subject etc., and aims at providing the means to interact with all modern email servers through a common API. |
The JavaMail Library offers advanced features such as imap/imaps/smtps support, ssl/starttls encryption or selective access by folder, date and time, subject etc., and aims at providing the means to interact with all modern email servers through a common API with the convenience of a pre-packaged, ready to use xUML library.
The API is available through one library class that defines all operations, whose parameters refer to the underlying Java implementation. After importing the library, there is no need to import any further components, java classes etc. - you can start using it in your project right away.
Features
Protocols
IMAP, IMAPS, POP3, POP3S, STMP, SMTPS
With username/password authentication.EWS (MS Exchange)
With username/password (BasicAuth) or OAuth login (for Outlook 365 only)The EWS Java SDK has meanwhile been deprecated, and been succeeded by Microsoft's Java SDK for the Graph API. This library will likely be migrated to use the Graph API in the future, depending on demand. For the time being, the EWS API is used.
Security
SSL and STARTTLS for IMAP/POP3/SMTP, HTTPS for EWS
For host verification the corresponding certificate must either be known by the underlying JVM or provided within the keystore on the connection (see Keys and Certificates)
Signed Mail
S/MIME (RFC 3852) and PGP (RFC 4880, RFC 3156)
Only for receiving email, sending signed emails is not yet supported. Receiving PGP "compressed" signed messages is also not yet supported (PGP signature verification requires the public keys of the signer(s), see Keys and Certificates).
Encrypted Mail
OpenPGP only
OpenPGP encrypted messages are supported (encryption and decryption). S/MIME encrypted messages will be read, but not decrypted. You will receive the envelope without content and the status will indicate success=false.
Filtered Reading
receive date, subject, sender, attachment name, and unread status
Attachments
append file attachments on sending, and receiving attachments
Image attachments can be sent as inline images using CIDs in the HTML message.
Supported Operations
All operations can be accessed through the MailClient class. All operations require a connection object. Details on it and its attributes are explained on Mail Server Connection.
The library supports
Receiving and Processing Emails from IMAP, POP3, and MS Exchange Servers. Processing messages typically means either deleting messages or moving them to specific folders
Sending Messages via SMTP and MS Exchange
For verification of PGP signatures and SSL certificates provided by mail services, the library needs access to the relevant certs and public keys. More about this on Keys and Certificates
Operations may throw exceptions. In cases where the underlying Java code throws exceptions that are anticipated, these are translated into Exception Signatures. For unexpected (not anticipated) exceptions in the Java code, a generic xUML exception is thrown.
Folder Handling
Operations expecting a folderPath argument will treat this the following way:
NULL
This is interpreted as meaning the<Inbox>
folder.path beginning with
/
This is interpreted as a path from the mail connections root folder:/Archive/Orders
path not beginning with
/
This is interpreted as a relative path to the<Inbox>
folder:Archive/Orders
translates to/<Inbox>/Archive/Orders
.
The intention of this behavior is to abstract away the fact that <Inbox>
has many different names depending on the connection, i.e. IMAP typically uses INBOX
, Exchange calls it Inbox
, and a German Exchange calls it Posteingang
.
Also note that POP3 does not support folders other than <Inbox>
. Hence when you specify a POP3 connection, folderPath parameters other than NULL will raise an exception.
Used Open Source Libraries
This library makes use of a number of Open Source libraries. The following table lists the main dependent Java Open Source libraries that are used.
Library | Version | License |
---|---|---|
2.0 | MIT License | |
1.6.2 | CDDL/GPLv2+CE | |
1.64 | Bouncy Castle Licence (MIT License) | |
4.5.3 (client) / 4.4.6 (core) | ||
1.5 | ||
1.0.1 |