├── .git-blame-ignore-revs ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── maven.yml │ └── web.yml ├── .gitignore ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE.md ├── NOTICE.md ├── README.md ├── copyright-exclude ├── core ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── eclipse │ │ └── angus │ │ └── mail │ │ ├── auth │ │ ├── MD4.java │ │ ├── Ntlm.java │ │ ├── OAuth2SaslClient.java │ │ ├── OAuth2SaslClientFactory.java │ │ └── package-info.java │ │ ├── handlers │ │ ├── handler_base.java │ │ ├── image_gif.java │ │ ├── image_jpeg.java │ │ ├── message_rfc822.java │ │ ├── multipart_mixed.java │ │ ├── package-info.java │ │ ├── text_html.java │ │ ├── text_plain.java │ │ └── text_xml.java │ │ ├── nativeimage │ │ └── AngusMailFeature.java │ │ ├── package-info.java │ │ └── util │ │ ├── ASCIIUtility.java │ │ ├── BASE64DecoderStream.java │ │ ├── BASE64EncoderStream.java │ │ ├── BEncoderStream.java │ │ ├── CRLFOutputStream.java │ │ ├── DecodingException.java │ │ ├── DefaultProvider.java │ │ ├── LineInputStream.java │ │ ├── LineOutputStream.java │ │ ├── LogOutputStream.java │ │ ├── MailConnectException.java │ │ ├── MailLogger.java │ │ ├── MailSSLSocketFactory.java │ │ ├── MailStreamProvider.java │ │ ├── PropUtil.java │ │ ├── QDecoderStream.java │ │ ├── QEncoderStream.java │ │ ├── QPDecoderStream.java │ │ ├── QPEncoderStream.java │ │ ├── ReadableMime.java │ │ ├── SharedByteArrayOutputStream.java │ │ ├── SocketConnectException.java │ │ ├── SocketFetcher.java │ │ ├── TraceInputStream.java │ │ ├── TraceOutputStream.java │ │ ├── UUDecoderStream.java │ │ ├── UUEncoderStream.java │ │ ├── WriteTimeoutSocket.java │ │ └── package-info.java │ └── resources │ └── META-INF │ ├── javamail.charset.map │ ├── javamail.default.address.map │ ├── mailcap │ ├── native-image │ └── org.eclipse.angus │ │ └── angus-core │ │ ├── native-image.properties │ │ └── resource-config.json │ └── services │ └── jakarta.mail.util.StreamProvider ├── demos ├── client │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ ├── README.txt │ │ ├── example │ │ └── client │ │ │ ├── ComponentFrame.java │ │ │ ├── FolderModel.java │ │ │ ├── FolderTreeNode.java │ │ │ ├── FolderViewer.java │ │ │ ├── MessageViewer.java │ │ │ ├── MultipartViewer.java │ │ │ ├── SimpleAuthenticator.java │ │ │ ├── SimpleClient.java │ │ │ ├── StoreTreeNode.java │ │ │ └── TextViewer.java │ │ └── simple.mailcap ├── demo │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ ├── README.txt │ │ │ ├── example │ │ │ └── app │ │ │ │ ├── CRLFOutputStream.java │ │ │ │ ├── NewlineOutputStream.java │ │ │ │ ├── copier.java │ │ │ │ ├── folderlist.java │ │ │ │ ├── internal │ │ │ │ ├── TtyAuthenticator.java │ │ │ │ ├── answer.java │ │ │ │ ├── foldersplit.java │ │ │ │ ├── fpopulate.java │ │ │ │ ├── msgsperweek.java │ │ │ │ └── testidle.java │ │ │ │ ├── monitor.java │ │ │ │ ├── mover.java │ │ │ │ ├── msgmultisendsample.java │ │ │ │ ├── msgsend.java │ │ │ │ ├── msgsendsample.java │ │ │ │ ├── msgshow.java │ │ │ │ ├── namespace.java │ │ │ │ ├── populate.java │ │ │ │ ├── registry.java │ │ │ │ ├── search.java │ │ │ │ ├── sendfile.java │ │ │ │ ├── sendhtml.java │ │ │ │ ├── smtpsend.java │ │ │ │ ├── transport.java │ │ │ │ └── uidmsgshow.java │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── example │ │ └── app │ │ └── ModulesTest.java ├── logging │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ ├── README.txt │ │ │ ├── example │ │ │ └── app │ │ │ │ ├── FileErrorManager.java │ │ │ │ ├── MailHandlerDemo.java │ │ │ │ └── SummaryFormatter.java │ │ │ ├── maildemo.policy │ │ │ ├── maildemo.properties │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── example │ │ └── app │ │ └── ModulesTest.java ├── outlook │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ ├── README.txt │ │ └── example │ │ └── outlook │ │ ├── MSBodyPart.java │ │ ├── MSMessage.java │ │ └── MSMultipartDataSource.java ├── pom.xml ├── servlet │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ ├── JakartaMail.html │ │ │ ├── README.txt │ │ │ ├── example │ │ │ └── app │ │ │ │ └── JakartaMailServlet.java │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── example │ │ └── app │ │ └── ModulesTest.java ├── taglib │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── demo │ │ │ │ ├── AttachmentInfo.java │ │ │ │ ├── ListAttachmentsTEI.java │ │ │ │ ├── ListAttachmentsTag.java │ │ │ │ ├── ListMessagesTEI.java │ │ │ │ ├── ListMessagesTag.java │ │ │ │ ├── MessageInfo.java │ │ │ │ ├── MessageTEI.java │ │ │ │ ├── MessageTag.java │ │ │ │ └── SendTag.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── taglib.tld │ │ └── test │ │ └── java │ │ └── demo │ │ └── ModulesTest.java └── webapp │ ├── build.bat │ ├── build.sh │ ├── pom.xml │ ├── src │ └── main │ │ ├── java │ │ └── demo │ │ │ ├── AttachmentServlet.java │ │ │ ├── FilterServlet.java │ │ │ └── MailUserBean.java │ │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── compose.jsp │ │ ├── errordetails.jsp │ │ ├── errorpage.jsp │ │ ├── folders.jsp │ │ ├── index.html │ │ ├── login.jsp │ │ ├── logout.jsp │ │ ├── messagecontent.jsp │ │ ├── messageheaders.jsp │ │ └── send.jsp │ └── webapp.README.txt ├── doc ├── CR-1.0.0-SUMMARY-6f02a9.TXT ├── pom.xml └── src │ └── main │ └── resources │ ├── README.md │ ├── TCK-Results.md │ └── docs │ ├── ApacheJServ.html │ ├── CHANGES.txt │ ├── COMPAT.txt │ ├── IssueMap.txt │ ├── JavaWebServer.html │ ├── NOTES.txt │ ├── NTLMNOTES.txt │ ├── README.txt │ ├── SSLNOTES.txt │ ├── Tomcat.html │ ├── classpath-NT.html │ ├── iPlanet.html │ └── images │ ├── direct-classpath.jpg │ └── indirect-classpath.jpg ├── docker ├── Dockerfile ├── JTReportParser │ ├── JTReportParser.jar │ └── lib │ │ ├── commons-lang3-3.5.jar │ │ └── jsoup-1.10.2.jar ├── build_jakartamail.sh └── run_jakartamailtck.sh ├── dsn ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── eclipse │ │ │ └── angus │ │ │ └── mail │ │ │ └── dsn │ │ │ ├── DeliveryStatus.java │ │ │ ├── DispositionNotification.java │ │ │ ├── MessageHeaders.java │ │ │ ├── MultipartReport.java │ │ │ ├── Report.java │ │ │ ├── message_deliverystatus.java │ │ │ ├── message_dispositionnotification.java │ │ │ ├── multipart_report.java │ │ │ ├── package-info.java │ │ │ └── text_rfc822headers.java │ └── resources │ │ └── META-INF │ │ └── mailcap │ └── test │ └── java │ ├── example │ └── app │ │ ├── MultipartReportTest.java │ │ └── NullOutputStream.java │ └── module-info.java ├── mail.sig ├── mailhandler ├── pom.xml └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── eclipse │ │ └── angus │ │ └── mail │ │ └── util │ │ └── logging │ │ ├── CollectorFormatter.java │ │ ├── CompactFormatter.java │ │ ├── DurationFilter.java │ │ ├── LogManagerProperties.java │ │ ├── MailHandler.java │ │ ├── SeverityComparator.java │ │ └── package-info.java │ └── resources │ └── META-INF │ ├── hk2-locator │ └── default │ └── native-image │ └── org.eclipse.angus │ └── logging-mailhandler │ └── resource-config.json ├── pom.xml ├── providers ├── angus-mail │ ├── exclude.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── gfprobe-provider.xml │ │ │ ├── javamail.default.providers │ │ │ └── services │ │ │ └── jakarta.mail.Provider │ │ ├── oldtest │ │ └── java │ │ │ └── jakarta │ │ │ └── mail │ │ │ └── internet │ │ │ ├── decodetest │ │ │ ├── encodedheaders.data │ │ │ ├── messagecachetest.java │ │ │ └── socketfactory │ │ │ ├── DummySSLSocketFactory.java │ │ │ ├── DummySocketFactory.java │ │ │ ├── DummyTrustManager.java │ │ │ ├── TestResult.java │ │ │ └── socketfactorytest.java │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── eclipse │ │ │ └── angus │ │ │ └── mail │ │ │ ├── handlers │ │ │ └── TextXmlTest.java │ │ │ ├── iap │ │ │ ├── ProtocolTest.java │ │ │ ├── ResponseInputStreamTest.java │ │ │ └── ResponseTest.java │ │ │ ├── imap │ │ │ ├── IMAPAlertTest.java │ │ │ ├── IMAPAuthDebugTest.java │ │ │ ├── IMAPCloseFailureTest.java │ │ │ ├── IMAPConnectFailureTest.java │ │ │ ├── IMAPFetchProfileTest.java │ │ │ ├── IMAPFolderTest.java │ │ │ ├── IMAPHandler.java │ │ │ ├── IMAPIDTest.java │ │ │ ├── IMAPIdleManagerTest.java │ │ │ ├── IMAPIdleStateTest.java │ │ │ ├── IMAPIdleUntaggedResponseTest.java │ │ │ ├── IMAPLoginCapabilitiesTest.java │ │ │ ├── IMAPLoginFailureTest.java │ │ │ ├── IMAPLoginHandler.java │ │ │ ├── IMAPLoginReferralTest.java │ │ │ ├── IMAPMessageNumberOutOfRangeTest.java │ │ │ ├── IMAPMessageTest.java │ │ │ ├── IMAPPlainHandler.java │ │ │ ├── IMAPResponseEventTest.java │ │ │ ├── IMAPSaslHandler.java │ │ │ ├── IMAPSaslLoginTest.java │ │ │ ├── IMAPSearchTest.java │ │ │ ├── IMAPStoreTest.java │ │ │ ├── IMAPUidExpungeTest.java │ │ │ ├── MessageCacheTest.java │ │ │ └── protocol │ │ │ │ ├── BODYSTRUCTURETest.java │ │ │ │ ├── EnvelopeTest.java │ │ │ │ ├── IMAPProtocolTest.java │ │ │ │ ├── MODSEQTest.java │ │ │ │ ├── NamespacesTest.java │ │ │ │ ├── StatusTest.java │ │ │ │ ├── StratoImapBugfixTest.java │ │ │ │ └── UIDSetTest.java │ │ │ ├── pop3 │ │ │ ├── POP3AuthDebugTest.java │ │ │ ├── POP3FolderClosedExceptionTest.java │ │ │ ├── POP3Handler.java │ │ │ ├── POP3MessageTest.java │ │ │ ├── POP3ReadableMimeTest.java │ │ │ └── POP3StoreTest.java │ │ │ ├── smtp │ │ │ ├── NopServer.java │ │ │ ├── SMTPAuthDebugTest.java │ │ │ ├── SMTPBdatTest.java │ │ │ ├── SMTPCloseTest.java │ │ │ ├── SMTPConnectFailureTest.java │ │ │ ├── SMTPHandler.java │ │ │ ├── SMTPIOExceptionTest.java │ │ │ ├── SMTPLoginHandler.java │ │ │ ├── SMTPSaslHandler.java │ │ │ ├── SMTPSaslLoginTest.java │ │ │ ├── SMTPUknownCodeTest.java │ │ │ ├── SMTPUtf8Test.java │ │ │ └── SMTPWriteTimeoutTest.java │ │ │ ├── stream │ │ │ ├── LineInputStreamTest.java │ │ │ ├── LineInputStreamUtf8FailTest.java │ │ │ └── LineInputStreamUtf8Test.java │ │ │ ├── test │ │ │ ├── AsciiStringInputStream.java │ │ │ ├── NullOutputStream.java │ │ │ ├── ProtocolHandler.java │ │ │ ├── ReflectionUtil.java │ │ │ ├── SavedSocketFactory.java │ │ │ ├── SessionTest.java │ │ │ ├── TestSSLSocketFactory.java │ │ │ ├── TestServer.java │ │ │ └── TestSocketFactory.java │ │ │ └── util │ │ │ ├── AddAddressHeaderTest.java │ │ │ ├── AddFromTest.java │ │ │ ├── AllowEncodedMessagesTest.java │ │ │ ├── BASE64Test.java │ │ │ ├── ContentTypeCleanerTest.java │ │ │ ├── DecodeParametersTest.java │ │ │ ├── EncodeFileNameNoEncodeParametersTest.java │ │ │ ├── EncodeFileNameTest.java │ │ │ ├── GetLocalAddressTest.java │ │ │ ├── InternetHeadersTest.java │ │ │ ├── MimeBodyPartTest.java │ │ │ ├── MimeMessageTest.java │ │ │ ├── MimeMultipartBCSIndexTest.java │ │ │ ├── MimeMultipartParseTest.java │ │ │ ├── MimeMultipartPreambleTest.java │ │ │ ├── MimeMultipartPropertyTest.java │ │ │ ├── MimeUtilityTest.java │ │ │ ├── ModifyMessageTest.java │ │ │ ├── NoEncodeFileNameNoEncodeParametersTest.java │ │ │ ├── NoEncodeFileNameTest.java │ │ │ ├── NonAsciiBoundaryTest.java │ │ │ ├── ParameterListDecode.java │ │ │ ├── ParametersNoStrictTest.java │ │ │ ├── PropUtilTest.java │ │ │ ├── QPEncoderStreamTest.java │ │ │ ├── ReferencesTest.java │ │ │ ├── RestrictEncodingTest.java │ │ │ ├── SocketFetcherTest.java │ │ │ ├── TimeoutOutputStreamTest.java │ │ │ ├── UUDecoderStreamTest.java │ │ │ ├── Utf8AddressTest.java │ │ │ ├── WriteTimeoutSocketTest.java │ │ │ └── logging │ │ │ ├── AbstractLogging.java │ │ │ ├── CollectorFormatterTest.java │ │ │ ├── CompactFormatterTest.java │ │ │ ├── DurationFilterTest.java │ │ │ ├── LogManagerPropertiesTest.java │ │ │ ├── MailHandlerTest.java │ │ │ └── SeverityComparatorTest.java │ │ └── resources │ │ └── org │ │ └── eclipse │ │ └── angus │ │ └── mail │ │ ├── imap │ │ └── protocol │ │ │ └── uiddata │ │ ├── test │ │ └── keystore.jks │ │ └── util │ │ ├── paramdata │ │ ├── paramdatanostrict │ │ └── uudata ├── gimap │ ├── exclude.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── org │ │ │ │ └── eclipse │ │ │ │ └── angus │ │ │ │ └── mail │ │ │ │ └── gimap │ │ │ │ ├── GmailFolder.java │ │ │ │ ├── GmailMessage.java │ │ │ │ ├── GmailMsgIdTerm.java │ │ │ │ ├── GmailProvider.java │ │ │ │ ├── GmailRawSearchTerm.java │ │ │ │ ├── GmailSSLProvider.java │ │ │ │ ├── GmailSSLStore.java │ │ │ │ ├── GmailStore.java │ │ │ │ ├── GmailThrIdTerm.java │ │ │ │ ├── LongTerm.java │ │ │ │ ├── package-info.java │ │ │ │ └── protocol │ │ │ │ ├── GmailProtocol.java │ │ │ │ └── GmailSearchSequence.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── javamail.providers │ │ │ └── services │ │ │ └── jakarta.mail.Provider │ │ └── test │ │ └── java │ │ ├── example │ │ └── app │ │ │ └── ModulesTest.java │ │ └── module-info.java ├── imap │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── eclipse │ │ │ └── angus │ │ │ └── mail │ │ │ ├── iap │ │ │ ├── Argument.java │ │ │ ├── BadCommandException.java │ │ │ ├── ByteArray.java │ │ │ ├── CommandFailedException.java │ │ │ ├── ConnectionException.java │ │ │ ├── Literal.java │ │ │ ├── LiteralException.java │ │ │ ├── ParsingException.java │ │ │ ├── Protocol.java │ │ │ ├── ProtocolException.java │ │ │ ├── Response.java │ │ │ ├── ResponseHandler.java │ │ │ ├── ResponseInputStream.java │ │ │ └── package-info.java │ │ │ └── imap │ │ │ ├── ACL.java │ │ │ ├── AppendUID.java │ │ │ ├── CopyUID.java │ │ │ ├── DefaultFolder.java │ │ │ ├── IMAPBodyPart.java │ │ │ ├── IMAPFolder.java │ │ │ ├── IMAPInputStream.java │ │ │ ├── IMAPMessage.java │ │ │ ├── IMAPMultipartDataSource.java │ │ │ ├── IMAPNestedMessage.java │ │ │ ├── IMAPProvider.java │ │ │ ├── IMAPSSLProvider.java │ │ │ ├── IMAPSSLStore.java │ │ │ ├── IMAPStore.java │ │ │ ├── IdleManager.java │ │ │ ├── MessageCache.java │ │ │ ├── MessageVanishedEvent.java │ │ │ ├── ModifiedSinceTerm.java │ │ │ ├── OlderTerm.java │ │ │ ├── ReferralException.java │ │ │ ├── ResyncData.java │ │ │ ├── Rights.java │ │ │ ├── SortTerm.java │ │ │ ├── Utility.java │ │ │ ├── YoungerTerm.java │ │ │ ├── package-info.java │ │ │ └── protocol │ │ │ ├── BASE64MailboxDecoder.java │ │ │ ├── BASE64MailboxEncoder.java │ │ │ ├── BODY.java │ │ │ ├── BODYSTRUCTURE.java │ │ │ ├── ENVELOPE.java │ │ │ ├── FLAGS.java │ │ │ ├── FetchItem.java │ │ │ ├── FetchResponse.java │ │ │ ├── ID.java │ │ │ ├── IMAPProtocol.java │ │ │ ├── IMAPReferralException.java │ │ │ ├── IMAPResponse.java │ │ │ ├── IMAPSaslAuthenticator.java │ │ │ ├── INTERNALDATE.java │ │ │ ├── Item.java │ │ │ ├── ListInfo.java │ │ │ ├── MODSEQ.java │ │ │ ├── MailboxInfo.java │ │ │ ├── MessageSet.java │ │ │ ├── Namespaces.java │ │ │ ├── RFC822DATA.java │ │ │ ├── RFC822SIZE.java │ │ │ ├── SaslAuthenticator.java │ │ │ ├── SearchSequence.java │ │ │ ├── Status.java │ │ │ ├── UID.java │ │ │ ├── UIDSet.java │ │ │ └── package-info.java │ │ └── resources │ │ └── META-INF │ │ ├── javamail.providers │ │ └── services │ │ └── jakarta.mail.Provider ├── jakarta.mail │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── module-info.java │ │ └── javadoc │ │ └── doc-files │ │ └── speclicense.html ├── mbox │ ├── exclude.xml │ ├── native │ │ └── pom.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── cpp │ │ │ └── org │ │ │ │ └── eclipse │ │ │ │ └── angus │ │ │ │ └── mail │ │ │ │ └── mbox │ │ │ │ ├── UNIXFile.c │ │ │ │ └── UNIXInbox.c │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── org │ │ │ │ └── eclipse │ │ │ │ └── angus │ │ │ │ └── mail │ │ │ │ ├── mbox │ │ │ │ ├── ContentLengthCounter.java │ │ │ │ ├── ContentLengthUpdater.java │ │ │ │ ├── DefaultMailbox.java │ │ │ │ ├── FileInterface.java │ │ │ │ ├── InboxFile.java │ │ │ │ ├── LineCounter.java │ │ │ │ ├── MailFile.java │ │ │ │ ├── Mailbox.java │ │ │ │ ├── MboxFolder.java │ │ │ │ ├── MboxMessage.java │ │ │ │ ├── MboxProvider.java │ │ │ │ ├── MboxStore.java │ │ │ │ ├── MessageLoader.java │ │ │ │ ├── NewlineOutputStream.java │ │ │ │ ├── SolarisMailbox.java │ │ │ │ ├── SunOSMailbox.java │ │ │ │ ├── SunV3BodyPart.java │ │ │ │ ├── SunV3Multipart.java │ │ │ │ ├── TempFile.java │ │ │ │ ├── UNIXFile.java │ │ │ │ ├── UNIXFolder.java │ │ │ │ └── UNIXInbox.java │ │ │ │ └── remote │ │ │ │ ├── POP3RemoteProvider.java │ │ │ │ ├── POP3RemoteStore.java │ │ │ │ ├── RemoteDefaultFolder.java │ │ │ │ ├── RemoteInbox.java │ │ │ │ └── RemoteStore.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── javamail.providers │ │ │ └── services │ │ │ └── jakarta.mail.Provider │ │ └── test │ │ └── java │ │ └── org │ │ └── eclipse │ │ └── angus │ │ └── mail │ │ └── mbox │ │ ├── MboxFolderExpungeTest.java │ │ └── MboxFolderTest.java ├── pom.xml ├── pop3 │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── eclipse │ │ │ └── angus │ │ │ └── mail │ │ │ └── pop3 │ │ │ ├── AppendStream.java │ │ │ ├── DefaultFolder.java │ │ │ ├── POP3Folder.java │ │ │ ├── POP3Message.java │ │ │ ├── POP3Provider.java │ │ │ ├── POP3SSLProvider.java │ │ │ ├── POP3SSLStore.java │ │ │ ├── POP3Store.java │ │ │ ├── Protocol.java │ │ │ ├── Status.java │ │ │ ├── TempFile.java │ │ │ ├── WritableSharedFile.java │ │ │ └── package-info.java │ │ └── resources │ │ └── META-INF │ │ ├── javamail.providers │ │ └── services │ │ └── jakarta.mail.Provider └── smtp │ ├── pom.xml │ └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── eclipse │ │ └── angus │ │ └── mail │ │ └── smtp │ │ ├── DigestMD5.java │ │ ├── SMTPAddressFailedException.java │ │ ├── SMTPAddressSucceededException.java │ │ ├── SMTPMessage.java │ │ ├── SMTPOutputStream.java │ │ ├── SMTPProvider.java │ │ ├── SMTPSSLProvider.java │ │ ├── SMTPSSLTransport.java │ │ ├── SMTPSaslAuthenticator.java │ │ ├── SMTPSendFailedException.java │ │ ├── SMTPSenderFailedException.java │ │ ├── SMTPTransport.java │ │ ├── SaslAuthenticator.java │ │ └── package-info.java │ └── resources │ └── META-INF │ ├── javamail.address.map │ ├── javamail.providers │ └── services │ └── jakarta.mail.Provider ├── siggen ├── sigtest ├── src └── main │ └── assembly │ └── resources.xml ├── update_version └── www ├── Android.md ├── AngusMail-License.md ├── Books.md ├── Build-Instructions.md ├── Contributions.md ├── Exchange.md ├── FAQ.html ├── Gemfile ├── Gemfile.lock ├── Gmail.md ├── Google-App-Engine.md ├── IMAP-Store.md ├── InstallCert.java ├── InstallCert.md ├── Links.md ├── Mbox-Provider.md ├── Mbox-Store.md ├── OAuth2.md ├── Outlook.md ├── POP3-Remote-Store.md ├── POP3-Store.md ├── SMTP-Transport.md ├── ThirdPartyProducts.md ├── Windows.md ├── Workspace-Structure.md ├── Yahoo.md ├── _config.yml ├── _includes ├── header-small.html └── sidebar.html └── _layouts └── content.html /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | #fix code formatting through the repo 2 | 216c5f802cb6002ce9f0c8f227c70b27bc2817b7 3 | 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 16 | 1. Go to '...' 17 | 2. Click on '....' 18 | 3. Scroll down to '....' 19 | 4. See error 20 | 21 | **Expected behavior** 22 | A clear and concise description of what you expected to happen. 23 | 24 | **Screenshots** 25 | If applicable, add screenshots to help explain your problem. 26 | 27 | **Desktop (please complete the following information):** 28 | 29 | - OS: [e.g. iOS] 30 | - Browser [e.g. chrome, safari] 31 | - Version [e.g. 22] 32 | 33 | **Smartphone (please complete the following information):** 34 | 35 | - Device: [e.g. iPhone6] 36 | - OS: [e.g. iOS8.1] 37 | - Browser [e.g. stock browser, safari] 38 | - Version [e.g. 22] 39 | 40 | **Mail server:** 41 | 42 | - Protocol being used: [e.g. smtp, imap, pop3, etc.] 43 | - Vendor/product: [e.g. Microsoft Exchange] 44 | - Mail service URL: [e.g. gmail.com] 45 | 46 | **Additional context** 47 | Add any other context about the problem here. 48 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Eclipse Public License v. 2.0 which is available at 6 | # http://www.eclipse.org/legal/epl-2.0, 7 | # or the Eclipse Distribution License v. 1.0 which is available at 8 | # http://www.eclipse.org/org/documents/edl-v10.php. 9 | # 10 | # SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause 11 | # 12 | 13 | name: Angus Mail 14 | 15 | on: 16 | pull_request: 17 | paths-ignore: 18 | - 'doc/**' 19 | - 'www/**' 20 | push: 21 | paths-ignore: 22 | - 'doc/**' 23 | - 'www/**' 24 | 25 | jobs: 26 | build: 27 | name: Test on JDK ${{ matrix.java_version }} 28 | runs-on: ubuntu-latest 29 | 30 | strategy: 31 | matrix: 32 | java_version: [ 8, 17, 21 ] 33 | 34 | steps: 35 | - name: Checkout for build 36 | uses: actions/checkout@v4 37 | - name: Set up JDK 38 | uses: actions/setup-java@v4 39 | with: 40 | distribution: 'zulu' 41 | java-version: ${{ matrix.java_version }} 42 | cache: maven 43 | - name: Verify 44 | run: mvn -B -U -C -V clean verify org.glassfish.copyright:glassfish-copyright-maven-plugin:check -Poss-release,staging,build-only -Dgpg.skip=true -Dcopyright.ignoreyear=true -Denforcer.skip 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | target/ 3 | nbproject/private/ 4 | webrev 5 | mbox/.ccls-cache/ 6 | /bin/ 7 | .classpath 8 | .project 9 | .settings/ 10 | 11 | _site 12 | www/.sass-cache 13 | www/.jekyll-cache 14 | www/.jekyll-metadata 15 | www/vendor 16 | www/docs 17 | www/CONTRIBUTING.md 18 | www/README.md 19 | www/TCK-Results.md 20 | *.iml 21 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | # Notices for Jakarta Mail 2 | 3 | This content is produced and maintained by the Jakarta Mail project. 4 | 5 | * Project home: https://projects.eclipse.org/projects/ee4j.mail 6 | 7 | ## Trademarks 8 | 9 | Jakarta Mail is a trademark of the Eclipse Foundation. 10 | 11 | ## Copyright 12 | 13 | All content is the property of the respective authors or their employers. For 14 | more information regarding authorship of content, please consult the listed 15 | source code repository logs. 16 | 17 | ## Declared Project Licenses 18 | 19 | This program and the accompanying materials are made available under the terms 20 | of the Eclipse Public License v. 2.0 which is available at 21 | http://www.eclipse.org/legal/epl-2.0. This Source Code may also be made 22 | available under the following Secondary Licenses when the conditions for such 23 | availability set forth in the Eclipse Public License v. 2.0 are satisfied: GNU 24 | General Public License, version 2 with the GNU Classpath Exception which is 25 | available at https://www.gnu.org/software/classpath/license.html. 26 | 27 | SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 28 | 29 | ## Source Code 30 | 31 | The project maintains the following source code repositories: 32 | 33 | * https://github.com/eclipse-ee4j/mail 34 | 35 | ## Third-party Content 36 | 37 | This project leverages the following third party content. 38 | 39 | None 40 | 41 | ## Cryptography 42 | 43 | Content may contain encryption software. The country in which you are currently 44 | may have restrictions on the import, possession, and use, and/or re-export to 45 | another country, of encryption software. BEFORE using any encryption software, 46 | please check the country's laws, regulations and policies concerning the import, 47 | possession, or use, and re-export of encryption software, to see if this is 48 | permitted. 49 | 50 | -------------------------------------------------------------------------------- /copyright-exclude: -------------------------------------------------------------------------------- 1 | copyright-exclude 2 | /MANIFEST.MF 3 | /META-INF/services/ 4 | /META-INF/javamail 5 | /META-INF/mailcap 6 | /README 7 | /NOTICE 8 | /Jenkinsfile 9 | doc/release/ 10 | doc/spec/ 11 | /LICENSE.txt 12 | CONTRIBUTING.md 13 | LICENSE.md 14 | client/src/main/java/simple.mailcap 15 | mail/src/oldtest/java/jakarta/mail/internet/encodedheaders.data 16 | mail.sig 17 | webapp/build.bat 18 | webapp/webapp.README.txt 19 | logging/src/main/java/ 20 | mail/src/test/resources/jakarta/mail/internet/paramdata 21 | mail/src/test/resources/jakarta/mail/internet/paramdatanostrict 22 | mail/src/test/resources/jakarta/mail/internet/tokenlist 23 | mail/src/test/resources/jakarta/mail/internet/addrlist 24 | mail/src/test/resources/jakarta/mail/internet/MailDateFormat_old.ser 25 | mail/src/test/resources/jakarta/mail/internet/MailDateFormat_new.ser 26 | mail/src/test/resources/org/eclipse/angus/mail/test/keystore.jks 27 | mail/src/main/java/doc-files/speclicense.html 28 | mailhandler/src/main/resources/META-INF/hk2-locator/default 29 | docker/JTReportParser/ 30 | providers/angus-mail/src/test/resources/org/eclipse/angus/mail/util/paramdatanostrict 31 | providers/angus-mail/src/test/resources/org/eclipse/angus/mail/util/paramdata 32 | .txt 33 | .TXT 34 | www/ 35 | .json 36 | .jpg 37 | .md 38 | -------------------------------------------------------------------------------- /core/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail { 18 | 19 | requires transitive java.logging; 20 | requires java.xml; // for text/xml handler 21 | requires java.desktop; // for image/jpeg handler 22 | requires static java.security.sasl; // for OAuth2 support 23 | requires transitive jakarta.mail; 24 | requires transitive jakarta.activation; 25 | 26 | requires static org.graalvm.sdk; // for graal integration 27 | 28 | exports org.eclipse.angus.mail.auth; 29 | exports org.eclipse.angus.mail.handlers; 30 | exports org.eclipse.angus.mail.util; 31 | 32 | uses jakarta.mail.Provider; 33 | 34 | provides jakarta.mail.util.StreamProvider with 35 | org.eclipse.angus.mail.util.MailStreamProvider; 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/auth/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | /** 18 | * This package includes internal authentication support classes and 19 | * SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 20 | */ 21 | package org.eclipse.angus.mail.auth; 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/handlers/image_jpeg.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.handlers; 18 | 19 | import jakarta.activation.ActivationDataFlavor; 20 | 21 | import java.awt.*; 22 | 23 | /** 24 | * DataContentHandler for image/jpeg. 25 | */ 26 | public class image_jpeg extends image_gif { 27 | private static ActivationDataFlavor[] myDF = { 28 | new ActivationDataFlavor(Image.class, "image/jpeg", "JPEG Image") 29 | }; 30 | 31 | /** 32 | * Creates a default {@code image_jpeg}. 33 | */ 34 | public image_jpeg() { 35 | } 36 | 37 | @Override 38 | protected ActivationDataFlavor[] getDataFlavors() { 39 | return myDF; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/handlers/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | /** 18 | * This package includes internal data handler support classes and 19 | * SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 20 | */ 21 | package org.eclipse.angus.mail.handlers; 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/handlers/text_html.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.handlers; 18 | 19 | import jakarta.activation.ActivationDataFlavor; 20 | 21 | /** 22 | * DataContentHandler for text/html. 23 | */ 24 | public class text_html extends text_plain { 25 | private static ActivationDataFlavor[] myDF = { 26 | new ActivationDataFlavor(String.class, "text/html", "HTML String") 27 | }; 28 | 29 | /** 30 | * Creates a default {@code text_html}. 31 | */ 32 | public text_html() { 33 | } 34 | 35 | @Override 36 | protected ActivationDataFlavor[] getDataFlavors() { 37 | return myDF; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/util/BEncoderStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import java.io.OutputStream; 20 | 21 | /** 22 | * This class implements a 'B' Encoder as defined by RFC2047 for 23 | * encoding MIME headers. It subclasses the BASE64EncoderStream 24 | * class. 25 | * 26 | * @author John Mani 27 | */ 28 | 29 | public class BEncoderStream extends BASE64EncoderStream { 30 | 31 | /** 32 | * Create a 'B' encoder that encodes the specified input stream. 33 | * 34 | * @param out the output stream 35 | */ 36 | public BEncoderStream(OutputStream out) { 37 | super(out, Integer.MAX_VALUE); // MAX_VALUE is 2^31, should 38 | // suffice (!) to indicate that 39 | // CRLFs should not be inserted 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/util/DecodingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * A special IOException that indicates a failure to decode data due 23 | * to an error in the formatting of the data. This allows applications 24 | * to distinguish decoding errors from other I/O errors. 25 | * 26 | * @author Bill Shannon 27 | */ 28 | 29 | public class DecodingException extends IOException { 30 | 31 | private static final long serialVersionUID = -6913647794421459390L; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param s the exception message 37 | */ 38 | public DecodingException(String s) { 39 | super(s); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/util/DefaultProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Annotation to mark the default providers that are part of Jakarta Mail. 26 | * DO NOT use this on any provider made available independently. 27 | * 28 | * @author Bill Shannon 29 | * @since Jakarta Mail 1.6.4 30 | */ 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.TYPE) 33 | public @interface DefaultProvider { 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/util/ReadableMime.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import jakarta.mail.MessagingException; 20 | 21 | import java.io.InputStream; 22 | 23 | /** 24 | * A Message or message Part whose data can be read as a MIME format 25 | * stream. Note that the MIME stream will include both the headers 26 | * and the body of the message or part. This should be the same data 27 | * that is produced by the writeTo method, but in a readable form. 28 | * 29 | * @author Bill Shannon 30 | * @since JavaMail 1.4.5 31 | */ 32 | public interface ReadableMime { 33 | /** 34 | * Return the MIME format stream corresponding to this message part. 35 | * 36 | * @return the MIME format stream 37 | * @exception MessagingException for failures 38 | */ 39 | public InputStream getMimeStream() throws MessagingException; 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/util/SharedByteArrayOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import jakarta.mail.util.SharedByteArrayInputStream; 20 | 21 | import java.io.ByteArrayOutputStream; 22 | import java.io.InputStream; 23 | 24 | /** 25 | * A ByteArrayOutputStream that allows us to share the byte array 26 | * rather than copy it. Eventually could replace this with something 27 | * that doesn't require a single contiguous byte array. 28 | * 29 | * @author Bill Shannon 30 | * @since JavaMail 1.4.5 31 | */ 32 | public class SharedByteArrayOutputStream extends ByteArrayOutputStream { 33 | public SharedByteArrayOutputStream(int size) { 34 | super(size); 35 | } 36 | 37 | public InputStream toStream() { 38 | return new SharedByteArrayInputStream(buf, 0, count); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/eclipse/angus/mail/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | /** 18 | * Utility classes for use with the Jakarta Mail API. 19 | * These utility classes are not part of the Jakarta Mail specification. 20 | * While this package contains many classes used by the Jakarta Mail implementation 21 | * and not intended for direct use by applications, the classes documented 22 | * here may be of use to applications. 23 | * 24 | *

25 | * Classes in this package log debugging information using 26 | * {@link java.util.logging} as described in the following table: 27 | *

28 | * 29 | * 30 | * 31 | * 32 | * 33 | * 34 | * 35 | * 36 | * 37 | * 38 | * 39 | * 40 | * 41 | *
org.eclipse.angus.mail.util Loggers
Logger NameLogging LevelPurpose
org.eclipse.angus.mail.util.socketFINERDebugging output related to creating sockets
42 | * 43 | *

44 | * WARNING: The APIs in this package should be 45 | * considered EXPERIMENTAL. They may be changed in the 46 | * future in ways that are incompatible with applications using the 47 | * current APIs. 48 | */ 49 | package org.eclipse.angus.mail.util; 50 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/javamail.charset.map: -------------------------------------------------------------------------------- 1 | ### JDK-to-MIME charset mapping table #### 2 | ### This should be the first mapping table ### 3 | 4 | 8859_1 ISO-8859-1 5 | iso8859_1 ISO-8859-1 6 | ISO8859-1 ISO-8859-1 7 | 8 | 8859_2 ISO-8859-2 9 | iso8859_2 ISO-8859-2 10 | ISO8859-2 ISO-8859-2 11 | 12 | 8859_3 ISO-8859-3 13 | iso8859_3 ISO-8859-3 14 | ISO8859-3 ISO-8859-3 15 | 16 | 8859_4 ISO-8859-4 17 | iso8859_4 ISO-8859-4 18 | ISO8859-4 ISO-8859-4 19 | 20 | 8859_5 ISO-8859-5 21 | iso8859_5 ISO-8859-5 22 | ISO8859-5 ISO-8859-5 23 | 24 | 8859_6 ISO-8859-6 25 | iso8859_6 ISO-8859-6 26 | ISO8859-6 ISO-8859-6 27 | 28 | 8859_7 ISO-8859-7 29 | iso8859_7 ISO-8859-7 30 | ISO8859-7 ISO-8859-7 31 | 32 | 8859_8 ISO-8859-8 33 | iso8859_8 ISO-8859-8 34 | ISO8859-8 ISO-8859-8 35 | 36 | 8859_9 ISO-8859-9 37 | iso8859_9 ISO-8859-9 38 | ISO8859-9 ISO-8859-9 39 | 40 | SJIS Shift_JIS 41 | JIS ISO-2022-JP 42 | ISO2022JP ISO-2022-JP 43 | EUC_JP euc-jp 44 | KOI8_R koi8-r 45 | EUC_CN euc-cn 46 | EUC_TW euc-tw 47 | EUC_KR euc-kr 48 | 49 | --DIVIDER: this line *must* start with "--" and end with "--" -- 50 | 51 | #### XXX-to-JDK charset mapping table #### 52 | 53 | iso-2022-cn ISO2022CN 54 | iso-2022-kr ISO2022KR 55 | utf-8 UTF8 56 | utf8 UTF8 57 | en_US.iso885915 ISO-8859-15 58 | ja_jp.iso2022-7 ISO2022JP 59 | ja_jp.eucjp EUCJIS 60 | 61 | # these two are not needed in 1.1.6. (since EUC_KR exists 62 | # and KSC5601 will map to the correct converter) 63 | euc-kr KSC5601 64 | euckr KSC5601 65 | 66 | # in JDK 1.1.6 we will no longer need the "us-ascii" convert 67 | us-ascii ISO-8859-1 68 | x-us-ascii ISO-8859-1 69 | 70 | # Chinese charsets are a mess and widely misrepresented. 71 | # gb18030 is a superset of gbk, which is a supserset of cp936/ms936, 72 | # which is a superset of gb2312. 73 | # https://bugzilla.gnome.org/show_bug.cgi?id=446783 74 | # map all of these to gb18030. 75 | gb2312 GB18030 76 | cp936 GB18030 77 | ms936 GB18030 78 | gbk GB18030 79 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/javamail.default.address.map: -------------------------------------------------------------------------------- 1 | rfc822=smtp 2 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/mailcap: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Default mailcap file for the Jakarta Mail System. 4 | # 5 | # Jakarta Mail content-handlers: 6 | # 7 | text/plain;; x-java-content-handler=org.eclipse.angus.mail.handlers.text_plain 8 | text/html;; x-java-content-handler=org.eclipse.angus.mail.handlers.text_html 9 | text/xml;; x-java-content-handler=org.eclipse.angus.mail.handlers.text_xml 10 | multipart/*;; x-java-content-handler=org.eclipse.angus.mail.handlers.multipart_mixed; x-java-fallback-entry=true 11 | message/rfc822;; x-java-content-handler=org.eclipse.angus.mail.handlers.message_rfc822 12 | # 13 | # can't support image types because java.awt.Toolkit doesn't work on servers 14 | # 15 | #image/gif;; x-java-content-handler=org.eclipse.angus.mail.handlers.image_gif 16 | #image/jpeg;; x-java-content-handler=org.eclipse.angus.mail.handlers.image_jpeg 17 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/native-image/org.eclipse.angus/angus-core/native-image.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Eclipse Distribution License v. 1.0, which is available at 6 | # http://www.eclipse.org/org/documents/edl-v10.php. 7 | # 8 | # SPDX-License-Identifier: BSD-3-Clause 9 | Args=--features=org.eclipse.angus.mail.nativeimage.AngusMailFeature 10 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/native-image/org.eclipse.angus/angus-core/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": { 3 | "includes": [ 4 | { 5 | "pattern": "\\QMETA-INF/gfprobe-provider.xml\\E" 6 | }, 7 | { 8 | "pattern": "\\QMETA-INF/javamail.charset.map\\E" 9 | }, 10 | { 11 | "pattern": "\\QMETA-INF/javamail.address.map\\E" 12 | }, 13 | { 14 | "pattern": "\\QMETA-INF/javamail.default.address.map\\E" 15 | }, 16 | { 17 | "pattern": "\\QMETA-INF/javamail.default.providers\\E" 18 | }, 19 | { 20 | "pattern": "\\QMETA-INF/javamail.providers\\E" 21 | } 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/jakarta.mail.util.StreamProvider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.util.MailStreamProvider -------------------------------------------------------------------------------- /demos/client/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | org.eclipse.angus 25 | demos 26 | 2.1.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | client 32 | Jakarta Mail API demo client 33 | 34 | 35 | 36 | org.eclipse.angus 37 | angus-mail 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /demos/client/src/main/java/example/client/ComponentFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2024 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | package example.client; 12 | 13 | import javax.swing.*; 14 | import java.awt.*; 15 | 16 | /** 17 | * this Frame provides a utility class for displaying a single 18 | * Component in a Frame. 19 | * 20 | * @author Christopher Cotton 21 | */ 22 | public class ComponentFrame extends JFrame { 23 | private static final long serialVersionUID = -1L; 24 | 25 | /** 26 | * creates the frame 27 | * 28 | * @param what the component to display 29 | */ 30 | public ComponentFrame(Component what) { 31 | this(what, "Component Frame"); 32 | } 33 | 34 | /** 35 | * creates the frame with the given name 36 | * 37 | * @param what the component to display 38 | * @param name the name of the Frame 39 | */ 40 | @SuppressWarnings("this-escape") 41 | public ComponentFrame(Component what, String name) { 42 | super(name); 43 | 44 | // make sure that we close and dispose ourselves when needed 45 | setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 46 | 47 | // default size of the frame 48 | setSize(700, 600); 49 | 50 | // we want to display just the component in the entire frame 51 | if (what != null) { 52 | getContentPane().add("Center", what); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /demos/client/src/main/java/simple.mailcap: -------------------------------------------------------------------------------- 1 | # 2 | # Example command map, using the MailcapCommandMap. 3 | # 4 | # for our viewers 5 | # 6 | message/*;; x-java-view=example.client.MessageViewer 7 | text/plain;; x-java-view=example.client.TextViewer 8 | multipart/*;; x-java-view=example.client.MultipartViewer 9 | 10 | -------------------------------------------------------------------------------- /demos/demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | org.eclipse.angus 25 | demos 26 | 2.1.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | org.eclipse.angus 32 | demo 33 | Jakarta Mail API demo 34 | 35 | 36 | 37 | org.eclipse.angus 38 | angus-mail 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /demos/demo/src/main/java/example/app/NewlineOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | package example.app.internal; 12 | 13 | import java.io.FilterOutputStream; 14 | import java.io.IOException; 15 | import java.io.OutputStream; 16 | import java.nio.charset.StandardCharsets; 17 | 18 | /** 19 | * Convert the various newline conventions to the local platform's 20 | * newline convention.

21 | * 22 | * This stream can be used with the Message.writeTo method to 23 | * generate a message that uses the local plaform's line terminator 24 | * for the purpose of (e.g.) saving the message to a local file. 25 | */ 26 | public class NewlineOutputStream extends FilterOutputStream { 27 | private int lastb = -1; 28 | private static byte[] newline; 29 | 30 | public NewlineOutputStream(OutputStream os) { 31 | super(os); 32 | if (newline == null) { 33 | String s = System.lineSeparator(); 34 | if (s == null || s.length() <= 0) 35 | s = "\n"; 36 | newline = s.getBytes(StandardCharsets.ISO_8859_1); // really us-ascii 37 | } 38 | } 39 | 40 | public void write(int b) throws IOException { 41 | if (b == '\r') { 42 | out.write(newline); 43 | } else if (b == '\n') { 44 | if (lastb != '\r') 45 | out.write(newline); 46 | } else { 47 | out.write(b); 48 | } 49 | lastb = b; 50 | } 51 | 52 | public void write(byte[] b) throws IOException { 53 | write(b, 0, b.length); 54 | } 55 | 56 | public void write(byte[] b, int off, int len) throws IOException { 57 | for (int i = 0; i < len; i++) { 58 | write(b[off + i]); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /demos/demo/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module example.app { 18 | requires org.eclipse.angus.mail; 19 | } -------------------------------------------------------------------------------- /demos/demo/src/test/java/example/app/ModulesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package example.app; 18 | 19 | import jakarta.mail.NoSuchProviderException; 20 | import jakarta.mail.Session; 21 | import jakarta.mail.util.StreamProvider; 22 | import org.eclipse.angus.mail.util.MailStreamProvider; 23 | import org.junit.Test; 24 | 25 | import java.util.Properties; 26 | 27 | import static org.junit.Assert.assertEquals; 28 | 29 | public class ModulesTest { 30 | 31 | // With org.eclipse.angus:angus-mail 32 | @Test 33 | public void test() throws NoSuchProviderException, ClassNotFoundException { 34 | Session session = Session.getDefaultInstance(new Properties()); 35 | StreamProvider provider = session.getStreamProvider(); 36 | assertEquals(MailStreamProvider.class, provider.getClass()); 37 | Class.forName("org.eclipse.angus.mail.imap.IMAPProvider"); 38 | Class.forName("org.eclipse.angus.mail.pop3.POP3Provider"); 39 | Class.forName("org.eclipse.angus.mail.smtp.SMTPProvider"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /demos/logging/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | org.eclipse.angus 25 | demos 26 | 2.1.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | logging 32 | Jakarta Mail API logging demo 33 | 34 | 35 | 36 | org.eclipse.angus 37 | jakarta.mail 38 | ${project.version} 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /demos/logging/src/main/java/maildemo.policy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * Copyright (c) 2014, 2023 Jason Mehrens. All Rights Reserved. 4 | * 5 | * This program and the accompanying materials are made available under the 6 | * terms of the Eclipse Distribution License v. 1.0, which is available at 7 | * http://www.eclipse.org/org/documents/edl-v10.php. 8 | * 9 | * SPDX-License-Identifier: BSD-3-Clause 10 | */ 11 | grant { 12 | permission java.util.logging.LoggingPermission "control"; 13 | permission java.util.PropertyPermission "*", "read, write"; 14 | permission java.net.SocketPermission "*", "resolve, connect"; 15 | permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources"; 16 | permission java.io.FilePermission "<>", "read, write"; 17 | permission java.lang.RuntimePermission "getClassLoader"; 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /demos/logging/src/main/java/maildemo.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2009, 2023 Oracle and/or its affiliates. All rights reserved. 3 | # Copyright (c) 2009, 2023 Jason Mehrens. All Rights Reserved. 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Eclipse Distribution License v. 1.0, which is available at 7 | # http://www.eclipse.org/org/documents/edl-v10.php. 8 | # 9 | # SPDX-License-Identifier: BSD-3-Clause 10 | # This can be used by setting the system property 11 | # -Djava.util.logging.config.file=path to this file 12 | # Taken from the JDK defaults. 13 | handlers=java.util.logging.ConsoleHandler 14 | .level=INFO 15 | java.util.logging.ConsoleHandler.level=INFO 16 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 17 | # Set the mail handler demo logger level 18 | MailHandlerDemo.level=ALL 19 | # Configure the MailHandler. 20 | org.eclipse.angus.mail.util.logging.MailHandler.level=ALL 21 | org.eclipse.angus.mail.util.logging.MailHandler.mail.host=my-mail-server 22 | org.eclipse.angus.mail.util.logging.MailHandler.mail.from=me@example.com 23 | org.eclipse.angus.mail.util.logging.MailHandler.mail.to=me@example.com 24 | org.eclipse.angus.mail.util.logging.MailHandler.verify=local 25 | # Add attachments if needed. 26 | #org.eclipse.angus.mail.util.logging.MailHandler.attachment.formatters = java.util.logging.SimpleFormatter, java.util.logging.XMLFormatter 27 | # No filters. 28 | #org.eclipse.angus.mail.util.logging.MailHandler.attachment.filters = null, null 29 | # Formatter class name or strings. 30 | #org.eclipse.angus.mail.util.logging.MailHandler.attachment.names = simple.txt, error.xml 31 | # Store messages on error by installing the FileErrorManager (demo code). 32 | org.eclipse.angus.mail.util.logging.MailHandler.errorManager=FileErrorManager 33 | # Configure the FileErrorManager for demo (not required). 34 | # FileErrorManager.pattern = path-to-dir 35 | # Debug mail transport issues. 36 | mail.debug=false 37 | -------------------------------------------------------------------------------- /demos/logging/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module example.app { 18 | requires jakarta.mail; 19 | requires java.management; 20 | requires java.logging; 21 | } -------------------------------------------------------------------------------- /demos/logging/src/test/java/example/app/ModulesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package example.app; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.util.StreamProvider; 21 | import org.eclipse.angus.mail.util.MailStreamProvider; 22 | import org.junit.Test; 23 | 24 | import java.util.Properties; 25 | 26 | import static org.junit.Assert.assertEquals; 27 | 28 | public class ModulesTest { 29 | 30 | // With org.eclipse.angus:jakarta.mail 31 | @Test 32 | public void test() throws Exception { 33 | Session session = Session.getDefaultInstance(new Properties()); 34 | StreamProvider provider = session.getStreamProvider(); 35 | assertEquals(MailStreamProvider.class, provider.getClass()); 36 | Class.forName("org.eclipse.angus.mail.imap.IMAPProvider"); 37 | Class.forName("org.eclipse.angus.mail.pop3.POP3Provider"); 38 | Class.forName("org.eclipse.angus.mail.smtp.SMTPProvider"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /demos/outlook/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | org.eclipse.angus 25 | demos 26 | 2.1.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | outlook 32 | Jakarta Mail API demo Outlook message support 33 | 34 | 35 | 36 | org.eclipse.angus 37 | angus-mail 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /demos/outlook/src/main/java/README.txt: -------------------------------------------------------------------------------- 1 | The classes in this directory allow processing old style non-MIME 2 | messages created by Microsoft Outlook. Use them like this: 3 | 4 | if (example.outlook.MSMessage.isMSMessage(msg)) 5 | msg = new example.outlook.MSMessage(session, msg); 6 | 7 | Note that these classes are not particularly efficient or optimized, 8 | but they show how to process these non-MIME messages and make them 9 | look like MIME messages. 10 | -------------------------------------------------------------------------------- /demos/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | org.eclipse.angus 25 | all 26 | 2.1.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | org.eclipse.angus 32 | demos 33 | pom 34 | Jakarta Mail API demos 35 | 36 | 37 | demo 38 | client 39 | servlet 40 | webapp 41 | taglib 42 | logging 43 | outlook 44 | 45 | 46 | 47 | 48 | junit 49 | junit 50 | test 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /demos/servlet/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | org.eclipse.angus 25 | demos 26 | 2.1.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | servlet 32 | Jakarta Mail API demo servlet 33 | 34 | 35 | 36 | jakarta.servlet 37 | jakarta.servlet-api 38 | 39 | 40 | org.eclipse.angus 41 | jakarta.mail 42 | ${project.version} 43 | 44 | 45 | org.eclipse.angus 46 | dsn 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /demos/servlet/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module example.app { 18 | requires jakarta.mail; 19 | requires jakarta.servlet; 20 | requires org.eclipse.angus.mail.dsn; 21 | } -------------------------------------------------------------------------------- /demos/servlet/src/test/java/example/app/ModulesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package example.app; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.util.StreamProvider; 21 | import org.eclipse.angus.mail.util.MailStreamProvider; 22 | import org.junit.Test; 23 | 24 | import java.util.Properties; 25 | 26 | import static org.junit.Assert.assertEquals; 27 | 28 | public class ModulesTest { 29 | 30 | // With org.eclipse.angus:jakarta.mail and org.eclipse.angus:dsn 31 | @Test 32 | public void test() throws Exception { 33 | Session session = Session.getDefaultInstance(new Properties()); 34 | StreamProvider provider = session.getStreamProvider(); 35 | assertEquals(MailStreamProvider.class, provider.getClass()); 36 | Class.forName("org.eclipse.angus.mail.imap.IMAPProvider"); 37 | Class.forName("org.eclipse.angus.mail.pop3.POP3Provider"); 38 | Class.forName("org.eclipse.angus.mail.smtp.SMTPProvider"); 39 | Class.forName("org.eclipse.angus.mail.dsn.DeliveryStatus"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /demos/taglib/src/main/java/demo/ListAttachmentsTEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | package demo; 12 | 13 | import jakarta.servlet.jsp.tagext.TagData; 14 | import jakarta.servlet.jsp.tagext.TagExtraInfo; 15 | import jakarta.servlet.jsp.tagext.VariableInfo; 16 | 17 | /** 18 | * Extra information class to support the scripting variable created by the 19 | * ListAttachmentsTag class. The scope of the variable is limited to the body 20 | * of the tag. 21 | */ 22 | public class ListAttachmentsTEI extends TagExtraInfo { 23 | 24 | public ListAttachmentsTEI() { 25 | super(); 26 | } 27 | 28 | public VariableInfo[] getVariableInfo(TagData data) { 29 | VariableInfo info = new VariableInfo(data.getId(), "AttachmentInfo", 30 | true, VariableInfo.NESTED); 31 | VariableInfo[] varInfo = {info}; 32 | return varInfo; 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /demos/taglib/src/main/java/demo/ListMessagesTEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | package demo; 12 | 13 | import jakarta.servlet.jsp.tagext.TagData; 14 | import jakarta.servlet.jsp.tagext.TagExtraInfo; 15 | import jakarta.servlet.jsp.tagext.VariableInfo; 16 | 17 | /** 18 | * Extra information class to support the scripting variable created by the 19 | * ListMessagesTag class. The scope of the variable is limited to the body 20 | * of the tag. 21 | */ 22 | public class ListMessagesTEI extends TagExtraInfo { 23 | 24 | public ListMessagesTEI() { 25 | super(); 26 | } 27 | 28 | public VariableInfo[] getVariableInfo(TagData data) { 29 | VariableInfo info = new VariableInfo(data.getId(), "MessageInfo", 30 | true, VariableInfo.NESTED); 31 | VariableInfo[] varInfo = {info}; 32 | return varInfo; 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /demos/taglib/src/main/java/demo/MessageTEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | package demo; 12 | 13 | import jakarta.servlet.jsp.tagext.TagData; 14 | import jakarta.servlet.jsp.tagext.TagExtraInfo; 15 | import jakarta.servlet.jsp.tagext.VariableInfo; 16 | 17 | /** 18 | * Extra information class to support the scripting variable created by the 19 | * MessagesTag class. The variable exists outside of the tag. 20 | */ 21 | public class MessageTEI extends TagExtraInfo { 22 | 23 | public MessageTEI() { 24 | super(); 25 | } 26 | 27 | public VariableInfo[] getVariableInfo(TagData data) { 28 | VariableInfo info = new VariableInfo(data.getId(), "MessageInfo", 29 | true, VariableInfo.AT_END); 30 | VariableInfo[] varInfo = {info}; 31 | return varInfo; 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /demos/taglib/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module demo { 18 | requires jakarta.servlet; 19 | requires jakarta.mail; 20 | requires org.eclipse.angus.mail.gimap; 21 | requires jakarta.servlet.jsp; 22 | } -------------------------------------------------------------------------------- /demos/taglib/src/test/java/demo/ModulesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package demo; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.util.StreamProvider; 21 | import org.eclipse.angus.mail.util.MailStreamProvider; 22 | import org.junit.Test; 23 | 24 | import java.util.Properties; 25 | 26 | import static org.junit.Assert.assertEquals; 27 | 28 | public class ModulesTest { 29 | 30 | // With org.eclipse.angus:jakarta.mail and org.eclipse.angus:gimap 31 | @Test 32 | public void test() throws Exception { 33 | Session session = Session.getDefaultInstance(new Properties()); 34 | StreamProvider provider = session.getStreamProvider(); 35 | assertEquals(MailStreamProvider.class, provider.getClass()); 36 | Class.forName("org.eclipse.angus.mail.imap.IMAPProvider"); 37 | Class.forName("org.eclipse.angus.mail.pop3.POP3Provider"); 38 | Class.forName("org.eclipse.angus.mail.smtp.SMTPProvider"); 39 | Class.forName("org.eclipse.angus.mail.gimap.GmailProvider"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /demos/webapp/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. 4 | REM 5 | REM This program and the accompanying materials are made available under the 6 | REM terms of the Eclipse Public License v. 2.0, which is available at 7 | REM http://www.eclipse.org/legal/epl-2.0. 8 | REM 9 | REM This Source Code may also be made available under the following Secondary 10 | REM Licenses when the conditions for such availability set forth in the 11 | REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 12 | REM version 2 with the GNU Classpath Exception, which is available at 13 | REM https://www.gnu.org/software/classpath/license.html. 14 | REM 15 | REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 16 | REM 17 | mkdir src\docroot\WEB-INF\classes 18 | mkdir src\docroot\WEB-INF\classes\demo 19 | mkdir src\docroot\WEB-INF\lib 20 | cd src\classes 21 | echo compiling classes directory 22 | javac -d ..\docroot\WEB-INF\classes demo\*.java 23 | cd ..\taglib 24 | echo compiling lib directory 25 | javac -classpath "..\docroot\WEB-INF\classes;%CLASSPATH%" demo\*.java 26 | echo creating tag library archive 27 | jar cvf ..\docroot\WEB-INF\lib\taglib.jar META-INF demo\*.class 28 | del demo\*.class 29 | cd ..\docroot 30 | echo creating web archive 31 | jar cvf ..\..\jakartamail.war index.html *.jsp WEB-INF 32 | cd WEB-INF\classes\demo 33 | del *.* 34 | cd .. 35 | rmdir demo 36 | cd .. 37 | rmdir classes 38 | cd lib 39 | del *.* 40 | cd .. 41 | rmdir lib 42 | cd ..\..\.. 43 | -------------------------------------------------------------------------------- /demos/webapp/build.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Eclipse Distribution License v. 1.0, which is available at 6 | # http://www.eclipse.org/org/documents/edl-v10.php. 7 | # 8 | # SPDX-License-Identifier: BSD-3-Clause 9 | # 10 | 11 | 12 | mkdir src/docroot/WEB-INF/classes 13 | mkdir src/docroot/WEB-INF/lib 14 | cd src/classes 15 | echo "compiling classes directory" 16 | javac -d ../docroot/WEB-INF/classes demo/*.java 17 | cd ../taglib 18 | echo "compiling lib directroy" 19 | javac -classpath ../docroot/WEB-INF/classes:$CLASSPATH demo/*.java 20 | echo "creating tag library archive" 21 | jar cvf ../docroot/WEB-INF/lib/taglib.jar META-INF demo/*.class 22 | rm demo/*.class 23 | cd ../docroot 24 | echo "creating web archive" 25 | jar cvf ../../jakartamail.war index.html *.jsp WEB-INF 26 | rm -r WEB-INF/classes 27 | rm -r WEB-INF/lib 28 | cd ../.. 29 | -------------------------------------------------------------------------------- /demos/webapp/src/main/webapp/errordetails.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 4 | 5 | This program and the accompanying materials are made available under the 6 | terms of the Eclipse Distribution License v. 1.0, which is available at 7 | http://www.eclipse.org/org/documents/edl-v10.php. 8 | 9 | SPDX-License-Identifier: BSD-3-Clause 10 | 11 | --%> 12 | 13 | <%@ page isErrorPage="true" %> 14 | 15 | 16 | Jakarta Mail errordetails 17 | 18 | 19 | <%= session.getValue("details") %> 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /demos/webapp/src/main/webapp/errorpage.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 4 | 5 | This program and the accompanying materials are made available under the 6 | terms of the Eclipse Distribution License v. 1.0, which is available at 7 | http://www.eclipse.org/org/documents/edl-v10.php. 8 | 9 | SPDX-License-Identifier: BSD-3-Clause 10 | 11 | --%> 12 | 13 | <%@ page isErrorPage="true" %> 14 | 15 | 16 | Jakarta Mail errorpage 17 | 18 | 19 |

20 | <% session.putValue("details", exception.toString()); %> 21 |

An error occured while attempting to perform the operation you requested. 22 |

23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /demos/webapp/src/main/webapp/folders.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 4 | 5 | This program and the accompanying materials are made available under the 6 | terms of the Eclipse Distribution License v. 1.0, which is available at 7 | http://www.eclipse.org/org/documents/edl-v10.php. 8 | 9 | SPDX-License-Identifier: BSD-3-Clause 10 | 11 | --%> 12 | 13 | <%@ page language="java" import="jakarta.mail.*, demo.MailUserBean" %> 14 | <%@ page errorPage="errorpage.jsp" %> 15 | 16 | 17 | 18 | 19 | Jakarta Mail folders 20 | 21 | 22 | 23 | 24 |
25 | 26 | Welcome to Jakarta Mail!
27 | 28 | 29 | 32 |
33 | 36 |
37 | 38 | 39 | 41 |
42 | 45 |
30 | 31 | FolderName 34 | 35 | Messages
40 | Inbox 43 | <%= mailuser.getMessageCount() %> 44 |
46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /demos/webapp/src/main/webapp/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 4 | 5 | This program and the accompanying materials are made available under the 6 | terms of the Eclipse Distribution License v. 1.0, which is available at 7 | http://www.eclipse.org/org/documents/edl-v10.php. 8 | 9 | SPDX-License-Identifier: BSD-3-Clause 10 | 11 | --%> 12 | 13 | <%@ page language="java" import="demo.MailUserBean" %> 14 | <%@ page errorPage="errorpage.jsp" %> 15 | 16 | 17 | 18 | 19 | Jakarta Mail login 20 | 21 | 22 | 23 | 24 | <% 25 | mailuser.login(request.getParameter("hostname"), 26 | request.getParameter("username"), 27 | request.getParameter("password")); 28 | session.setAttribute("folder", mailuser.getFolder()); 29 | %> 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /demos/webapp/src/main/webapp/logout.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 4 | 5 | This program and the accompanying materials are made available under the 6 | terms of the Eclipse Distribution License v. 1.0, which is available at 7 | http://www.eclipse.org/org/documents/edl-v10.php. 8 | 9 | SPDX-License-Identifier: BSD-3-Clause 10 | 11 | --%> 12 | 13 | <%@ page language="java" import="demo.MailUserBean" %> 14 | <%@ page errorPage="errorpage.jsp" %> 15 | 16 | 17 | 18 | 19 | Jakarta Mail logout 20 | 21 | 22 | <% mailuser.logout(); %> 23 | 24 | 25 |

Logged out OK

click here to login 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /demos/webapp/src/main/webapp/send.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001, 2023 Oracle and/or its affiliates. All rights reserved. 4 | 5 | This program and the accompanying materials are made available under the 6 | terms of the Eclipse Distribution License v. 1.0, which is available at 7 | http://www.eclipse.org/org/documents/edl-v10.php. 8 | 9 | SPDX-License-Identifier: BSD-3-Clause 10 | 11 | --%> 12 | 13 | <%@ page language="java" %> 14 | <%@ page errorPage="errorpage.jsp" %> 15 | <%@ taglib uri="https://github.com/eclipse-ee4j/jakartamail/tree/master/webapp" 16 | prefix="jakartamail" %> 17 | 18 | 19 | 20 | Jakarta Mail send 21 | 22 | 23 | 24 | " 26 | sender="<%= request.getParameter(\"from\") %>" 27 | subject="<%= request.getParameter(\"subject\") %>" 28 | > 29 | <%= request.getParameter("text") %> 30 | 31 | 32 |

Message sent successfully

33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /doc/src/main/resources/docs/NTLMNOTES.txt: -------------------------------------------------------------------------------- 1 | Notes for use of NTLM authentication support with Jakarta Mail 2 | -------------------------------------------------------------- 3 | 4 | Thanks to the efforts of Luis Serralheiro, Jakarta Mail now suports the use 5 | of Microsoft's proprietary NTLM authentication mechanism. This support 6 | within Jakarta Mail is now derived from the NTLM support in the JDK and 7 | included directly in Jakarta Mail, with no external dependencies. 8 | 9 | This release of Jakarta Mail was tested with Microsoft Exchange 2010, 2013, 10 | and 2016. 11 | 12 | The SMTP and IMAP providers support the use of NTLM authentication. 13 | The following properties can be used to configure the NTLM support: 14 | 15 | mail..auth.ntlm.domain 16 | The NTLM authentication domain. 17 | 18 | mail..auth.ntlm.flags 19 | NTLM protocol-specific flags. (not currently used) 20 | See http://curl.haxx.se/rfc/ntlm.html#theNtlmFlags for details. 21 | 22 | mail..auth.ntlm.v2 23 | If set to true, use the NTLMv2 protocol. Defaults to true. 24 | Must be set to false explicitly to disable use of NTLMv2. 25 | 26 | 27 | NOTE: This capability is very new and has NOT been thoroughly tested. 28 | Please send any feedback or bug reports to us at mail-dev@eclipse.org. 29 | 30 | WARNING: This support, and the APIs and properties used to control it, 31 | should be considered EXPERIMENTAL. They may be changed in the future 32 | in ways that are incompatible with applications using the current APIs 33 | and properties. 34 | -------------------------------------------------------------------------------- /doc/src/main/resources/docs/Tomcat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 | 24 | Tomcat 25 | 26 | 27 | Tomcat is a complete web server written in Java that provides 28 | support for the Servlet and JSP specifications. 29 | Tomcat is developed as a part of the Apache 30 | Jakarta Project. 31 | Both binaries and source are available from the Jakarta web site. 32 |

33 | To run the JakartaMailServlet, you must add the Jakarta Mail and JavaBeans 34 | Activation Framework jar files to the lib directory 35 | under the directory in which you installed Tomcat. This will 36 | cause Tomcat to include these jar files in its classpath automatically. 37 | (Some packages of Tomcat version 4 include Jakarta Mail support.) 38 | Depending on the version of Tomcat used, the mail.jar 39 | and activation.jar files should be copied to the 40 | lib directory or to an appropriate subdirectory of the 41 | lib directory. 42 | 43 | 44 | -------------------------------------------------------------------------------- /doc/src/main/resources/docs/images/direct-classpath.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/angus-mail/c0d9b5d7a1acb173d7f28221822372d85bab777c/doc/src/main/resources/docs/images/direct-classpath.jpg -------------------------------------------------------------------------------- /doc/src/main/resources/docs/images/indirect-classpath.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/angus-mail/c0d9b5d7a1acb173d7f28221822372d85bab777c/doc/src/main/resources/docs/images/indirect-classpath.jpg -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Eclipse Public License v. 2.0, which is available at 6 | # http://www.eclipse.org/legal/epl-2.0. 7 | # 8 | # This Source Code may also be made available under the following Secondary 9 | # Licenses when the conditions for such availability set forth in the 10 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | # version 2 with the GNU Classpath Exception, which is available at 12 | # https://www.gnu.org/software/classpath/license.html. 13 | # 14 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | 16 | FROM jakartaee/cts-javamail-base:0.1 17 | 18 | WORKDIR /root 19 | RUN wget 'https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz' -O openjdk-11.tar.gz -q 20 | RUN tar -xzf openjdk-11.tar.gz 21 | 22 | ENV JAVA_HOME '/root/jdk-11' 23 | 24 | ENTRYPOINT cat -------------------------------------------------------------------------------- /docker/JTReportParser/JTReportParser.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/angus-mail/c0d9b5d7a1acb173d7f28221822372d85bab777c/docker/JTReportParser/JTReportParser.jar -------------------------------------------------------------------------------- /docker/JTReportParser/lib/commons-lang3-3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/angus-mail/c0d9b5d7a1acb173d7f28221822372d85bab777c/docker/JTReportParser/lib/commons-lang3-3.5.jar -------------------------------------------------------------------------------- /docker/JTReportParser/lib/jsoup-1.10.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/angus-mail/c0d9b5d7a1acb173d7f28221822372d85bab777c/docker/JTReportParser/lib/jsoup-1.10.2.jar -------------------------------------------------------------------------------- /docker/build_jakartamail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -xe 2 | # 3 | # Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Eclipse Public License v. 2.0, which is available at 7 | # http://www.eclipse.org/legal/epl-2.0. 8 | # 9 | # This Source Code may also be made available under the following Secondary 10 | # Licenses when the conditions for such availability set forth in the 11 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 12 | # version 2 with the GNU Classpath Exception, which is available at 13 | # https://www.gnu.org/software/classpath/license.html. 14 | # 15 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 16 | 17 | # Build 18 | mvn -B -V -Pstaging clean install 19 | -------------------------------------------------------------------------------- /dsn/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail.dsn { 18 | 19 | requires static org.eclipse.angus.mail; 20 | requires static jakarta.mail; 21 | 22 | exports org.eclipse.angus.mail.dsn; 23 | } 24 | -------------------------------------------------------------------------------- /dsn/src/main/java/org/eclipse/angus/mail/dsn/Report.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.dsn; 18 | 19 | /** 20 | * An abstract report type, to be included in a MultipartReport. 21 | * Subclasses define specific report types, such as {@link DeliveryStatus} 22 | * and {@link DispositionNotification}. 23 | * 24 | * @since JavaMail 1.4.2 25 | */ 26 | public abstract class Report { 27 | protected String type; // the MIME subtype of the report 28 | 29 | /** 30 | * Construct a report of the indicated MIME subtype. 31 | * The primary MIME type is always "message". 32 | * 33 | * @param type the MIME subtype 34 | */ 35 | protected Report(String type) { 36 | this.type = type; 37 | } 38 | 39 | /** 40 | * Get the MIME subtype of the report. 41 | * The primary MIME type is always "message". 42 | * 43 | * @return the MIME subtype 44 | */ 45 | public String getType() { 46 | return type; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /dsn/src/main/resources/META-INF/mailcap: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Jakarta Mail content-handlers: 4 | # 5 | multipart/report;; x-java-content-handler=org.eclipse.angus.mail.dsn.multipart_report 6 | message/delivery-status;; x-java-content-handler=org.eclipse.angus.mail.dsn.message_deliverystatus 7 | message/disposition-notification;; x-java-content-handler=org.eclipse.angus.mail.dsn.message_dispositionnotification 8 | text/rfc822-headers;; x-java-content-handler=org.eclipse.angus.mail.dsn.text_rfc822headers 9 | -------------------------------------------------------------------------------- /dsn/src/test/java/example/app/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package example.app; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * An OutputStream that throws away all data written to it. 24 | */ 25 | public class NullOutputStream extends OutputStream { 26 | 27 | public void write(int b) throws IOException { 28 | } 29 | 30 | public void write(byte[] b) throws IOException { 31 | } 32 | 33 | public void write(byte[] b, int off, int len) throws IOException { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /dsn/src/test/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module example.app { 18 | requires org.eclipse.angus.mail.dsn; 19 | requires org.eclipse.angus.mail; 20 | requires junit; 21 | exports example.app; 22 | } 23 | -------------------------------------------------------------------------------- /mailhandler/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail.util.logging { 18 | 19 | requires transitive org.eclipse.angus.mail; 20 | 21 | exports org.eclipse.angus.mail.util.logging; 22 | } 23 | -------------------------------------------------------------------------------- /mailhandler/src/main/java/org/eclipse/angus/mail/util/logging/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | /** 18 | * Contains Angus Mail extensions for the Java™ platform's core logging 19 | * facilities. This package contains classes used to export log messages 20 | * as a formatted email message. Classes in this package typically use LogManager 21 | * properties to set default values; see the specific documentation for each concrete class. 22 | */ 23 | package org.eclipse.angus.mail.util.logging; 24 | -------------------------------------------------------------------------------- /mailhandler/src/main/resources/META-INF/hk2-locator/default: -------------------------------------------------------------------------------- 1 | # 2 | # This metadata allows org.eclipse.angus.mail.util.logging.MailHandler to be 3 | # configured in the logging.properties file and used in GlassFish. 4 | # This file was created by hand to avoid a compile time dependency 5 | # on the HK2 annotations. 6 | # 7 | [org.eclipse.angus.mail.util.logging.MailHandler] 8 | contract={java.util.logging.Handler} 9 | scope=jakarta.inject.Singleton 10 | -------------------------------------------------------------------------------- /mailhandler/src/main/resources/META-INF/native-image/org.eclipse.angus/logging-mailhandler/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": { 3 | "includes": [ 4 | { 5 | "pattern": "\\QMETA-INF/hk2-locator/default\\E" 6 | } 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /providers/angus-mail/src/main/resources/META-INF/javamail.default.providers: -------------------------------------------------------------------------------- 1 | # Jakarta Mail IMAP provider Oracle 2 | protocol=imap; type=store; class=org.eclipse.angus.mail.imap.IMAPStore; vendor=Oracle; 3 | protocol=imaps; type=store; class=org.eclipse.angus.mail.imap.IMAPSSLStore; vendor=Oracle; 4 | # Jakarta Mail SMTP provider Oracle 5 | protocol=smtp; type=transport; class=org.eclipse.angus.mail.smtp.SMTPTransport; vendor=Oracle; 6 | protocol=smtps; type=transport; class=org.eclipse.angus.mail.smtp.SMTPSSLTransport; vendor=Oracle; 7 | # Jakarta Mail POP3 provider Oracle 8 | protocol=pop3; type=store; class=org.eclipse.angus.mail.pop3.POP3Store; vendor=Oracle; 9 | protocol=pop3s; type=store; class=org.eclipse.angus.mail.pop3.POP3SSLStore; vendor=Oracle; 10 | -------------------------------------------------------------------------------- /providers/angus-mail/src/main/resources/META-INF/services/jakarta.mail.Provider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.imap.IMAPProvider 2 | org.eclipse.angus.mail.imap.IMAPSSLProvider 3 | org.eclipse.angus.mail.smtp.SMTPProvider 4 | org.eclipse.angus.mail.smtp.SMTPSSLProvider 5 | org.eclipse.angus.mail.pop3.POP3Provider 6 | org.eclipse.angus.mail.pop3.POP3SSLProvider 7 | -------------------------------------------------------------------------------- /providers/angus-mail/src/oldtest/java/jakarta/mail/internet/decodetest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Eclipse Public License v. 2.0, which is available at 7 | # http://www.eclipse.org/legal/epl-2.0. 8 | # 9 | # This Source Code may also be made available under the following Secondary 10 | # Licenses when the conditions for such availability set forth in the 11 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 12 | # version 2 with the GNU Classpath Exception, which is available at 13 | # https://www.gnu.org/software/classpath/license.html. 14 | # 15 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 16 | # 17 | 18 | java decodetext < encodedheaders.data > x1 19 | java -Dmail.mime.decodetext.strict=false decodetext < encodedheaders.data > x2 20 | diff -c x1 x2 21 | -------------------------------------------------------------------------------- /providers/angus-mail/src/oldtest/java/jakarta/mail/internet/encodedheaders.data: -------------------------------------------------------------------------------- 1 | =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= 2 | =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?= Congrats! 3 | Hello World 4 | Hello 5 | World 6 | =?ISO-8859-1?Q?Andr=E9?= Pirard 7 | =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= 8 | =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= 9 | =?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?= 10 | =?ISO-2022-JP?B?GyRCQmdCPCEhWEYwbE86GyhK?= 11 | [mizuki 1007] Re: Hajimemasite!! 12 | Kazuyuki Murata 13 | [mizuki 1009] =?ISO-2022-JP?B?GyRCJUYlbCVTPVAxaT5wSnMbKEI=?= 14 | =?ISO-8859-1?Q?a?= 15 | =?ISO-8859-1?Q?a?= b 16 | =?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?= 17 | =?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?= 18 | =?ISO-8859-1?Q?a_b?= 19 | =?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?= 20 | =?US-ASCII?Q?Keith_Moore?= 21 | =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= 22 | =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?= 23 | =?ISO-8859-1?Q?Olle_J=E4rnefors?= 24 | 25 | babababa=?ISO-2022-JP?B?GyRCMj0kMSRrGyhK?= 26 | babababa=?ISO-2022-JP?B?GyRCMj0kMSRrGyhK?=babababa 27 | bababa =?ISO-2022-JP?B?IBskQjI9JDEkaxsoSg==?= 28 | =?ISO-8859-1?Q?a?==?ISO-8859-1?Q?b?= 29 | -------------------------------------------------------------------------------- /providers/angus-mail/src/oldtest/java/jakarta/mail/internet/socketfactory/DummySocketFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | import java.io.IOException; 12 | import java.net.InetAddress; 13 | import java.net.Socket; 14 | 15 | import javax.net.SocketFactory; 16 | 17 | 18 | /** 19 | * DummySocketFactory 20 | */ 21 | public class DummySocketFactory extends SocketFactory { 22 | private SocketFactory factory; 23 | 24 | public DummySocketFactory() { 25 | factory = SocketFactory.getDefault(); 26 | } 27 | 28 | public static SocketFactory getDefault() { 29 | return new DummySocketFactory(); 30 | } 31 | 32 | public Socket createSocket() throws IOException { 33 | TestResult.success(); 34 | return factory.createSocket(); 35 | } 36 | 37 | public Socket createSocket(InetAddress inaddr, int i, 38 | InetAddress inaddr1, int j) throws IOException { 39 | TestResult.success(); 40 | return factory.createSocket(inaddr, i, inaddr1, j); 41 | } 42 | 43 | public Socket createSocket(InetAddress inaddr, int i) 44 | throws IOException { 45 | TestResult.success(); 46 | return factory.createSocket(inaddr, i); 47 | } 48 | 49 | public Socket createSocket(String s, int i, InetAddress inaddr, int j) 50 | throws IOException { 51 | TestResult.success(); 52 | return factory.createSocket(s, i, inaddr, j); 53 | } 54 | 55 | public Socket createSocket(String s, int i) throws IOException { 56 | TestResult.success(); 57 | return factory.createSocket(s, i); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /providers/angus-mail/src/oldtest/java/jakarta/mail/internet/socketfactory/DummyTrustManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | import javax.net.ssl.X509TrustManager; 12 | import java.security.cert.X509Certificate; 13 | 14 | 15 | /** 16 | * DummyTrustManager 17 | */ 18 | public class DummyTrustManager implements X509TrustManager { 19 | 20 | public void checkClientTrusted(X509Certificate[] cert, String authType) { 21 | // everything is trusted 22 | } 23 | 24 | public void checkServerTrusted(X509Certificate[] cert, String authType) { 25 | // everything is trusted 26 | } 27 | 28 | public X509Certificate[] getAcceptedIssuers() { 29 | return new X509Certificate[0]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/angus-mail/src/oldtest/java/jakarta/mail/internet/socketfactory/TestResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Distribution License v. 1.0, which is available at 6 | * http://www.eclipse.org/org/documents/edl-v10.php. 7 | * 8 | * SPDX-License-Identifier: BSD-3-Clause 9 | */ 10 | 11 | public class TestResult { 12 | private static boolean pass = false; 13 | 14 | private TestResult() { 15 | } // no public constructor 16 | 17 | public static void reset() { 18 | pass = false; 19 | } 20 | 21 | public static void success() { 22 | pass = true; 23 | } 24 | 25 | public static void print(String s) { 26 | System.out.println((pass ? "SUCCESS: " : "FAIL: ") + s); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/iap/ResponseInputStreamTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | import org.junit.Test; 20 | 21 | import java.io.ByteArrayInputStream; 22 | import java.io.IOException; 23 | import java.nio.charset.StandardCharsets; 24 | 25 | import static org.junit.Assert.fail; 26 | 27 | /** 28 | * Test ResponseInputStream. 29 | */ 30 | public class ResponseInputStreamTest { 31 | 32 | /** 33 | * Test that an EOF while reading a literal throws an IOException. 34 | */ 35 | @Test 36 | public void testEofWhileReadingLiteral() throws Exception { 37 | ByteArrayInputStream bis = new ByteArrayInputStream( 38 | "test{1}\r\n".getBytes(StandardCharsets.ISO_8859_1)); 39 | ResponseInputStream ris = new ResponseInputStream(bis); 40 | try { 41 | ris.readResponse(); 42 | } catch (IOException ex) { 43 | // success! 44 | return; 45 | } 46 | fail("no exception"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/imap/protocol/MODSEQTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import org.junit.Test; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | 23 | /** 24 | * Test the MODSEQ class. 25 | */ 26 | public class MODSEQTest { 27 | /** 28 | * Test an example MODSEQ response. 29 | */ 30 | @Test 31 | public void testAll() throws Exception { 32 | IMAPResponse response = new IMAPResponse( 33 | "* 1 FETCH (MODSEQ (624140003))"); 34 | FetchResponse fr = new FetchResponse(response); 35 | MODSEQ m = fr.getItem(MODSEQ.class); 36 | assertEquals(1, m.seqnum); 37 | assertEquals(624140003, m.modseq); 38 | } 39 | 40 | /** 41 | * Test an example MODSEQ response with unnecessary spaces. 42 | */ 43 | @Test 44 | public void testSpaces() throws Exception { 45 | IMAPResponse response = new IMAPResponse( 46 | "* 1 FETCH ( MODSEQ ( 624140003 ) )"); 47 | FetchResponse fr = new FetchResponse(response); 48 | MODSEQ m = fr.getItem(MODSEQ.class); 49 | assertEquals(1, m.seqnum); 50 | assertEquals(624140003, m.modseq); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/stream/LineInputStreamUtf8FailTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.stream; 18 | 19 | import org.eclipse.angus.mail.util.LineInputStream; 20 | import org.junit.BeforeClass; 21 | import org.junit.Test; 22 | 23 | import java.io.ByteArrayInputStream; 24 | import java.io.IOException; 25 | import java.nio.charset.StandardCharsets; 26 | 27 | import static org.junit.Assert.assertEquals; 28 | 29 | /** 30 | * Test that the "mail.mime.allowutf8" System property 31 | * not set doesn't allow UTF-8 data to be read. 32 | */ 33 | public class LineInputStreamUtf8FailTest { 34 | 35 | @BeforeClass 36 | public static void before() { 37 | System.out.println("LineInputStreamUtf8Fail"); 38 | System.clearProperty("mail.mime.allowutf8"); 39 | } 40 | 41 | @Test 42 | public void testUtf8() throws Exception { 43 | LineInputStream is = new LineInputStream(new ByteArrayInputStream( 44 | "a\u00A9b\n".getBytes(StandardCharsets.UTF_8)), false); 45 | assertEquals("a\302\251b", is.readLine()); 46 | } 47 | 48 | @Test 49 | public void testIso() throws IOException { 50 | LineInputStream is = new LineInputStream(new ByteArrayInputStream( 51 | "a\251b\n".getBytes(StandardCharsets.ISO_8859_1)), false); 52 | assertEquals("a\251b", is.readLine()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/test/AsciiStringInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.test; 18 | 19 | import java.io.InputStream; 20 | 21 | /** 22 | * Replacement for deprecated java.io.StringBufferInputStream 23 | */ 24 | public class AsciiStringInputStream extends InputStream { 25 | 26 | private final String input; 27 | private int position; 28 | 29 | public AsciiStringInputStream(String input) { 30 | this(input, true); 31 | } 32 | 33 | public AsciiStringInputStream(String input, boolean strict) { 34 | if (strict) { 35 | for (int i = 0; i < input.length(); i++) { 36 | if (input.charAt(i) > 0x7F) { 37 | throw new IllegalArgumentException("Not an ASCII string"); 38 | } 39 | } 40 | } 41 | 42 | this.input = input; 43 | } 44 | 45 | @Override 46 | public int read() { 47 | if (position < input.length()) { 48 | return input.charAt(position++) & 0xFF; 49 | } else { 50 | return -1; 51 | } 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/test/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.test; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * An OutputStream that throws away all data written to it. 24 | */ 25 | public class NullOutputStream extends OutputStream { 26 | 27 | @Override 28 | public void write(int b) throws IOException { 29 | } 30 | 31 | @Override 32 | public void write(byte[] b) throws IOException { 33 | } 34 | 35 | @Override 36 | public void write(byte[] b, int off, int len) throws IOException { 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/test/SessionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.test; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.imap.IMAPProvider; 21 | import org.junit.Test; 22 | 23 | import java.lang.annotation.Annotation; 24 | 25 | import static org.junit.Assert.assertFalse; 26 | import static org.junit.Assert.assertTrue; 27 | 28 | public class SessionTest { 29 | 30 | private static final String DEFAULT_PROVIDER = "org.eclipse.angus.mail.util.DefaultProvider"; 31 | 32 | @Test 33 | public void defaultProvider() { 34 | assertTrue(containsDefaultProvider(new IMAPProvider())); 35 | assertFalse(containsDefaultProvider(new Provider(Provider.Type.STORE, "imap", Object.class.getName(), "Oracle", null) { 36 | })); 37 | } 38 | 39 | private boolean containsDefaultProvider(Provider provider) { 40 | Annotation[] annotations = provider.getClass().getDeclaredAnnotations(); 41 | for (Annotation annotation : annotations) { 42 | if (DEFAULT_PROVIDER.equals(annotation.annotationType().getName())) { 43 | return true; 44 | } 45 | } 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/util/DecodeParametersTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import org.junit.AfterClass; 20 | import org.junit.BeforeClass; 21 | import org.junit.Test; 22 | 23 | /** 24 | * Test that the "mail.mime.decodeparameters" System property 25 | * causes the parameters to be properly decoded. 26 | */ 27 | public class DecodeParametersTest extends ParameterListDecode { 28 | 29 | @BeforeClass 30 | public static void before() { 31 | System.out.println("DecodeParameters"); 32 | System.setProperty("mail.mime.decodeparameters", "true"); 33 | } 34 | 35 | @Test 36 | public void testDecode() throws Exception { 37 | testDecode("paramdata"); 38 | } 39 | 40 | @AfterClass 41 | public static void after() { 42 | // should be unnecessary 43 | System.clearProperty("mail.mime.decodeparameters"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/util/EncodeFileNameNoEncodeParametersTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import org.junit.BeforeClass; 20 | 21 | /** 22 | * Test "mail.mime.encodefilename" System property set to "true" 23 | * and "mail.mime.encodeparameters" set to "false". 24 | */ 25 | public class EncodeFileNameNoEncodeParametersTest extends EncodeFileNameTest { 26 | 27 | @BeforeClass 28 | public static void before() { 29 | System.out.println("EncodeFileNameNoEncodeParameters"); 30 | System.setProperty("mail.mime.charset", "utf-8"); 31 | System.setProperty("mail.mime.encodefilename", "true"); 32 | System.setProperty("mail.mime.encodeparameters", "false"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/util/NoEncodeFileNameNoEncodeParametersTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import org.junit.BeforeClass; 20 | import org.junit.Test; 21 | 22 | import static org.junit.Assert.assertTrue; 23 | 24 | /** 25 | * Test "mail.mime.encodefilename" System property not set and 26 | * "mail.mime.encodeparameters" set to "false". 27 | */ 28 | public class NoEncodeFileNameNoEncodeParametersTest extends NoEncodeFileNameTest { 29 | 30 | @BeforeClass 31 | public static void before() { 32 | System.out.println("NoEncodeFileNameNoEncodeParameters"); 33 | System.setProperty("mail.mime.charset", "utf-8"); 34 | System.setProperty("mail.mime.encodeparameters", "false"); 35 | // assume mail.mime.encodefilename defaults to false 36 | System.clearProperty("mail.mime.encodefilename"); 37 | } 38 | 39 | @Test 40 | public void test() throws Exception { 41 | MimeBodyPartPublicUpdateHeaders mbp = new MimeBodyPartPublicUpdateHeaders(); 42 | mbp.setText("test"); 43 | mbp.setFileName(fileName); 44 | mbp.updateHeaders(); 45 | String h = mbp.getHeader("Content-Type", ""); 46 | assertTrue(h.contains("name=")); 47 | assertTrue(h.contains(fileName)); 48 | h = mbp.getHeader("Content-Disposition", ""); 49 | assertTrue(h.contains("filename=")); 50 | assertTrue(h.contains(fileName)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/util/ParametersNoStrictTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import org.junit.AfterClass; 20 | import org.junit.BeforeClass; 21 | import org.junit.Test; 22 | 23 | /** 24 | * Test that the "mail.mime.parameters.strict" System property 25 | * set to false allows bogus parameters to be parsed. 26 | */ 27 | public class ParametersNoStrictTest extends ParameterListDecode { 28 | 29 | @BeforeClass 30 | public static void before() { 31 | System.out.println("ParametersNoStrict"); 32 | System.setProperty("mail.mime.parameters.strict", "false"); 33 | } 34 | 35 | @Test 36 | public void testDecode() throws Exception { 37 | testDecode("paramdatanostrict"); 38 | } 39 | 40 | @AfterClass 41 | public static void after() { 42 | // should be unnecessary 43 | System.clearProperty("mail.mime.parameters.strict"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/java/org/eclipse/angus/mail/util/QPEncoderStreamTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.util; 18 | 19 | import org.junit.Test; 20 | 21 | import java.io.ByteArrayOutputStream; 22 | import java.nio.charset.StandardCharsets; 23 | 24 | import static org.junit.Assert.assertEquals; 25 | 26 | /** 27 | * Test quoted-printable encoder. 28 | * 29 | * @author Bill Shannon 30 | */ 31 | 32 | public class QPEncoderStreamTest { 33 | /** 34 | * Test that a trailing space is encoded in the output stream. 35 | */ 36 | @Test 37 | public void testTrailingSpace() throws Exception { 38 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 39 | QPEncoderStream qs = new QPEncoderStream(bos); 40 | qs.write("test ".getBytes(StandardCharsets.US_ASCII)); 41 | qs.flush(); 42 | String result = new String(bos.toByteArray(), StandardCharsets.US_ASCII); 43 | assertEquals("test=20", result); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/resources/org/eclipse/angus/mail/imap/protocol/uiddata: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Eclipse Public License v. 2.0, which is available at 6 | # http://www.eclipse.org/legal/epl-2.0. 7 | # 8 | # This Source Code may also be made available under the following Secondary 9 | # Licenses when the conditions for such availability set forth in the 10 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | # version 2 with the GNU Classpath Exception, which is available at 12 | # https://www.gnu.org/software/classpath/license.html. 13 | # 14 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | # 16 | 17 | 18 | # 19 | # Data to test UIDSet. 20 | # 21 | 22 | TEST one UID 23 | DATA 1 24 | EXPECT 1 25 | 26 | TEST two UIDs 27 | DATA 1,3 28 | EXPECT 1 3 29 | 30 | TEST UID range 31 | DATA 1:2 32 | EXPECT 1 2 33 | 34 | TEST bigger UID range 35 | DATA 1:3 36 | EXPECT 1 2 3 37 | 38 | TEST two ranges 39 | DATA 1:3,5:7 40 | EXPECT 1 2 3 5 6 7 41 | 42 | TEST ranges and singles 43 | DATA 1:3,5,7:9 44 | EXPECT 1 2 3 5 7 8 9 45 | 46 | TEST many singles 47 | DATA 1,3,5,7,9 48 | EXPECT 1 3 5 7 9 49 | 50 | TEST max 51 | DATA 1 52 | MAX 1 53 | EXPECT 1 54 | 55 | TEST max2 56 | DATA 2 57 | MAX 2 58 | EXPECT 2 59 | 60 | TEST max3 61 | DATA 1:2 62 | MAX 2 63 | EXPECT 1 2 64 | 65 | TEST max4 66 | DATA 1:2 67 | MAX 1 1 68 | EXPECT 1 69 | 70 | TEST max5 71 | DATA 1:4 72 | MAX 3 1:3 73 | EXPECT 1 2 3 74 | 75 | TEST empty 76 | DATA EMPTY 77 | EXPECT EMPTY 78 | -------------------------------------------------------------------------------- /providers/angus-mail/src/test/resources/org/eclipse/angus/mail/test/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/angus-mail/c0d9b5d7a1acb173d7f28221822372d85bab777c/providers/angus-mail/src/test/resources/org/eclipse/angus/mail/test/keystore.jks -------------------------------------------------------------------------------- /providers/gimap/exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /providers/gimap/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail.gimap { 18 | 19 | requires static org.eclipse.angus.mail; 20 | requires static jakarta.mail; 21 | 22 | exports org.eclipse.angus.mail.gimap; 23 | exports org.eclipse.angus.mail.gimap.protocol; 24 | 25 | provides jakarta.mail.Provider with 26 | org.eclipse.angus.mail.gimap.GmailProvider, 27 | org.eclipse.angus.mail.gimap.GmailSSLProvider; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /providers/gimap/src/main/java/org/eclipse/angus/mail/gimap/GmailProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.gimap; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The Gmail IMAP protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class GmailProvider extends Provider { 27 | public GmailProvider() { 28 | super(Provider.Type.STORE, "gimap", GmailStore.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/gimap/src/main/java/org/eclipse/angus/mail/gimap/GmailRawSearchTerm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.gimap; 18 | 19 | import jakarta.mail.Message; 20 | import jakarta.mail.search.StringTerm; 21 | 22 | /** 23 | * This class implements searching using the Gmail X-GM-RAW extension. 24 | * 25 | * @author Bill Shannon 26 | * @since JavaMail 1.4.6 27 | */ 28 | 29 | public final class GmailRawSearchTerm extends StringTerm { 30 | 31 | private static final long serialVersionUID = 6284730140424242662L; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param pattern the pattern to search for 37 | */ 38 | public GmailRawSearchTerm(String pattern) { 39 | // Note: comparison is case-insensitive 40 | super(pattern); 41 | } 42 | 43 | /** 44 | * The match method. 45 | * 46 | * @param msg the pattern match is applied to this Message's 47 | * subject header 48 | * @exception RuntimeException this can't be supported locally 49 | */ 50 | public boolean match(Message msg) { 51 | throw new RuntimeException("GmailRawSearchTerm not supported locally"); 52 | } 53 | 54 | /** 55 | * Equality comparison. 56 | */ 57 | public boolean equals(Object obj) { 58 | if (!(obj instanceof GmailRawSearchTerm)) 59 | return false; 60 | return super.equals(obj); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /providers/gimap/src/main/java/org/eclipse/angus/mail/gimap/GmailSSLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.gimap; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The Gmail IMAP protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class GmailSSLProvider extends Provider { 27 | public GmailSSLProvider() { 28 | super(Provider.Type.STORE, "gimaps", GmailSSLStore.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/gimap/src/main/java/org/eclipse/angus/mail/gimap/GmailSSLStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.gimap; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.URLName; 21 | 22 | /** 23 | * Support "gimaps" protocol name. 24 | * Unnecessary, since Gmail always uses SSL, but someone might 25 | * expect this name to work. 26 | * 27 | * @author Bill Shannon 28 | * @since JavaMail 1.4.6 29 | */ 30 | 31 | public class GmailSSLStore extends GmailStore { 32 | /** 33 | * Constructor that takes a Session object and a URLName that 34 | * represents a specific IMAP server. 35 | * 36 | * @param session the Session 37 | * @param url the URLName of this store 38 | */ 39 | public GmailSSLStore(Session session, URLName url) { 40 | super(session, url, "gimaps", true); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /providers/gimap/src/main/java/org/eclipse/angus/mail/gimap/LongTerm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.gimap; 18 | 19 | import jakarta.mail.search.SearchTerm; 20 | 21 | /** 22 | * This class implements a long integer search term. 23 | * 24 | * @author Bill Shannon 25 | * @since JavaMail 1.4.6 26 | */ 27 | 28 | abstract class LongTerm extends SearchTerm { 29 | /** 30 | * The number. 31 | * 32 | * @serial 33 | */ 34 | protected long number; 35 | 36 | private static final long serialVersionUID = 5285147193246128043L; 37 | 38 | protected LongTerm(long number) { 39 | this.number = number; 40 | } 41 | 42 | /** 43 | * Return the number to compare with. 44 | * 45 | * @return the number 46 | */ 47 | public long getNumber() { 48 | return number; 49 | } 50 | 51 | protected boolean match(long i) { 52 | return i == number; 53 | } 54 | 55 | /** 56 | * Equality comparison. 57 | */ 58 | public boolean equals(Object obj) { 59 | if (!(obj instanceof LongTerm)) 60 | return false; 61 | LongTerm t = (LongTerm) obj; 62 | return t.number == this.number && super.equals(obj); 63 | } 64 | 65 | /** 66 | * Compute a hashCode for this object. 67 | */ 68 | public int hashCode() { 69 | return (int) number + super.hashCode(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /providers/gimap/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | protocol=gimap; type=store; class=org.eclipse.angus.mail.gimap.GmailStore; vendor=Oracle; 2 | protocol=gimaps; type=store; class=org.eclipse.angus.mail.gimap.GmailSSLStore; vendor=Oracle; 3 | -------------------------------------------------------------------------------- /providers/gimap/src/main/resources/META-INF/services/jakarta.mail.Provider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.gimap.GmailProvider 2 | org.eclipse.angus.mail.gimap.GmailSSLProvider 3 | -------------------------------------------------------------------------------- /providers/gimap/src/test/java/example/app/ModulesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package example.app; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.util.StreamProvider; 21 | import org.eclipse.angus.mail.util.MailStreamProvider; 22 | import org.junit.Test; 23 | 24 | import java.util.Properties; 25 | 26 | import static org.junit.Assert.assertEquals; 27 | 28 | public class ModulesTest { 29 | 30 | // With org.eclipse.angus:angus-mail and org.eclipse.angus:gimap 31 | @Test 32 | public void test() throws Exception { 33 | Session session = Session.getDefaultInstance(new Properties()); 34 | StreamProvider provider = session.getStreamProvider(); 35 | assertEquals(MailStreamProvider.class, provider.getClass()); 36 | Class.forName("org.eclipse.angus.mail.imap.IMAPProvider"); 37 | Class.forName("org.eclipse.angus.mail.pop3.POP3Provider"); 38 | Class.forName("org.eclipse.angus.mail.smtp.SMTPProvider"); 39 | Class.forName("org.eclipse.angus.mail.gimap.GmailProvider"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /providers/gimap/src/test/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module example.app { 18 | requires org.eclipse.angus.mail.gimap; 19 | requires org.eclipse.angus.mail; 20 | requires junit; 21 | exports example.app; 22 | } 23 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail.imap { 18 | 19 | requires static java.security.sasl; // for OAuth2 support 20 | requires transitive jakarta.mail; 21 | requires transitive org.eclipse.angus.mail; 22 | 23 | exports org.eclipse.angus.mail.iap; 24 | exports org.eclipse.angus.mail.imap; 25 | exports org.eclipse.angus.mail.imap.protocol; 26 | 27 | provides jakarta.mail.Provider with 28 | org.eclipse.angus.mail.imap.IMAPProvider, 29 | org.eclipse.angus.mail.imap.IMAPSSLProvider; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/BadCommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | /** 20 | * @author John Mani 21 | */ 22 | 23 | public class BadCommandException extends ProtocolException { 24 | 25 | private static final long serialVersionUID = 5769722539397237515L; 26 | 27 | /** 28 | * Constructs an BadCommandException with no detail message. 29 | */ 30 | public BadCommandException() { 31 | super(); 32 | } 33 | 34 | /** 35 | * Constructs an BadCommandException with the specified detail message. 36 | * 37 | * @param s the detail message 38 | */ 39 | public BadCommandException(String s) { 40 | super(s); 41 | } 42 | 43 | /** 44 | * Constructs an BadCommandException with the specified Response. 45 | * 46 | * @param r the Response 47 | */ 48 | public BadCommandException(Response r) { 49 | super(r); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/CommandFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | /** 20 | * @author John Mani 21 | */ 22 | 23 | public class CommandFailedException extends ProtocolException { 24 | 25 | private static final long serialVersionUID = 793932807880443631L; 26 | 27 | /** 28 | * Constructs an CommandFailedException with no detail message. 29 | */ 30 | public CommandFailedException() { 31 | super(); 32 | } 33 | 34 | /** 35 | * Constructs an CommandFailedException with the specified detail message. 36 | * 37 | * @param s the detail message 38 | */ 39 | public CommandFailedException(String s) { 40 | super(s); 41 | } 42 | 43 | /** 44 | * Constructs an CommandFailedException with the specified Response. 45 | * 46 | * @param r the Response. 47 | */ 48 | public CommandFailedException(Response r) { 49 | super(r); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/ConnectionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | /** 20 | * @author John Mani 21 | */ 22 | 23 | public class ConnectionException extends ProtocolException { 24 | private transient Protocol p; 25 | 26 | private static final long serialVersionUID = 5749739604257464727L; 27 | 28 | /** 29 | * Constructs an ConnectionException with no detail message. 30 | */ 31 | public ConnectionException() { 32 | super(); 33 | } 34 | 35 | /** 36 | * Constructs an ConnectionException with the specified detail message. 37 | * 38 | * @param s the detail message 39 | */ 40 | public ConnectionException(String s) { 41 | super(s); 42 | } 43 | 44 | /** 45 | * Constructs an ConnectionException with the specified Response. 46 | * 47 | * @param p the Protocol object 48 | * @param r the Response 49 | */ 50 | public ConnectionException(Protocol p, Response r) { 51 | super(r); 52 | this.p = p; 53 | } 54 | 55 | public Protocol getProtocol() { 56 | return p; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/Literal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * An interface for objects that provide data dynamically for use in 24 | * a literal protocol element. 25 | * 26 | * @author Bill Shannon 27 | */ 28 | 29 | public interface Literal { 30 | /** 31 | * Return the size of the data. 32 | * 33 | * @return the size of the data 34 | */ 35 | public int size(); 36 | 37 | /** 38 | * Write the data to the OutputStream. 39 | * 40 | * @param os the output stream 41 | * @exception IOException for I/O errors 42 | */ 43 | public void writeTo(OutputStream os) throws IOException; 44 | } 45 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/LiteralException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | /** 20 | * @author Bill Shannon 21 | */ 22 | 23 | public class LiteralException extends ProtocolException { 24 | 25 | private static final long serialVersionUID = -6919179828339609913L; 26 | 27 | /** 28 | * Constructs a LiteralException with the specified Response object. 29 | * 30 | * @param r the response object 31 | */ 32 | public LiteralException(Response r) { 33 | super(r.toString()); 34 | response = r; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/ParsingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | /** 20 | * @author John Mani 21 | */ 22 | 23 | public class ParsingException extends ProtocolException { 24 | 25 | private static final long serialVersionUID = 7756119840142724839L; 26 | 27 | /** 28 | * Constructs an ParsingException with no detail message. 29 | */ 30 | public ParsingException() { 31 | super(); 32 | } 33 | 34 | /** 35 | * Constructs an ParsingException with the specified detail message. 36 | * 37 | * @param s the detail message 38 | */ 39 | public ParsingException(String s) { 40 | super(s); 41 | } 42 | 43 | /** 44 | * Constructs an ParsingException with the specified Response. 45 | * 46 | * @param r the Response 47 | */ 48 | public ParsingException(Response r) { 49 | super(r); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/ResponseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.iap; 18 | 19 | /** 20 | * This class 21 | * 22 | * @author John Mani 23 | */ 24 | 25 | public interface ResponseHandler { 26 | public void handleResponse(Response r); 27 | } 28 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/iap/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | /** 18 | * This package includes internal IMAP support classes and 19 | * SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 20 | */ 21 | package org.eclipse.angus.mail.iap; 22 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/AppendUID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | /** 20 | * Information from the APPENDUID response code 21 | * defined by the UIDPLUS extension - 22 | * RFC 4315. 23 | * 24 | * @author Bill Shannon 25 | */ 26 | 27 | public class AppendUID { 28 | public long uidvalidity = -1; 29 | public long uid = -1; 30 | 31 | public AppendUID(long uidvalidity, long uid) { 32 | this.uidvalidity = uidvalidity; 33 | this.uid = uid; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/CopyUID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | import org.eclipse.angus.mail.imap.protocol.UIDSet; 20 | 21 | /** 22 | * Information from the COPYUID response code 23 | * defined by the UIDPLUS extension - 24 | * RFC 4315. 25 | * 26 | * @author Bill Shannon 27 | */ 28 | 29 | public class CopyUID { 30 | public long uidvalidity = -1; 31 | public UIDSet[] src; 32 | public UIDSet[] dst; 33 | 34 | public CopyUID(long uidvalidity, UIDSet[] src, UIDSet[] dst) { 35 | this.uidvalidity = uidvalidity; 36 | this.src = src; 37 | this.dst = dst; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/IMAPProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The IMAP protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class IMAPProvider extends Provider { 27 | public IMAPProvider() { 28 | super(Provider.Type.STORE, "imap", IMAPStore.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/IMAPSSLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The IMAP SSL protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class IMAPSSLProvider extends Provider { 27 | public IMAPSSLProvider() { 28 | super(Provider.Type.STORE, "imaps", IMAPSSLStore.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/IMAPSSLStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.URLName; 21 | 22 | /** 23 | * This class provides access to an IMAP message store over SSL. 24 | */ 25 | 26 | public class IMAPSSLStore extends IMAPStore { 27 | 28 | /** 29 | * Constructor that takes a Session object and a URLName that 30 | * represents a specific IMAP server. 31 | * 32 | * @param session the Session 33 | * @param url the URLName of this store 34 | */ 35 | public IMAPSSLStore(Session session, URLName url) { 36 | super(session, url, "imaps", true); // call super constructor 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/MessageVanishedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | import jakarta.mail.Folder; 20 | import jakarta.mail.Message; 21 | import jakarta.mail.event.MessageCountEvent; 22 | 23 | /** 24 | * This class provides notification of messages that have been removed 25 | * since the folder was last synchronized. 26 | * 27 | * @since JavaMail 1.5.1 28 | * @author Bill Shannon 29 | */ 30 | 31 | public class MessageVanishedEvent extends MessageCountEvent { 32 | 33 | /** 34 | * The message UIDs. 35 | */ 36 | private long[] uids; 37 | 38 | // a reusable empty array 39 | private static final Message[] noMessages = {}; 40 | 41 | private static final long serialVersionUID = 2142028010250024922L; 42 | 43 | /** 44 | * Constructor. 45 | * 46 | * @param folder the containing folder 47 | * @param uids the UIDs for the vanished messages 48 | */ 49 | public MessageVanishedEvent(Folder folder, long[] uids) { 50 | super(folder, REMOVED, true, noMessages); 51 | this.uids = uids; 52 | } 53 | 54 | /** 55 | * Return the UIDs for this event. 56 | * 57 | * @return the UIDs 58 | */ 59 | public long[] getUIDs() { 60 | return uids; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/ReferralException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap; 18 | 19 | import jakarta.mail.AuthenticationFailedException; 20 | 21 | /** 22 | * A special kind of AuthenticationFailedException that indicates that 23 | * the reason for the failure was an IMAP REFERRAL in the response code. 24 | * See RFC 2221 for details. 25 | * 26 | * @since JavaMail 1.5.5 27 | */ 28 | 29 | public class ReferralException extends AuthenticationFailedException { 30 | 31 | private String url; 32 | private String text; 33 | 34 | private static final long serialVersionUID = -3414063558596287683L; 35 | 36 | /** 37 | * Constructs an ReferralException with the specified URL and text. 38 | * 39 | * @param text the detail message 40 | * @param url the URL 41 | */ 42 | public ReferralException(String url, String text) { 43 | super("[REFERRAL " + url + "] " + text); 44 | this.url = url; 45 | this.text = text; 46 | } 47 | 48 | /** 49 | * Return the IMAP URL in the referral. 50 | * 51 | * @return the IMAP URL 52 | */ 53 | public String getUrl() { 54 | return url; 55 | } 56 | 57 | /** 58 | * Return the text sent by the server along with the referral. 59 | * 60 | * @return the text 61 | */ 62 | public String getText() { 63 | return text; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/FetchItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import jakarta.mail.FetchProfile; 20 | import org.eclipse.angus.mail.iap.ParsingException; 21 | 22 | /** 23 | * Metadata describing a FETCH item. 24 | * Note that the "name" field MUST be in uppercase.

25 | * 26 | * @author Bill Shannon 27 | * @since JavaMail 1.4.6 28 | */ 29 | 30 | public abstract class FetchItem { 31 | private String name; 32 | private FetchProfile.Item fetchProfileItem; 33 | 34 | public FetchItem(String name, FetchProfile.Item fetchProfileItem) { 35 | this.name = name; 36 | this.fetchProfileItem = fetchProfileItem; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public FetchProfile.Item getFetchProfileItem() { 44 | return fetchProfileItem; 45 | } 46 | 47 | /** 48 | * Parse the item into some kind of object appropriate for the item. 49 | * Note that the item name will have been parsed and skipped already. 50 | * 51 | * @throws ParsingException for parsing failures 52 | * @param r the response 53 | * @return the fetch item 54 | */ 55 | public abstract Object parseItem(FetchResponse r) throws ParsingException; 56 | } 57 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/IMAPReferralException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import org.eclipse.angus.mail.iap.ProtocolException; 20 | 21 | /** 22 | * A ProtocolException that includes IMAP login referral information. 23 | * 24 | * @since JavaMail 1.5.5 25 | */ 26 | 27 | public class IMAPReferralException extends ProtocolException { 28 | 29 | private String url; 30 | 31 | private static final long serialVersionUID = 2578770669364251968L; 32 | 33 | /** 34 | * Constructs an IMAPReferralException with the specified detail message. 35 | * and URL. 36 | * 37 | * @param s the detail message 38 | * @param url the URL 39 | */ 40 | public IMAPReferralException(String s, String url) { 41 | super(s); 42 | this.url = url; 43 | } 44 | 45 | /** 46 | * Return the IMAP URL in the referral. 47 | * 48 | * @return the IMAP URL 49 | */ 50 | public String getUrl() { 51 | return url; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/Item.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | /** 20 | * A tagging interface for all IMAP data items. 21 | * Note that the "name" field of all IMAP items MUST be in uppercase.

22 | * 23 | * See the BODY, BODYSTRUCTURE, ENVELOPE, FLAGS, INTERNALDATE, RFC822DATA, 24 | * RFC822SIZE, and UID classes. 25 | * 26 | * @author John Mani 27 | */ 28 | 29 | public interface Item { 30 | } 31 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/MODSEQ.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import org.eclipse.angus.mail.iap.ParsingException; 20 | 21 | /** 22 | * This class represents the MODSEQ data item. 23 | * 24 | * @since JavaMail 1.5.1 25 | * @author Bill Shannon 26 | */ 27 | 28 | public class MODSEQ implements Item { 29 | 30 | static final char[] name = {'M', 'O', 'D', 'S', 'E', 'Q'}; 31 | public int seqnum; 32 | 33 | public long modseq; 34 | 35 | /** 36 | * Constructor. 37 | * 38 | * @throws ParsingException for parsing failures 39 | * @param r the FetchResponse 40 | */ 41 | public MODSEQ(FetchResponse r) throws ParsingException { 42 | seqnum = r.getNumber(); 43 | r.skipSpaces(); 44 | 45 | if (r.readByte() != '(') 46 | throw new ParsingException("MODSEQ parse error"); 47 | 48 | modseq = r.readLong(); 49 | 50 | if (!r.isNextNonSpace(')')) 51 | throw new ParsingException("MODSEQ parse error"); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/RFC822SIZE.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import org.eclipse.angus.mail.iap.ParsingException; 20 | 21 | /** 22 | * An RFC822SIZE FETCH item. 23 | * 24 | * @author John Mani 25 | */ 26 | 27 | public class RFC822SIZE implements Item { 28 | 29 | static final char[] name = {'R', 'F', 'C', '8', '2', '2', '.', 'S', 'I', 'Z', 'E'}; 30 | public int msgno; 31 | 32 | public long size; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | * @throws ParsingException for parsing failures 38 | * @param r the FetchResponse 39 | */ 40 | public RFC822SIZE(FetchResponse r) throws ParsingException { 41 | msgno = r.getNumber(); 42 | r.skipSpaces(); 43 | size = r.readLong(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/SaslAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import org.eclipse.angus.mail.iap.ProtocolException; 20 | 21 | /** 22 | * Interface to make it easier to call IMAPSaslAuthenticator. 23 | */ 24 | 25 | public interface SaslAuthenticator { 26 | public boolean authenticate(String[] mechs, String realm, String authzid, 27 | String u, String p) throws ProtocolException; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/UID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.imap.protocol; 18 | 19 | import org.eclipse.angus.mail.iap.ParsingException; 20 | 21 | /** 22 | * This class represents the UID data item. 23 | * 24 | * @author John Mani 25 | */ 26 | 27 | public class UID implements Item { 28 | 29 | static final char[] name = {'U', 'I', 'D'}; 30 | public int seqnum; 31 | 32 | public long uid; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | * @throws ParsingException for parsing failures 38 | * @param r the FetchResponse 39 | */ 40 | public UID(FetchResponse r) throws ParsingException { 41 | seqnum = r.getNumber(); 42 | r.skipSpaces(); 43 | uid = r.readLong(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | /** 18 | * This package includes internal IMAP support classes and 19 | * SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 20 | */ 21 | package org.eclipse.angus.mail.imap.protocol; 22 | -------------------------------------------------------------------------------- /providers/imap/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | # Jakarta Mail IMAP provider Oracle 2 | protocol=imap; type=store; class=org.eclipse.angus.mail.imap.IMAPStore; vendor=Oracle; 3 | protocol=imaps; type=store; class=org.eclipse.angus.mail.imap.IMAPSSLStore; vendor=Oracle; 4 | -------------------------------------------------------------------------------- /providers/imap/src/main/resources/META-INF/services/jakarta.mail.Provider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.imap.IMAPProvider 2 | org.eclipse.angus.mail.imap.IMAPSSLProvider 3 | -------------------------------------------------------------------------------- /providers/mbox/src/main/cpp/org/eclipse/angus/mail/mbox/UNIXInbox.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | #include 18 | #include 19 | extern void touchlock(); /* XXX - should be in maillock.h */ 20 | 21 | #include "org_eclipse_angus_mail_mbox_UNIXInbox.h" 22 | 23 | /* 24 | * Class: org_eclipse_angus_mail_mbox_UNIXInbox 25 | * Method: maillock 26 | * Signature: (Ljava/lang/String;I)Z 27 | */ 28 | JNIEXPORT jboolean JNICALL 29 | Java_org_eclipse_angus_mail_mbox_UNIXInbox_maillock(JNIEnv *env, jobject obj, 30 | jstring user, jint retry_count) 31 | { 32 | jboolean ret; 33 | const char *name = (*env)->GetStringUTFChars(env, user, 0); 34 | ret = maillock((char *)name, retry_count) == L_SUCCESS ? 35 | JNI_TRUE : JNI_FALSE; 36 | (*env)->ReleaseStringUTFChars(env, user, name); 37 | return (ret); 38 | } 39 | 40 | /* 41 | * Class: org_eclipse_angus_mail_mbox_UNIXInbox 42 | * Method: mailunlock 43 | * Signature: ()V 44 | */ 45 | JNIEXPORT void JNICALL 46 | Java_org_eclipse_angus_mail_mbox_UNIXInbox_mailunlock(JNIEnv *env, jobject obj) 47 | { 48 | (void) mailunlock(); 49 | } 50 | 51 | /* 52 | * Class: org_eclipse_angus_mail_mbox_UNIXInbox 53 | * Method: touchlock0 54 | * Signature: ()V 55 | */ 56 | JNIEXPORT void JNICALL 57 | Java_org_eclipse_angus_mail_mbox_UNIXInbox_touchlock0(JNIEnv *env, jobject obj) 58 | { 59 | (void) touchlock(); 60 | } 61 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail.mbox { 18 | 19 | requires transitive org.eclipse.angus.mail; 20 | requires transitive jakarta.mail; 21 | 22 | exports org.eclipse.angus.mail.mbox; 23 | exports org.eclipse.angus.mail.remote; 24 | } 25 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/mbox/InboxFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.mbox; 18 | 19 | public interface InboxFile extends MailFile { 20 | public boolean openLock(String mode); 21 | 22 | public void closeLock(); 23 | } 24 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/mbox/MailFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.mbox; 18 | 19 | import java.io.FileDescriptor; 20 | 21 | public interface MailFile extends FileInterface { 22 | public boolean lock(String mode); 23 | 24 | public void unlock(); 25 | 26 | public void touchlock(); 27 | 28 | public FileDescriptor getFD(); 29 | } 30 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/mbox/Mailbox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.mbox; 18 | 19 | public abstract class Mailbox { 20 | 21 | /** 22 | * Creates a default {@code Mailbox}. 23 | */ 24 | public Mailbox() { 25 | } 26 | 27 | /** 28 | * Return a MailFile object for the specified user's folder. 29 | */ 30 | public abstract MailFile getMailFile(String user, String folder); 31 | 32 | /** 33 | * Return the file name corresponding to a folder with the given name. 34 | */ 35 | public abstract String filename(String user, String folder); 36 | } 37 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/mbox/MboxProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.mbox; 18 | 19 | import jakarta.mail.Provider; 20 | 21 | /** 22 | * The Mbox protocol provider. 23 | */ 24 | public class MboxProvider extends Provider { 25 | public MboxProvider() { 26 | super(Provider.Type.STORE, "mbox", MboxStore.class.getName(), 27 | "Oracle", null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/mbox/SunOSMailbox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.mbox; 18 | 19 | public class SunOSMailbox extends SolarisMailbox { 20 | 21 | /** 22 | * Creates a default {@code SunOSMailbox}. 23 | * 24 | * @throws SecurityException if unable to read the user home or user name. 25 | */ 26 | public SunOSMailbox() { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/remote/POP3RemoteProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.remote; 18 | 19 | import jakarta.mail.Provider; 20 | 21 | /** 22 | * The POP3 remote protocol provider. 23 | */ 24 | public class POP3RemoteProvider extends Provider { 25 | public POP3RemoteProvider() { 26 | super(Provider.Type.STORE, "pop3remote", 27 | POP3RemoteStore.class.getName(), "Oracle", null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/remote/POP3RemoteStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.remote; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.Store; 21 | import jakarta.mail.URLName; 22 | import org.eclipse.angus.mail.pop3.POP3Store; 23 | 24 | /** 25 | * A local store that uses POP3 to populate the INBOX. 26 | * 27 | * @author Bill Shannon 28 | */ 29 | public class POP3RemoteStore extends RemoteStore { 30 | 31 | public POP3RemoteStore(Session session, URLName url) { 32 | super(session, url); 33 | } 34 | 35 | protected Store getRemoteStore(Session session, URLName url) { 36 | return new POP3Store(session, url); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /providers/mbox/src/main/java/org/eclipse/angus/mail/remote/RemoteDefaultFolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.remote; 18 | 19 | import jakarta.mail.Folder; 20 | import jakarta.mail.Store; 21 | import org.eclipse.angus.mail.mbox.MboxFolder; 22 | import org.eclipse.angus.mail.mbox.MboxStore; 23 | 24 | /** 25 | * The default folder for the "remote" protocol. 26 | * 27 | * @author Bill Shannon 28 | */ 29 | public class RemoteDefaultFolder extends MboxFolder { 30 | 31 | protected RemoteDefaultFolder(RemoteStore store, String name) { 32 | super(store, name); 33 | } 34 | 35 | /** 36 | * Depending on the name of the requested folder, create an 37 | * appropriate Folder subclass. If the name is 38 | * null, create a RemoteDefaultFolder. 39 | * If the name is "INBOX" (ignoring case), create a 40 | * RemoteInbox. Otherwise, create an MboxFolder. 41 | * 42 | * @return the new Folder 43 | */ 44 | protected Folder createFolder(Store store, String name) { 45 | if (name == null) 46 | return new RemoteDefaultFolder((RemoteStore) store, null); 47 | else if (name.equalsIgnoreCase("INBOX")) 48 | return new RemoteInbox((RemoteStore) store, name); 49 | else 50 | return new MboxFolder((MboxStore) store, name); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /providers/mbox/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | protocol=mbox; type=store; class=org.eclipse.angus.mail.mbox.MboxStore; vendor=Oracle; 2 | protocol=pop3remote; type=store; class=org.eclipse.angus.mail.remote.POP3RemoteStore; vendor=Oracle; 3 | -------------------------------------------------------------------------------- /providers/mbox/src/main/resources/META-INF/services/jakarta.mail.Provider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.mbox.MboxProvider 2 | org.eclipse.angus.mail.remote.POP3RemoteProvider 3 | -------------------------------------------------------------------------------- /providers/pop3/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2024 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | @SuppressWarnings("module") 18 | module org.eclipse.angus.mail.pop3 { 19 | 20 | requires transitive jakarta.mail; 21 | requires transitive org.eclipse.angus.mail; 22 | 23 | exports org.eclipse.angus.mail.pop3; 24 | 25 | provides jakarta.mail.Provider with 26 | org.eclipse.angus.mail.pop3.POP3Provider, 27 | org.eclipse.angus.mail.pop3.POP3SSLProvider; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /providers/pop3/src/main/java/org/eclipse/angus/mail/pop3/POP3Provider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.pop3; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The POP3 protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class POP3Provider extends Provider { 27 | public POP3Provider() { 28 | super(Provider.Type.STORE, "pop3", POP3Store.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/pop3/src/main/java/org/eclipse/angus/mail/pop3/POP3SSLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.pop3; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The POP3 SSL protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class POP3SSLProvider extends Provider { 27 | public POP3SSLProvider() { 28 | super(Provider.Type.STORE, "pop3s", POP3SSLStore.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/pop3/src/main/java/org/eclipse/angus/mail/pop3/POP3SSLStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.pop3; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.URLName; 21 | 22 | /** 23 | * A POP3 Message Store using SSL. Contains only one folder, "INBOX". 24 | * 25 | * @author Bill Shannon 26 | */ 27 | public class POP3SSLStore extends POP3Store { 28 | 29 | public POP3SSLStore(Session session, URLName url) { 30 | super(session, url, "pop3s", true); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /providers/pop3/src/main/java/org/eclipse/angus/mail/pop3/Status.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.pop3; 18 | 19 | /** 20 | * Result of POP3 STAT command. 21 | */ 22 | class Status { 23 | int total = 0; // number of messages in the mailbox 24 | int size = 0; // size of the mailbox 25 | }; 26 | -------------------------------------------------------------------------------- /providers/pop3/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | # Jakarta Mail POP3 provider Oracle 2 | protocol=pop3; type=store; class=org.eclipse.angus.mail.pop3.POP3Store; vendor=Oracle; 3 | protocol=pop3s; type=store; class=org.eclipse.angus.mail.pop3.POP3SSLStore; vendor=Oracle; 4 | -------------------------------------------------------------------------------- /providers/pop3/src/main/resources/META-INF/services/jakarta.mail.Provider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.pop3.POP3Provider 2 | org.eclipse.angus.mail.pop3.POP3SSLProvider 3 | -------------------------------------------------------------------------------- /providers/smtp/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | module org.eclipse.angus.mail.smtp { 18 | 19 | requires static java.security.sasl; // for OAuth2 support 20 | requires transitive jakarta.mail; 21 | requires transitive org.eclipse.angus.mail; 22 | 23 | exports org.eclipse.angus.mail.smtp; 24 | 25 | provides jakarta.mail.Provider with 26 | org.eclipse.angus.mail.smtp.SMTPProvider, 27 | org.eclipse.angus.mail.smtp.SMTPSSLProvider; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /providers/smtp/src/main/java/org/eclipse/angus/mail/smtp/SMTPProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.smtp; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The SMTP protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class SMTPProvider extends Provider { 27 | public SMTPProvider() { 28 | super(Provider.Type.TRANSPORT, "smtp", SMTPTransport.class.getName(), 29 | "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/smtp/src/main/java/org/eclipse/angus/mail/smtp/SMTPSSLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.smtp; 18 | 19 | import jakarta.mail.Provider; 20 | import org.eclipse.angus.mail.util.DefaultProvider; 21 | 22 | /** 23 | * The SMTP SSL protocol provider. 24 | */ 25 | @DefaultProvider // Remove this annotation if you copy this provider 26 | public class SMTPSSLProvider extends Provider { 27 | public SMTPSSLProvider() { 28 | super(Provider.Type.TRANSPORT, "smtps", 29 | SMTPSSLTransport.class.getName(), "Oracle", null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /providers/smtp/src/main/java/org/eclipse/angus/mail/smtp/SMTPSSLTransport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.smtp; 18 | 19 | import jakarta.mail.Session; 20 | import jakarta.mail.URLName; 21 | 22 | /** 23 | * This class implements the Transport abstract class using SMTP 24 | * over SSL for message submission and transport. 25 | * 26 | * @author Bill Shannon 27 | */ 28 | 29 | public class SMTPSSLTransport extends SMTPTransport { 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param session the Session 35 | * @param urlname the URLName of this transport 36 | */ 37 | public SMTPSSLTransport(Session session, URLName urlname) { 38 | super(session, urlname, "smtps", true); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /providers/smtp/src/main/java/org/eclipse/angus/mail/smtp/SaslAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package org.eclipse.angus.mail.smtp; 18 | 19 | import jakarta.mail.MessagingException; 20 | 21 | /** 22 | * Interface to make it easier to call SMTPSaslAuthenticator. 23 | */ 24 | 25 | public interface SaslAuthenticator { 26 | public boolean authenticate(String[] mechs, String realm, String authzid, 27 | String u, String p) throws MessagingException; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /providers/smtp/src/main/resources/META-INF/javamail.address.map: -------------------------------------------------------------------------------- 1 | rfc822=smtp 2 | -------------------------------------------------------------------------------- /providers/smtp/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | # Jakarta Mail SMTP provider Oracle 2 | protocol=smtp; type=transport; class=org.eclipse.angus.mail.smtp.SMTPTransport; vendor=Oracle; 3 | protocol=smtps; type=transport; class=org.eclipse.angus.mail.smtp.SMTPSSLTransport; vendor=Oracle; 4 | -------------------------------------------------------------------------------- /providers/smtp/src/main/resources/META-INF/services/jakarta.mail.Provider: -------------------------------------------------------------------------------- 1 | org.eclipse.angus.mail.smtp.SMTPProvider 2 | org.eclipse.angus.mail.smtp.SMTPSSLProvider 3 | -------------------------------------------------------------------------------- /siggen: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2010, 2022 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Eclipse Public License v. 2.0, which is available at 7 | # http://www.eclipse.org/legal/epl-2.0. 8 | # 9 | # This Source Code may also be made available under the following Secondary 10 | # Licenses when the conditions for such availability set forth in the 11 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 12 | # version 2 with the GNU Classpath Exception, which is available at 13 | # https://www.gnu.org/software/classpath/license.html. 14 | # 15 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 16 | # 17 | 18 | 19 | # 20 | # Generate a new signature file. 21 | # 22 | # Usage: siggen jakarta.mail.jar mail.sig 23 | # 24 | SIGTEST=${SIGTEST:-/java/re/sigtest/4.0/promoted/fcs/latest/binaries/sigtest-4.0} 25 | SIGTEST_JAR=$SIGTEST/lib/sigtestdev.jar 26 | JAVA_HOME=${JAVA_HOME:-/opt/jdk1.8} 27 | PKG=jakarta.mail 28 | USAGE="siggen [-p package] jakarta.mail.jar mail.sig" 29 | 30 | while getopts p: opt 31 | do 32 | case $opt in 33 | p) PKG="$OPTARG";; 34 | \?) echo $USAGE; exit 1;; 35 | esac 36 | done 37 | shift `expr $OPTIND - 1` 38 | 39 | ver=$($JAVA_HOME/bin/java -version 2>&1 | sed -e 's/.*"\(.*\)".*/\1/;q') 40 | case "$ver" in 41 | 1.[0-9]*) xjimage=; 42 | cp="$1:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/jce.jar";; 43 | *) xjimage="-xjimage ${JAVA_HOME}/bin/jimage"; 44 | cp="$1:${JAVA_HOME}/lib/modules";; 45 | esac 46 | 47 | ${JAVA_HOME}/bin/java -jar $SIGTEST_JAR setup -static \ 48 | -classpath "$cp" $xjimage \ 49 | -filename "$2" -package "$PKG" -nonclosedfile 50 | -------------------------------------------------------------------------------- /src/main/assembly/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 17 | resources 18 | 19 | zip 20 | 21 | false 22 | 23 | 24 | ${project.basedir} 25 | legal 26 | 27 | LICENSE.md 28 | NOTICE.md 29 | 30 | 31 | 32 | ${project.basedir} 33 | config 34 | 35 | copyright-exclude 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /update_version: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2010, 2022 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Eclipse Public License v. 2.0, which is available at 7 | # http://www.eclipse.org/legal/epl-2.0. 8 | # 9 | # This Source Code may also be made available under the following Secondary 10 | # Licenses when the conditions for such availability set forth in the 11 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 12 | # version 2 with the GNU Classpath Exception, which is available at 13 | # https://www.gnu.org/software/classpath/license.html. 14 | # 15 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 16 | # 17 | 18 | 19 | # 20 | # update version number in pom files, e.g., to change to release 21 | # version number in preparation for release, or to change back to 22 | # snapshot version number after release. 23 | # 24 | # Usage: update_version new-version 25 | # 26 | new=$1 27 | # find the second version string in pom.xml, which is the old version 28 | # this is almost the same as "mvn versions:set -DnewVersion=$1" 29 | # except that misses mbox/native/pom.xml 30 | old=`grep '.*' pom.xml | sed -n 2p | \ 31 | sed -e 's:.*\(.*\).*:\1:'` 32 | # skip the spec directory, which is versioned separately 33 | for file in `find * -name spec -prune -o -name 'pom.xml' -print` 34 | do 35 | ed - "$file" <<-EOF 36 | g:$old:s::$new: 37 | w 38 | q 39 | EOF 40 | done 41 | ed - pom.xml <<-EOF 42 | g:$old:s::$new: 43 | w 44 | q 45 | EOF 46 | -------------------------------------------------------------------------------- /www/Android.md: -------------------------------------------------------------------------------- 1 | Angus Mail for Android 2 | ======================== 3 | 4 | Angus Mail for Android is now available! 5 | 6 | Standard Angus Mail distribution can run on Android. 7 | 8 | This version is available from the maven central repository. 9 | You can try out this version by adding the following to your 10 | build.gradle file for your Android application: 11 | 12 | android { 13 | packagingOptions { 14 | pickFirst 'META-INF/LICENSE.md' // picks the Angus Mail license file 15 | pickFirst 'META-INF/NOTICE.md' // picks the Angus Mail notice file 16 | } 17 | } 18 | 19 | dependencies { 20 | // use whatever the current version is... 21 | compile 'org.eclipse.angus:jakarta.mail:2.0.0' 22 | compile 'org.eclipse.angus:angus-activation:2.0.0' 23 | compile 'jakarta.activation:jakarta.activation-api:2.1.1' 24 | } 25 | 26 | One of the standard Java features not supported on Android is SASL. That means 27 | none of the "mail._protocol_.sasl.*" properties will have any effect. One of 28 | the main uses of SASL was to enable OAuth2 support. The latest version 29 | of Angus Mail includes built-in OAuth2 support that doesn't require SASL. 30 | See the [OAuth2](OAuth2) page for more details. 31 | 32 | Angus Mail for Android requires at least Android API level 19, 33 | which corresponds to 34 | [Android KitKat](https://en.wikipedia.org/wiki/Android_version_history#Android_4.4_KitKat_.28API_19.29), 35 | currently the oldest supported version of Android. 36 | 37 | If you discover problems, please report them to 38 | [angus-dev@eclipse.org](https://accounts.eclipse.org/mailing-list/angus-dev). 39 | -------------------------------------------------------------------------------- /www/AngusMail-License.md: -------------------------------------------------------------------------------- 1 | Angus Mail License 2 | ==================== 3 | 4 | Angus Mail uses several licenses: 5 | 6 | - Most of the Angus Mail source code is licensed under the 7 | [Eclipse Public License (EPL) v2.0](http://www.eclipse.org/legal/epl-2.0) 8 | and [GNU General Public License (GPL) v2 with Classpath Exception]( 9 | https://www.gnu.org/software/classpath/license.html); 10 | see the license information at the top of each source file. 11 | - The source code for the forked copy of Jakarta Activation 12 | is licensed under the 13 | [Eclipse Distribution License (EDL) v1.0]( 14 | http://www.eclipse.org/org/documents/edl-v10.php); 15 | again, the license is in each source file. 16 | - The source code for the demo programs is licensed under the 17 | [Eclipse Distribution License (EDL) v1.0]( 18 | http://www.eclipse.org/org/documents/edl-v10.php). 19 | - The binary jar files published to the Maven repository are licensed 20 | under the same licenses as the corresponding source 21 | code; see the file `META-INF/LICENSE.txt` in each jar file. 22 | 23 | You'll find the text of the licenses in the workspace in various 24 | `LICENSE.txt` or `LICENSE.md` files. 25 | Don't let the presence of these license files in the workspace confuse 26 | you into thinking that they apply to all files in the workspace. 27 | 28 | You should always read the license file included with every download, 29 | and read the license text included in every source file. 30 | -------------------------------------------------------------------------------- /www/Build-Instructions.md: -------------------------------------------------------------------------------- 1 | Jakarta Mail Build Instructions 2 | =============================== 3 | 4 | To download the most recent Angus Mail source code you'll need 5 | [git](https://git-scm.com/downloads). 6 | 7 | Once you've installed git, the following command will check out a copy 8 | of the source code: 9 | 10 | % git clone git@github.com:eclipse-ee4j/angus-mail.git 11 | 12 | Or, to check out the version corresponding to a particular release, use 13 | a tag. For example, to check out the 1.6.4 version: 14 | 15 | % git clone -b 1.0.0 git@github.com:eclipse-ee4j/angus-mail.git 16 | 17 | To build Jakarta Mail you'll need [Maven](http://maven.apache.org/). 18 | 19 | To simply build everything, use: 20 | 21 | % cd mail 22 | % mvn install 23 | 24 | You'll find the angus-mail.jar file in providers/angus-mail/target/angus-mail.jar or 25 | jakarta.mail.jar file in providers/jakarta.mail/target/jakarta.mail.jar. 26 | 27 | See [Workspace Structure](Workspace-Structure) for a description of the 28 | workspace. 29 | -------------------------------------------------------------------------------- /www/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'github-pages', group: :jekyll_plugins 4 | gem 'jekyll-theme-eclipsefdn' 5 | 6 | gem "webrick", "~> 1.7" 7 | -------------------------------------------------------------------------------- /www/Google-App-Engine.md: -------------------------------------------------------------------------------- 1 | Google App Engine 2 | ================= 3 | 4 | Google's documentation is 5 | [here](https://developers.google.com/appengine/docs/java/mail). 6 | 7 | Note that GAE limits the headers and attachment types you can use, 8 | as described in the 9 | [Google Cloud documentation](https://cloud.google.com/appengine/docs/standard/java/mail/mail-with-headers-attachments). 10 | -------------------------------------------------------------------------------- /www/IMAP-Store.md: -------------------------------------------------------------------------------- 1 | IMAP Store 2 | ========== 3 | 4 | The IMAP Store supports reading mail from mail servers using the IMAP 5 | protocol. The primary documentation for the IMAP Store is in the 6 | javadocs for the 7 | [org.eclipse.angus.mail.imap package](docs/api/org.eclipse.angus.mail/org/eclipse/angus/mail/imap/package-summary.html). 8 | Be sure to read the package level javadocs, which describe the 9 | properties you can set, as well as the javadocs for the individual 10 | classes in the package. 11 | 12 | This page is currently a placeholder for more information about the IMAP Store. 13 | -------------------------------------------------------------------------------- /www/Mbox-Provider.md: -------------------------------------------------------------------------------- 1 | Jakarta Mail Mbox Provider 2 | ========================== 3 | 4 | The mbox provider is a Jakarta Mail local store provider that manages files 5 | in [ Unix mbox format ](http://en.wikipedia.org/wiki/Mbox) 6 | (in particular, the *mboxcl2* variant). 7 | 8 | The mbox provider has only been tested on Solaris, OpenSolaris 9 | and distributions based on Debian. 10 | I tried it once on Windows, long ago, but there's no file 11 | locking support for use on Windows. On Solaris and OpenSolaris it 12 | depends on native file locking code. 13 | 14 | To build the mbox provider for Solaris/OpenSolaris: 15 | 16 | % (cd mbox; mvn) 17 | % (cd mbox/native; mvn) 18 | 19 | To build the mbox provider for distributions based on Debian: 20 | 21 | % (cd mbox; mvn) 22 | % (cd mbox/native; mvn -Plinux) 23 | 24 | This depends on having the **c89** command in your PATH. 25 | 26 | For based on Debian you need to have installed liblockfile-dev package. 27 | 28 | To use the mbox provider you'll need to add mbox/target/mbox.jar to 29 | your CLASSPATH and add mbox/native/target/libmbox.so to your 30 | LD\_LIBRARY\_PATH. 31 | -------------------------------------------------------------------------------- /www/Outlook.md: -------------------------------------------------------------------------------- 1 | *This page should have a lot more information about Outlook.com. For 2 | now it's just a collection of notes.* 3 | 4 | As of Oct 2013, outlook.com fails to find messages using a date range 5 | search - start \<= msg \<= end. 6 | -------------------------------------------------------------------------------- /www/POP3-Remote-Store.md: -------------------------------------------------------------------------------- 1 | POP3 Remote Store 2 | ================= 3 | 4 | The POP3 Remote Store is an experimental Store that behaves much the 5 | way a typical email client expects when using POP3. That is, all 6 | messages and all folders are really stored locally (in this case using 7 | the [Mbox Store](Mbox-Store)), and new messages are fetched 8 | from the server using the POP3 protocol. 9 | 10 | The POP3 Remote Store is not currently distributed with Jakarta Mail, but 11 | is included in the Jakarta Mail source code in the mbox project. 12 | 13 | XXX - still need to provide more information here. 14 | -------------------------------------------------------------------------------- /www/POP3-Store.md: -------------------------------------------------------------------------------- 1 | POP3 Store 2 | ========== 3 | 4 | The POP3 Store supports reading mail from mail servers using the POP3 5 | protocol. The primary documentation for the POP3 Store is in the 6 | javadocs for the 7 | [org.eclipse.angus.mail.pop3 package](docs/api/org.eclipse.angus.mail/org/eclipse/angus/mail/pop3/package-summary.html). 8 | Be sure to read the package level javadocs, which describe the 9 | properties you can set, as well as the javadocs for the individual 10 | classes in the package. 11 | 12 | This page is currently a placeholder for more information about the POP3 Store. 13 | -------------------------------------------------------------------------------- /www/SMTP-Transport.md: -------------------------------------------------------------------------------- 1 | SMTP Transport 2 | ============== 3 | 4 | The only Transport (for sending mail) provided with Jakarta Mail uses the 5 | SMTP protocol. The primary documentation for the SMTP Transport is in 6 | the javadocs for the 7 | [org.eclipse.angus.mail.smtp package](docs/api/org.eclipse.angus.mail/org/eclipse/angus/mail/smtp/package-summary.html). 8 | Be sure to read the package level javadocs, which describe the 9 | properties you can set, as well as the javadocs for the individual 10 | classes in the package. 11 | 12 | This page is currently a placeholder for more information about the 13 | SMTP Transport. 14 | -------------------------------------------------------------------------------- /www/Windows.md: -------------------------------------------------------------------------------- 1 | Windows Hints and Tips 2 | ====================== 3 | 4 | TCP TIME\_WAIT 5 | -------------- 6 | 7 | When making a large number of connections (e.g., to a mail server) in a 8 | short amount of time, you might run out of sockets and not be able to 9 | create any more connections. The existing connections will be in a 10 | TIME\_WAIT state as shown by netstat. The following articles explain 11 | this situation in more detail and include tips for how to deal with 12 | it: 13 | 14 | - [Microsoft TechNet](http://technet.microsoft.com/en-us/library/cc757512%28WS.10%29.aspx) 15 | - [Microsoft MSDN](http://msdn.microsoft.com/en-us/library/ms819739.aspx) 16 | - [Microsoft Support](http://support.microsoft.com/kb/328476) (talks about SQL Server, but applies here as well) 17 | 18 | Note that it seems the 19 | [number of available ports has increased in Windows Server 2008](http://support.microsoft.com/kb/929851). 20 | 21 | .msg and .eml Files 22 | ------------------- 23 | 24 | Windows applications typically store single messages in MIME format in 25 | ".eml" files. Jakarta Mail can read these files using the MimeMessage 26 | constructor that takes an InputStream. 27 | 28 | Windows applications typically store messages in the Windows 29 | proprietary Outlook message format in ".msg" files. Jakarta Mail can't 30 | process these files directly, but the 31 | [Apache POI project](http://poi.apache.org/) might help. 32 | -------------------------------------------------------------------------------- /www/Yahoo.md: -------------------------------------------------------------------------------- 1 | Yahoo! Mail 2 | =========== 3 | 4 | This page is currently a placeholder for describing hints and tips for 5 | using Jakarta Mail with Yahoo! Mail. Basic Yahoo! Mail usage information 6 | can be found in the 7 | [Jakarta Mail FAQ](FAQ.html#yahoomail). 8 | 9 | See also the 10 | [Wikipedia page on Yahoo! Mail](http://en.wikipedia.org/wiki/Yahoo!_Mail#Free_IMAP_and_SMTPs_access) 11 | for information about accessing the Yahoo! Mail IMAP server. I've just 12 | added a feature to Jakarta Mail to enable Yahoo! Mail IMAP server support - 13 | set the property "mail.imap.yahoo.guid" to "1". As of 3/19/2015, this 14 | no longer seems to be necessary. 15 | 16 | On 3/12/2015 a user reported 17 | that using the Jakarta Mail equivalent of UID FETCH X:Y (UID) where X is 18 | greater than any existing UID in the folder never returns. 19 | 20 | As of 8/19/2015, Yahoo Mail doesn't handle some IMAP SEARCH terms 21 | correctly. For example, the NOT term seems to be completely ignored. 22 | -------------------------------------------------------------------------------- /www/_config.yml: -------------------------------------------------------------------------------- 1 | github: [ metadata ] 2 | 3 | remote_theme: eclipsefdn/jekyll-theme-eclipsefdn 4 | 5 | title: [ Eclipse Angus ] 6 | description: [ Angus - Mail ] 7 | 8 | links: 9 | source: https://github.com/eclipse-ee4j/angus-mail 10 | api: docs/api/ 11 | download: https://repo1.maven.org/maven2/org/eclipse/angus/angus-mail 12 | mailinglist: https://accounts.eclipse.org/mailing-list/angus-dev 13 | spec: https://jakarta.ee/specifications/mail 14 | faq: FAQ 15 | contrib: CONTRIBUTING 16 | tckresults: TCK-Results 17 | 18 | include: 19 | - CONTRIBUTING.md 20 | -------------------------------------------------------------------------------- /www/_layouts/content.html: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 25 | 26 | 27 | {{ page.title | default: site.title }} 28 | {% include google_tag_manager.html %} 29 | 30 | 31 | {% include header-small.html %} 32 | {% include breadcrumbs.html %} 33 |

34 |
35 |
36 |
37 | {{ content }} 38 |
39 |
40 | {% include sidebar.html %} 41 |
42 |
43 |
44 |
45 | {% include footer.html %} 46 | 47 | --------------------------------------------------------------------------------