├── LICENSE.txt ├── smtp └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── javamail.address.map │ │ ├── services │ │ └── javax.mail.Provider │ │ ├── javamail.providers │ │ └── MANIFEST.MF │ └── java │ └── module-info.java ├── mail └── src │ ├── main │ ├── resources │ │ ├── META-INF │ │ │ ├── javamail.default.address.map │ │ │ ├── LICENSE.txt │ │ │ ├── services │ │ │ │ └── javax.mail.Provider │ │ │ ├── hk2-locator │ │ │ │ └── default │ │ │ ├── MANIFEST.MF │ │ │ ├── javamail.default.providers │ │ │ ├── mailcap │ │ │ └── javamail.charset.map │ │ └── javax │ │ │ └── mail │ │ │ └── Version.java │ └── java │ │ ├── com │ │ └── sun │ │ │ └── mail │ │ │ ├── iap │ │ │ ├── ResponseHandler.java │ │ │ ├── package.html │ │ │ ├── LiteralException.java │ │ │ └── Literal.java │ │ │ ├── pop3 │ │ │ ├── Status.java │ │ │ ├── POP3Provider.java │ │ │ ├── POP3SSLProvider.java │ │ │ └── POP3SSLStore.java │ │ │ ├── imap │ │ │ ├── IMAPProvider.java │ │ │ ├── IMAPSSLProvider.java │ │ │ ├── protocol │ │ │ │ ├── Item.java │ │ │ │ ├── SaslAuthenticator.java │ │ │ │ ├── package.html │ │ │ │ └── UID.java │ │ │ ├── AppendUID.java │ │ │ ├── CopyUID.java │ │ │ └── IMAPSSLStore.java │ │ │ ├── smtp │ │ │ ├── SMTPProvider.java │ │ │ ├── SMTPSSLProvider.java │ │ │ ├── SaslAuthenticator.java │ │ │ └── SMTPSSLTransport.java │ │ │ ├── auth │ │ │ └── package.html │ │ │ ├── handlers │ │ │ ├── package.html │ │ │ ├── text_html.java │ │ │ └── image_jpeg.java │ │ │ └── util │ │ │ └── DecodingException.java │ │ └── javax │ │ └── mail │ │ ├── event │ │ ├── package.html │ │ ├── StoreListener.java │ │ ├── MessageCountAdapter.java │ │ ├── FolderAdapter.java │ │ ├── MessageChangedListener.java │ │ ├── ConnectionAdapter.java │ │ └── TransportAdapter.java │ │ ├── util │ │ └── package.html │ │ ├── MailSessionDefinitions.java │ │ └── MessageAware.java │ ├── test │ ├── resources │ │ └── javax │ │ │ └── mail │ │ │ └── internet │ │ │ ├── addrlist │ │ │ ├── MailDateFormat_new.ser │ │ │ └── MailDateFormat_old.ser │ └── java │ │ ├── com │ │ └── sun │ │ │ └── mail │ │ │ ├── test │ │ │ └── NullOutputStream.java │ │ │ └── util │ │ │ └── MimeUtilTestSuite.java │ │ └── javax │ │ └── mail │ │ └── internet │ │ ├── MimeMessageTestSuite.java │ │ ├── NewsAddressTest.java │ │ ├── ContentDispositionTestSuite.java │ │ ├── MimeBodyPartTestSuite.java │ │ └── EncodeFileNameNoEncodeParameters.java │ └── oldtest │ └── java │ └── javax │ └── mail │ └── internet │ ├── decodetest │ ├── encodedheaders.data │ └── socketfactory │ ├── TestResult.java │ └── DummyTrustManager.java ├── .gitignore ├── .hgignore ├── doc └── release │ ├── images │ ├── direct-classpath.jpg │ └── indirect-classpath.jpg │ └── NTLMNOTES.txt ├── imap └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.mail.Provider │ │ ├── javamail.providers │ │ └── MANIFEST.MF │ └── java │ └── module-info.java ├── pop3 └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.mail.Provider │ │ ├── javamail.providers │ │ └── MANIFEST.MF │ └── java │ └── module-info.java ├── gimap └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.mail.Provider │ │ ├── javamail.providers │ │ └── MANIFEST.MF │ └── java │ ├── com │ └── sun │ │ └── mail │ │ └── gimap │ │ ├── GmailProvider.java │ │ └── GmailSSLProvider.java │ └── module-info.java ├── mbox └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.mail.Provider │ │ ├── javamail.providers │ │ └── MANIFEST.MF │ └── java │ └── com │ └── sun │ └── mail │ ├── mbox │ ├── SunOSMailbox.java │ ├── InboxFile.java │ ├── MailFile.java │ ├── MboxProvider.java │ └── Mailbox.java │ └── remote │ ├── POP3RemoteProvider.java │ └── POP3RemoteStore.java ├── client └── src │ └── main │ └── java │ └── simple.mailcap ├── README.md ├── dsn └── src │ ├── main │ └── resources │ │ └── META-INF │ │ ├── MANIFEST.MF │ │ └── mailcap │ └── test │ └── java │ └── com │ └── sun │ └── mail │ └── dsn │ └── NullOutputStream.java ├── outlook └── src │ └── main │ └── java │ └── README.txt ├── android └── activation │ └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── mailcap.default │ │ └── mimetypes.default │ └── java │ ├── com │ └── sun │ │ └── activation │ │ └── registries │ │ ├── MailcapParseException.java │ │ └── MimeTypeEntry.java │ └── javax │ └── activation │ ├── package.html │ └── MimeTypeParseException.java ├── copyright-exclude ├── CONTRIBUTING.md ├── .hgtags ├── webapp ├── src │ └── main │ │ └── webapp │ │ ├── errordetails.jsp │ │ ├── logout.jsp │ │ ├── errorpage.jsp │ │ ├── login.jsp │ │ ├── send.jsp │ │ └── folders.jsp ├── build.sh └── build.bat ├── project.properties ├── mailhandler └── src │ └── main │ └── java │ └── module-info.java ├── logging └── src │ └── main │ └── java │ └── maildemo.policy ├── taglib └── src │ └── main │ └── java │ └── demo │ ├── MessageTEI.java │ ├── ListMessagesTEI.java │ └── ListAttachmentsTEI.java └── mailapi └── src └── main └── java └── module-info.java /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/LICENSE.txt -------------------------------------------------------------------------------- /smtp/src/main/resources/META-INF/javamail.address.map: -------------------------------------------------------------------------------- 1 | rfc822=smtp 2 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/javamail.default.address.map: -------------------------------------------------------------------------------- 1 | rfc822=smtp 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | */target/ 3 | nbproject/private/ 4 | .m2/ 5 | webrev 6 | src/main/java/javax/mail/Version\.java 7 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | ^target/ 2 | /target/ 3 | ^nbproject/private/ 4 | ^\.m2/ 5 | ^webrev 6 | ^src/main/java/javax/mail/Version\.java$ 7 | -------------------------------------------------------------------------------- /doc/release/images/direct-classpath.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/doc/release/images/direct-classpath.jpg -------------------------------------------------------------------------------- /doc/release/images/indirect-classpath.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/doc/release/images/indirect-classpath.jpg -------------------------------------------------------------------------------- /imap/src/main/resources/META-INF/services/javax.mail.Provider: -------------------------------------------------------------------------------- 1 | com.sun.mail.imap.IMAPProvider 2 | com.sun.mail.imap.IMAPSSLProvider 3 | -------------------------------------------------------------------------------- /pop3/src/main/resources/META-INF/services/javax.mail.Provider: -------------------------------------------------------------------------------- 1 | com.sun.mail.pop3.POP3Provider 2 | com.sun.mail.pop3.POP3SSLProvider 3 | -------------------------------------------------------------------------------- /smtp/src/main/resources/META-INF/services/javax.mail.Provider: -------------------------------------------------------------------------------- 1 | com.sun.mail.smtp.SMTPProvider 2 | com.sun.mail.smtp.SMTPSSLProvider 3 | -------------------------------------------------------------------------------- /gimap/src/main/resources/META-INF/services/javax.mail.Provider: -------------------------------------------------------------------------------- 1 | com.sun.mail.gimap.GmailProvider 2 | com.sun.mail.gimap.GmailSSLProvider 3 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/mail/src/main/resources/META-INF/LICENSE.txt -------------------------------------------------------------------------------- /mbox/src/main/resources/META-INF/services/javax.mail.Provider: -------------------------------------------------------------------------------- 1 | com.sun.mail.mbox.MboxProvider 2 | com.sun.mail.remote.POP3RemoteProvider 3 | -------------------------------------------------------------------------------- /mail/src/test/resources/javax/mail/internet/addrlist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/mail/src/test/resources/javax/mail/internet/addrlist -------------------------------------------------------------------------------- /mail/src/test/resources/javax/mail/internet/MailDateFormat_new.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/mail/src/test/resources/javax/mail/internet/MailDateFormat_new.ser -------------------------------------------------------------------------------- /mail/src/test/resources/javax/mail/internet/MailDateFormat_old.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/javamail/HEAD/mail/src/test/resources/javax/mail/internet/MailDateFormat_old.ser -------------------------------------------------------------------------------- /mail/src/oldtest/java/javax/mail/internet/decodetest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | java decodetext < encodedheaders.data > x1 3 | java -Dmail.mime.decodetext.strict=false decodetext < encodedheaders.data > x2 4 | diff -c x1 x2 5 | -------------------------------------------------------------------------------- /gimap/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | protocol=gimap; type=store; class=com.sun.mail.gimap.GmailStore; vendor=Oracle; 2 | protocol=gimaps; type=store; class=com.sun.mail.gimap.GmailSSLStore; vendor=Oracle; 3 | -------------------------------------------------------------------------------- /mbox/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | protocol=mbox; type=store; class=com.sun.mail.mbox.MboxStore; vendor=Oracle; 2 | protocol=pop3remote; type=store; class=com.sun.mail.remote.POP3RemoteStore; vendor=Oracle; 3 | -------------------------------------------------------------------------------- /imap/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | # JavaMail IMAP provider Oracle 2 | protocol=imap; type=store; class=com.sun.mail.imap.IMAPStore; vendor=Oracle; 3 | protocol=imaps; type=store; class=com.sun.mail.imap.IMAPSSLStore; vendor=Oracle; 4 | -------------------------------------------------------------------------------- /pop3/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | # JavaMail POP3 provider Oracle 2 | protocol=pop3; type=store; class=com.sun.mail.pop3.POP3Store; vendor=Oracle; 3 | protocol=pop3s; type=store; class=com.sun.mail.pop3.POP3SSLStore; vendor=Oracle; 4 | -------------------------------------------------------------------------------- /smtp/src/main/resources/META-INF/javamail.providers: -------------------------------------------------------------------------------- 1 | # JavaMail SMTP provider Oracle 2 | protocol=smtp; type=transport; class=com.sun.mail.smtp.SMTPTransport; vendor=Oracle; 3 | protocol=smtps; type=transport; class=com.sun.mail.smtp.SMTPSSLTransport; vendor=Oracle; 4 | -------------------------------------------------------------------------------- /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=MessageViewer 7 | text/plain;; x-java-view=TextViewer 8 | multipart/*;; x-java-view=MultipartViewer 9 | 10 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/services/javax.mail.Provider: -------------------------------------------------------------------------------- 1 | com.sun.mail.imap.IMAPProvider 2 | com.sun.mail.imap.IMAPSSLProvider 3 | com.sun.mail.smtp.SMTPProvider 4 | com.sun.mail.smtp.SMTPSSLProvider 5 | com.sun.mail.pop3.POP3Provider 6 | com.sun.mail.pop3.POP3SSLProvider 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### :warning:This project is now part of the EE4J initiative. This repository has been archived as all activities are now happening in the [corresponding Eclipse repository](https://github.com/eclipse-ee4j/javamail). See [here](https://www.eclipse.org/ee4j/status.php) for the overall EE4J transition status. 2 | 3 | --- 4 | 5 | See the [JavaMail web site](https://javaee.github.io/javamail). 6 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/hk2-locator/default: -------------------------------------------------------------------------------- 1 | # 2 | # This metadata allows com.sun.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 | [com.sun.mail.util.logging.MailHandler] 8 | contract={java.util.logging.Handler} 9 | scope=javax.inject.Singleton 10 | -------------------------------------------------------------------------------- /dsn/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: com.sun.mail.dsn 3 | Specification-Title: com.sun.mail.dsn 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: com.sun.mail.dsn 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /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 (MSMessage.isMSMessage(msg)) 5 | msg = new 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 | -------------------------------------------------------------------------------- /imap/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: com.sun.mail.imap 3 | Specification-Title: com.sun.mail.imap 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: com.sun.mail.imap 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /mbox/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: com.sun.mail.mbox 3 | Specification-Title: com.sun.mail.mbox 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: com.sun.mail.mbox 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /pop3/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: com.sun.mail.pop3 3 | Specification-Title: com.sun.mail.pop3 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: com.sun.mail.pop3 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /smtp/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: com.sun.mail.smtp 3 | Specification-Title: com.sun.mail.smtp 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: com.sun.mail.smtp 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /gimap/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: com.sun.mail.gimap 3 | Specification-Title: com.sun.mail.gimap 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: com.sun.mail.gimap 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Extension-Name: javax.mail 3 | Specification-Title: JavaMail(TM) API Design Specification 4 | Specification-Version: ${mail.spec.version} 5 | Specification-Vendor: ${project.organization.name} 6 | Implementation-Title: javax.mail 7 | Implementation-Version: ${mail.version} 8 | Implementation-Vendor: ${project.organization.name} 9 | Implementation-Vendor-Id: com.sun 10 | -------------------------------------------------------------------------------- /dsn/src/main/resources/META-INF/mailcap: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # JavaMail content-handlers: 4 | # 5 | multipart/report;; x-java-content-handler=com.sun.mail.dsn.multipart_report 6 | message/delivery-status;; x-java-content-handler=com.sun.mail.dsn.message_deliverystatus 7 | message/disposition-notification;; x-java-content-handler=com.sun.mail.dsn.message_dispositionnotification 8 | text/rfc822-headers;; x-java-content-handler=com.sun.mail.dsn.text_rfc822headers 9 | -------------------------------------------------------------------------------- /android/activation/src/main/resources/META-INF/mailcap.default: -------------------------------------------------------------------------------- 1 | # 2 | # This is a very simple 'mailcap' file 3 | # 4 | # No default viewers are included so these entries are commented out. 5 | # 6 | #image/gif;; x-java-view=com.sun.activation.viewers.ImageViewer 7 | #image/jpeg;; x-java-view=com.sun.activation.viewers.ImageViewer 8 | #text/*;; x-java-view=com.sun.activation.viewers.TextViewer 9 | #text/*;; x-java-edit=com.sun.activation.viewers.TextEditor 10 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/javamail.default.providers: -------------------------------------------------------------------------------- 1 | # JavaMail IMAP provider Oracle 2 | protocol=imap; type=store; class=com.sun.mail.imap.IMAPStore; vendor=Oracle; 3 | protocol=imaps; type=store; class=com.sun.mail.imap.IMAPSSLStore; vendor=Oracle; 4 | # JavaMail SMTP provider Oracle 5 | protocol=smtp; type=transport; class=com.sun.mail.smtp.SMTPTransport; vendor=Oracle; 6 | protocol=smtps; type=transport; class=com.sun.mail.smtp.SMTPSSLTransport; vendor=Oracle; 7 | # JavaMail POP3 provider Oracle 8 | protocol=pop3; type=store; class=com.sun.mail.pop3.POP3Store; vendor=Oracle; 9 | protocol=pop3s; type=store; class=com.sun.mail.pop3.POP3SSLStore; vendor=Oracle; 10 | -------------------------------------------------------------------------------- /android/activation/src/main/resources/META-INF/mimetypes.default: -------------------------------------------------------------------------------- 1 | # 2 | # A simple, old format, mime.types file 3 | # 4 | text/html html htm HTML HTM 5 | text/plain txt text TXT TEXT 6 | image/gif gif GIF 7 | image/ief ief 8 | image/jpeg jpeg jpg jpe JPG 9 | image/tiff tiff tif 10 | image/png png PNG 11 | image/x-xwindowdump xwd 12 | application/postscript ai eps ps 13 | application/rtf rtf 14 | application/x-tex tex 15 | application/x-texinfo texinfo texi 16 | application/x-troff t tr roff 17 | audio/basic au 18 | audio/midi midi mid 19 | audio/x-aifc aifc 20 | audio/x-aiff aif aiff 21 | audio/x-mpeg mpeg mpg 22 | audio/x-wav wav 23 | video/mpeg mpeg mpg mpe 24 | video/quicktime qt mov 25 | video/x-msvideo avi 26 | -------------------------------------------------------------------------------- /mail/src/main/resources/META-INF/mailcap: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Default mailcap file for the JavaMail System. 4 | # 5 | # JavaMail content-handlers: 6 | # 7 | text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain 8 | text/html;; x-java-content-handler=com.sun.mail.handlers.text_html 9 | text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml 10 | multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true 11 | message/rfc822;; x-java-content-handler=com.sun.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=com.sun.mail.handlers.image_gif 16 | #image/jpeg;; x-java-content-handler=com.sun.mail.handlers.image_jpeg 17 | -------------------------------------------------------------------------------- /copyright-exclude: -------------------------------------------------------------------------------- 1 | copyright-exclude 2 | /MANIFEST.MF 3 | /META-INF/services/ 4 | /META-INF/javamail 5 | /META-INF/mailcap 6 | /README 7 | doc/release/ 8 | doc/spec/ 9 | /LICENSE.txt 10 | CONTRIBUTING.md 11 | LICENSE.md 12 | .hgtags 13 | .hgignore 14 | client/src/main/java/simple.mailcap 15 | mail/src/oldtest/java/javax/mail/internet/encodedheaders.data 16 | mail/src/oldtest/java/javax/mail/internet/decodetest 17 | mail.sig 18 | webapp/build.bat 19 | webapp/webapp.README.txt 20 | logging/src/main/java/ 21 | mail/src/main/java/com/sun/mail/util/logging/ 22 | mail/src/main/resources/META-INF/hk2-locator/default 23 | mail/src/test/java/com/sun/mail/util/logging/ 24 | mail/src/test/resources/javax/mail/internet/paramdata 25 | mail/src/test/resources/javax/mail/internet/paramdatanostrict 26 | mail/src/test/resources/javax/mail/internet/tokenlist 27 | mail/src/test/resources/javax/mail/internet/addrlist 28 | mail/src/test/resources/javax/mail/internet/MailDateFormat_old.ser 29 | mail/src/test/resources/javax/mail/internet/MailDateFormat_new.ser 30 | mail/src/main/java/doc-files/speclicense.html 31 | android/activation/src/main/resources/META-INF/mimetypes.default 32 | -------------------------------------------------------------------------------- /mail/src/oldtest/java/javax/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 | -------------------------------------------------------------------------------- /doc/release/NTLMNOTES.txt: -------------------------------------------------------------------------------- 1 | Notes for use of NTLM authentication support with JavaMail 2 | ---------------------------------------------------------- 3 | 4 | Thanks to the efforts of Luis Serralheiro, JavaMail now suports the use 5 | of Microsoft's proprietary NTLM authentication mechanism. This support 6 | within JavaMail is now derived from the NTLM support in the JDK and 7 | included directly in JavaMail, with no external dependencies. 8 | 9 | This release of JavaMail was tested with Microsoft Exchange 5.5 and 2007. 10 | 11 | The SMTP and IMAP providers support the use of NTLM authentication. 12 | The following properties can be used to configure the NTLM support: 13 | 14 | mail..auth.ntlm.domain 15 | The NTLM authentication domain. 16 | 17 | mail..auth.ntlm.flags 18 | NTLM protocol-specific flags. (not currently used) 19 | See http://curl.haxx.se/rfc/ntlm.html#theNtlmFlags for details. 20 | 21 | 22 | NOTE: This capability is very new and has NOT been thoroughly tested. 23 | Please send any feedback or bug reports to us at javamail_ww@oracle.com. 24 | 25 | WARNING: This support, and the APIs and properties used to control it, 26 | should be considered EXPERIMENTAL. They may be changed in the future 27 | in ways that are incompatible with applications using the current APIs 28 | and properties. 29 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | # Source Code Submissions 6 | We welcome your contributions and look forward to collaborating with you. We can only accept source code repository 7 | submissions from users who have signed and returned the Oracle 8 | Contributor Agreement. You will find details and the agreement to sign at this OTN web page: 9 | [Oracle Contributor Agreement](http://www.oracle.com/technetwork/community/oca-486395.html). 10 | 11 | # Other Contributions 12 | For all project Submissions other than source code repository contributions, the following also applies: Oracle does 13 | not claim ownership of Your Submissions. However, in order to fulfill 14 | the purposes of this project, You must give Oracle and all Users 15 | the right to post, access, discuss, use, publish, disseminate, and refine 16 | Your Submissions. 17 | 18 | In legalese: *You hereby grant to Oracle and all 19 | Users a royalty-free, perpetual, irrevocable, worldwide, non-exclusive, 20 | and fully sub-licensable right and license, under Your intellectual 21 | property rights, to reproduce, modify, adapt, publish, translate, create 22 | derivative works from, distribute, perform, display, and use Your 23 | Submissions (in whole or part) and to incorporate or implement them in 24 | other works in any form, media, or technology now known or later 25 | developed, all subject to the obligation to retain any copyright notices 26 | included in Your Submissions. All Users, Oracle, and their 27 | sublicensees are responsible for any modifications they make to the 28 | Submissions of others.* 29 | 30 | Copyright © 2017 Oracle and/or its affiliates. All rights reserved 31 | -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | da19cbb2014590348273983815b35ac8a48717c5 JAVAMAIL-1_4_1 2 | dfb709919353eec53e9dca61b379163186f4d154 1.4.2-beta 3 | 24c89d103755d49d62c67368cea5c13b39c2b399 JAVAMAIL-1_4_2 4 | dfaa56e47386544f4002ade511f2cb0207107734 JAVAMAIL-1_4_3-RC1 5 | 200b5a729cff286d1288b64287dc339233cd5040 JAVAMAIL-1_4_3 6 | 200b5a729cff286d1288b64287dc339233cd5040 JAVAMAIL-1_4_3 7 | 1f3f699ed17aa2c740eb09def5d83dd80671748a JAVAMAIL-1_4_3 8 | 0a99728ee1d1d3d2b27ab76e0db05d9652ee1063 JAVAMAIL-1_4_4-RC1 9 | 9cff25c6d73c8f86ff27f4cb39f7c3c092c34dd7 JAVAMAIL-1_4_4 10 | ce00d5900757397cbc7943b686035e8b27aa9449 JAVAMAIL-1_4_5-RC1 11 | e0ece38db9a0a6b46fe03575bffba6605603761d JAVAMAIL-1_4_5 12 | da6e25608ec175cf0556c6b7b7d1fee40cbe09c5 JAVAMAIL-1_4_6-RC1 13 | b9c00b0cf3cf560077cd3c393c597e4ed9f1bf14 JAVAMAIL-1_4_6 14 | b9c00b0cf3cf560077cd3c393c597e4ed9f1bf14 JAVAMAIL-1_4_6 15 | 3dba8c78634fcb1ffd9a32e840bcfab91a83a551 JAVAMAIL-1_4_6 16 | ba4e734fdfa9916c0e8867b8ea8b4218e276be0e JAVAMAIL-1_4_7 17 | fa1edb81787d0b26828cee438a6d54df619fa6da JAVAMAIL-1_5_0 18 | f6c4d3181f06de080bb3b107382464fad875dfdb JAVAMAIL-1_5_1 19 | 1cbe387fd6841ae0f1c5c6da1e7f872c49255f1d JAVAMAIL-1_5_2 20 | a63663b1bb07ae812f9cf13b03fbcf3e8e129521 JAVAMAIL-1_5_3 21 | 15b5ba9b58712d064178b2530a2b7f89e1d2ebc1 JAVAMAIL-1_5_4 22 | 6f854b7031906581f1c91bf70a13734cbec18e0a JAVAMAIL-1_5_5 23 | ddcb8608cc654e273da1cd11969a41d60c7c07db JAVAMAIL-1_5_6 24 | d90b0230ffde36e71d06cc8efc35c1bc662d3731 JAVAMAIL-1_6_0-RC1 25 | 946643021f7a4facdbf1d98238b2cfee28e656ef JAVAMAIL-1_6_0-RC2 26 | e4cb3b3d3aeefd1afab7e965317604bcd6644700 JAVAMAIL-1_6_0 27 | dfb709919353eec53e9dca61b379163186f4d154 1.4.2-beta 28 | 0000000000000000000000000000000000000000 1.4.2-beta 29 | 48f8142d2dc471a93866f1da6c13436371d9024c JAVAMAIL-1_6_1 30 | d8410291f8ed108e94ce0664e1f1a01d9a52e14a JAVAMAIL_1_6_2 31 | d8410291f8ed108e94ce0664e1f1a01d9a52e14a JAVAMAIL_1_6_2 32 | 0000000000000000000000000000000000000000 JAVAMAIL_1_6_2 33 | 3e658a0fb7b8d36912df0b29f9868946fbffc19c JAVAMAIL-1_6_2 34 | -------------------------------------------------------------------------------- /mail/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 | ja_jp.iso2022-7 ISO2022JP 58 | ja_jp.eucjp EUCJIS 59 | 60 | # these two are not needed in 1.1.6. (since EUC_KR exists 61 | # and KSC5601 will map to the correct converter) 62 | euc-kr KSC5601 63 | euckr KSC5601 64 | 65 | # in JDK 1.1.6 we will no longer need the "us-ascii" convert 66 | us-ascii ISO-8859-1 67 | x-us-ascii ISO-8859-1 68 | 69 | # Chinese charsets are a mess and widely misrepresented. 70 | # gb18030 is a superset of gbk, which is a supserset of cp936/ms936, 71 | # which is a superset of gb2312. 72 | # https://bugzilla.gnome.org/show_bug.cgi?id=446783 73 | # map all of these to gb18030. 74 | gb2312 GB18030 75 | cp936 GB18030 76 | ms936 GB18030 77 | gbk GB18030 78 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/errordetails.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | - Neither the name of Oracle nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | --%> 33 | 34 | <%@ page isErrorPage="true" %> 35 | 36 | 37 | JavaMail errordetails 38 | 39 | 40 | <%= session.getValue("details") %> 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | # 4 | # Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # The contents of this file are subject to the terms of either the GNU 7 | # General Public License Version 2 only ("GPL") or the Common Development 8 | # and Distribution License("CDDL") (collectively, the "License"). You 9 | # may not use this file except in compliance with the License. You can 10 | # obtain a copy of the License at 11 | # https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | # or LICENSE.txt. See the License for the specific 13 | # language governing permissions and limitations under the License. 14 | # 15 | # When distributing the software, include this License Header Notice in each 16 | # file and include the License file at LICENSE.txt. 17 | # 18 | # GPL Classpath Exception: 19 | # Oracle designates this particular file as subject to the "Classpath" 20 | # exception as provided by Oracle in the GPL Version 2 section of the License 21 | # file that accompanied this code. 22 | # 23 | # Modifications: 24 | # If applicable, add the following below the License Header, with the fields 25 | # enclosed by brackets [] replaced by your own identifying information: 26 | # "Portions Copyright [year] [name of copyright owner]" 27 | # 28 | # Contributor(s): 29 | # If you wish your version of this file to be governed by only the CDDL or 30 | # only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | # elects to include this software in this distribution under the [CDDL or GPL 32 | # Version 2] license." If you don't indicate a single choice of license, a 33 | # recipient has the option to distribute your version of this file under 34 | # either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | # its licensees as provided above. However, if you add GPL Version 2 code 36 | # and therefore, elected the GPL Version 2 license, then the option applies 37 | # only if the new code is made subject to such option by the copyright 38 | # holder. 39 | # 40 | 41 | glassfish.module.name=mail 42 | maven.mode.online=false 43 | activation.jar=$HOME/ext/activation.jar 44 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/logout.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | - Neither the name of Oracle nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | --%> 33 | 34 | <%@ page language="java" import="demo.MailUserBean" %> 35 | <%@ page errorPage="errorpage.jsp" %> 36 | 37 | 38 | 39 | 40 | JavaMail logout 41 | 42 | 43 | <% mailuser.logout(); %> 44 | 45 | 46 |

Logged out OK

click here to login 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /mail/src/oldtest/java/javax/mail/internet/socketfactory/TestResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of Oracle nor the names of its 16 | * contributors may be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | public class TestResult { 33 | private static boolean pass = false; 34 | 35 | private TestResult() { } // no public constructor 36 | 37 | public static void reset() { 38 | pass = false; 39 | } 40 | 41 | public static void success() { 42 | pass = true; 43 | } 44 | 45 | public static void print(String s) { 46 | System.out.println((pass ? "SUCCESS: " : "FAIL: ") + s); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/errorpage.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | - Neither the name of Oracle nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | --%> 33 | 34 | <%@ page isErrorPage="true" %> 35 | 36 | 37 | JavaMail errorpage 38 | 39 | 40 |
41 | <% session.putValue("details", exception.toString()); %> 42 |

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

44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/mbox/SunOSMailbox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.mbox; 42 | 43 | public class SunOSMailbox extends SolarisMailbox { 44 | } 45 | -------------------------------------------------------------------------------- /mailhandler/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | module com.sun.mail.util.logging { 42 | exports com.sun.mail.util.logging; 43 | 44 | requires java.mail; 45 | requires java.logging; 46 | } 47 | -------------------------------------------------------------------------------- /logging/src/main/java/maildemo.policy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. 3 | * Copyright (c) 2014 Jason Mehrens. All Rights Reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of Oracle nor the names of its 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | grant { 33 | permission java.util.logging.LoggingPermission "control"; 34 | permission java.util.PropertyPermission "*", "read, write"; 35 | permission java.net.SocketPermission "*", "resolve, connect"; 36 | permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources"; 37 | permission java.io.FilePermission "<>", "read, write"; 38 | permission java.lang.RuntimePermission "getClassLoader"; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /webapp/build.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # 8 | # - Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # 11 | # - Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in the 13 | # documentation and/or other materials provided with the distribution. 14 | # 15 | # - Neither the name of Oracle nor the names of its 16 | # contributors may be used to endorse or promote products derived 17 | # from this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | 32 | mkdir src/docroot/WEB-INF/classes 33 | mkdir src/docroot/WEB-INF/lib 34 | cd src/classes 35 | echo "compiling classes directory" 36 | javac -d ../docroot/WEB-INF/classes demo/*.java 37 | cd ../taglib 38 | echo "compiling lib directroy" 39 | javac -classpath ../docroot/WEB-INF/classes:$CLASSPATH demo/*.java 40 | echo "creating tag library archive" 41 | jar cvf ../docroot/WEB-INF/lib/taglib.jar META-INF demo/*.class 42 | rm demo/*.class 43 | cd ../docroot 44 | echo "creating web archive" 45 | jar cvf ../../javamail.war index.html *.jsp WEB-INF 46 | rm -r WEB-INF/classes 47 | rm -r WEB-INF/lib 48 | cd ../.. 49 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/mbox/InboxFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.mbox; 42 | 43 | public interface InboxFile extends MailFile { 44 | public boolean openLock(String mode); 45 | public void closeLock(); 46 | } 47 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/iap/ResponseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.iap; 42 | 43 | /** 44 | * This class 45 | * 46 | * @author John Mani 47 | */ 48 | 49 | public interface ResponseHandler { 50 | public void handleResponse(Response r); 51 | } 52 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/pop3/Status.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.pop3; 42 | 43 | /** 44 | * Result of POP3 STAT command. 45 | */ 46 | class Status { 47 | int total = 0; // number of messages in the mailbox 48 | int size = 0; // size of the mailbox 49 | }; 50 | -------------------------------------------------------------------------------- /mail/src/oldtest/java/javax/mail/internet/socketfactory/DummyTrustManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of Oracle nor the names of its 16 | * contributors may be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | import javax.net.ssl.X509TrustManager; 33 | import java.security.cert.X509Certificate; 34 | 35 | 36 | /** 37 | * DummyTrustManager 38 | */ 39 | public class DummyTrustManager implements X509TrustManager { 40 | 41 | public void checkClientTrusted(X509Certificate[] cert, String authType) { 42 | // everything is trusted 43 | } 44 | 45 | public void checkServerTrusted(X509Certificate[] cert, String authType) { 46 | // everything is trusted 47 | } 48 | 49 | public X509Certificate[] getAcceptedIssuers() { 50 | return new X509Certificate[0]; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | - Neither the name of Oracle nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | --%> 33 | 34 | <%@ page language="java" import="demo.MailUserBean" %> 35 | <%@ page errorPage="errorpage.jsp" %> 36 | 37 | 38 | 39 | 40 | JavaMail login 41 | 42 | 43 | 44 | 45 | <% 46 | mailuser.login(request.getParameter("hostname"), 47 | request.getParameter("username"), 48 | request.getParameter("password")); 49 | session.setAttribute("folder", mailuser.getFolder()); 50 | %> 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /taglib/src/main/java/demo/MessageTEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of Oracle nor the names of its 16 | * contributors may be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | package demo; 33 | 34 | import javax.servlet.jsp.*; 35 | import javax.servlet.jsp.tagext.*; 36 | 37 | /** 38 | * Extra information class to support the scripting variable created by the 39 | * MessagesTag class. The variable exists outside of the tag. 40 | * 41 | */ 42 | public class MessageTEI extends TagExtraInfo { 43 | 44 | public MessageTEI() { 45 | super(); 46 | } 47 | 48 | public VariableInfo[] getVariableInfo(TagData data) { 49 | VariableInfo info = new VariableInfo(data.getId(),"MessageInfo", 50 | true, VariableInfo.AT_END); 51 | VariableInfo[] varInfo = { info }; 52 | return varInfo; 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/send.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | - Neither the name of Oracle nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | --%> 33 | 34 | <%@ page language="java" %> 35 | <%@ page errorPage="errorpage.jsp" %> 36 | <%@ taglib uri="http://java.sun.com/products/javamail/demo/webapp" 37 | prefix="javamail" %> 38 | 39 | 40 | 41 | JavaMail send 42 | 43 | 44 | 45 | " 47 | sender="<%= request.getParameter(\"from\") %>" 48 | subject="<%= request.getParameter(\"subject\") %>" 49 | > 50 | <%= request.getParameter("text") %> 51 | 52 | 53 |

Message sent successfully

54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /pop3/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | module com.sun.mail.pop3 { 42 | exports com.sun.mail.pop3; 43 | provides javax.mail.Provider with 44 | com.sun.mail.pop3.POP3Provider, com.sun.mail.pop3.POP3SSLProvider; 45 | 46 | requires java.mail; 47 | requires java.logging; 48 | requires java.security.sasl; 49 | } 50 | -------------------------------------------------------------------------------- /smtp/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | module com.sun.mail.smtp { 42 | exports com.sun.mail.smtp; 43 | provides javax.mail.Provider with 44 | com.sun.mail.smtp.SMTPProvider, com.sun.mail.smtp.SMTPSSLProvider; 45 | 46 | requires java.mail; 47 | requires java.logging; 48 | requires java.security.sasl; 49 | } 50 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/mbox/MailFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.mbox; 42 | 43 | import java.io.FileDescriptor; 44 | 45 | public interface MailFile extends FileInterface { 46 | public boolean lock(String mode); 47 | public void unlock(); 48 | public void touchlock(); 49 | public FileDescriptor getFD(); 50 | } 51 | -------------------------------------------------------------------------------- /mail/src/main/resources/javax/mail/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail; 42 | 43 | /** 44 | * Package-private class that defines the version of JavaMail. 45 | * This file is a template for the class that is generated 46 | * at build time. 47 | */ 48 | class Version { 49 | public static final String version = "${mail.version}"; 50 | } 51 | -------------------------------------------------------------------------------- /taglib/src/main/java/demo/ListMessagesTEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of Oracle nor the names of its 16 | * contributors may be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | package demo; 33 | 34 | import javax.servlet.jsp.*; 35 | import javax.servlet.jsp.tagext.*; 36 | 37 | /** 38 | * Extra information class to support the scripting variable created by the 39 | * ListMessagesTag class. The scope of the variable is limited to the body 40 | * of the tag. 41 | */ 42 | public class ListMessagesTEI extends TagExtraInfo { 43 | 44 | public ListMessagesTEI() { 45 | super(); 46 | } 47 | 48 | public VariableInfo[] getVariableInfo(TagData data) { 49 | VariableInfo info = new VariableInfo(data.getId(),"MessageInfo", 50 | true, VariableInfo.NESTED); 51 | VariableInfo[] varInfo = { info }; 52 | return varInfo; 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /taglib/src/main/java/demo/ListAttachmentsTEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of Oracle nor the names of its 16 | * contributors may be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | package demo; 33 | 34 | import javax.servlet.jsp.*; 35 | import javax.servlet.jsp.tagext.*; 36 | 37 | /** 38 | * Extra information class to support the scripting variable created by the 39 | * ListAttachmentsTag class. The scope of the variable is limited to the body 40 | * of the tag. 41 | */ 42 | public class ListAttachmentsTEI extends TagExtraInfo { 43 | 44 | public ListAttachmentsTEI() { 45 | super(); 46 | } 47 | 48 | public VariableInfo[] getVariableInfo(TagData data) { 49 | VariableInfo info = new VariableInfo(data.getId(),"AttachmentInfo", 50 | true, VariableInfo.NESTED); 51 | VariableInfo[] varInfo = { info }; 52 | return varInfo; 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/IMAPProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap; 42 | 43 | import javax.mail.Provider; 44 | 45 | /** 46 | * The IMAP protocol provider. 47 | */ 48 | public class IMAPProvider extends Provider { 49 | public IMAPProvider() { 50 | super(Provider.Type.STORE, "imap", IMAPStore.class.getName(), 51 | "Oracle", null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/mbox/MboxProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.mbox; 42 | 43 | import javax.mail.Provider; 44 | 45 | /** 46 | * The Mbox protocol provider. 47 | */ 48 | public class MboxProvider extends Provider { 49 | public MboxProvider() { 50 | super(Provider.Type.STORE, "mbox", MboxStore.class.getName(), 51 | "Oracle", null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/pop3/POP3Provider.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4 | * 5 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 6 | * 7 | * The contents of this file are subject to the terms of either the GNU 8 | * General Public License Version 2 only ("GPL") or the Common Development 9 | * and Distribution License("CDDL") (collectively, the "License"). You 10 | * may not use this file except in compliance with the License. You can 11 | * obtain a copy of the License at 12 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 13 | * or LICENSE.txt. See the License for the specific 14 | * language governing permissions and limitations under the License. 15 | * 16 | * When distributing the software, include this License Header Notice in each 17 | * file and include the License file at LICENSE.txt. 18 | * 19 | * GPL Classpath Exception: 20 | * Oracle designates this particular file as subject to the "Classpath" 21 | * exception as provided by Oracle in the GPL Version 2 section of the License 22 | * file that accompanied this code. 23 | * 24 | * Modifications: 25 | * If applicable, add the following below the License Header, with the fields 26 | * enclosed by brackets [] replaced by your own identifying information: 27 | * "Portions Copyright [year] [name of copyright owner]" 28 | * 29 | * Contributor(s): 30 | * If you wish your version of this file to be governed by only the CDDL or 31 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 32 | * elects to include this software in this distribution under the [CDDL or GPL 33 | * Version 2] license." If you don't indicate a single choice of license, a 34 | * recipient has the option to distribute your version of this file under 35 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 36 | * its licensees as provided above. However, if you add GPL Version 2 code 37 | * and therefore, elected the GPL Version 2 license, then the option applies 38 | * only if the new code is made subject to such option by the copyright 39 | * holder. 40 | */ 41 | 42 | package com.sun.mail.pop3; 43 | 44 | import javax.mail.Provider; 45 | 46 | /** 47 | * The POP3 protocol provider. 48 | */ 49 | public class POP3Provider extends Provider { 50 | public POP3Provider() { 51 | super(Provider.Type.STORE, "pop3", POP3Store.class.getName(), 52 | "Oracle", null); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /gimap/src/main/java/com/sun/mail/gimap/GmailProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.gimap; 42 | 43 | import javax.mail.Provider; 44 | 45 | /** 46 | * The Gmail IMAP protocol provider. 47 | */ 48 | public class GmailProvider extends Provider { 49 | public GmailProvider() { 50 | super(Provider.Type.STORE, "gimap", GmailStore.class.getName(), 51 | "Oracle", null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/smtp/SMTPProvider.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4 | * 5 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 6 | * 7 | * The contents of this file are subject to the terms of either the GNU 8 | * General Public License Version 2 only ("GPL") or the Common Development 9 | * and Distribution License("CDDL") (collectively, the "License"). You 10 | * may not use this file except in compliance with the License. You can 11 | * obtain a copy of the License at 12 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 13 | * or LICENSE.txt. See the License for the specific 14 | * language governing permissions and limitations under the License. 15 | * 16 | * When distributing the software, include this License Header Notice in each 17 | * file and include the License file at LICENSE.txt. 18 | * 19 | * GPL Classpath Exception: 20 | * Oracle designates this particular file as subject to the "Classpath" 21 | * exception as provided by Oracle in the GPL Version 2 section of the License 22 | * file that accompanied this code. 23 | * 24 | * Modifications: 25 | * If applicable, add the following below the License Header, with the fields 26 | * enclosed by brackets [] replaced by your own identifying information: 27 | * "Portions Copyright [year] [name of copyright owner]" 28 | * 29 | * Contributor(s): 30 | * If you wish your version of this file to be governed by only the CDDL or 31 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 32 | * elects to include this software in this distribution under the [CDDL or GPL 33 | * Version 2] license." If you don't indicate a single choice of license, a 34 | * recipient has the option to distribute your version of this file under 35 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 36 | * its licensees as provided above. However, if you add GPL Version 2 code 37 | * and therefore, elected the GPL Version 2 license, then the option applies 38 | * only if the new code is made subject to such option by the copyright 39 | * holder. 40 | */ 41 | 42 | package com.sun.mail.smtp; 43 | 44 | import javax.mail.Provider; 45 | 46 | /** 47 | * The SMTP protocol provider. 48 | */ 49 | public class SMTPProvider extends Provider { 50 | public SMTPProvider() { 51 | super(Provider.Type.TRANSPORT, "smtp", SMTPTransport.class.getName(), 52 | "Oracle", null); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/IMAPSSLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap; 42 | 43 | import javax.mail.Provider; 44 | 45 | /** 46 | * The IMAP SSL protocol provider. 47 | */ 48 | public class IMAPSSLProvider extends Provider { 49 | public IMAPSSLProvider() { 50 | super(Provider.Type.STORE, "imaps", IMAPSSLStore.class.getName(), 51 | "Oracle", null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /imap/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | module com.sun.mail.imap { 42 | exports com.sun.mail.iap; 43 | exports com.sun.mail.imap; 44 | exports com.sun.mail.imap.protocol; 45 | provides javax.mail.Provider with 46 | com.sun.mail.imap.IMAPProvider, com.sun.mail.imap.IMAPSSLProvider; 47 | 48 | requires java.mail; 49 | requires java.logging; 50 | requires java.security.sasl; 51 | } 52 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/pop3/POP3SSLProvider.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4 | * 5 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 6 | * 7 | * The contents of this file are subject to the terms of either the GNU 8 | * General Public License Version 2 only ("GPL") or the Common Development 9 | * and Distribution License("CDDL") (collectively, the "License"). You 10 | * may not use this file except in compliance with the License. You can 11 | * obtain a copy of the License at 12 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 13 | * or LICENSE.txt. See the License for the specific 14 | * language governing permissions and limitations under the License. 15 | * 16 | * When distributing the software, include this License Header Notice in each 17 | * file and include the License file at LICENSE.txt. 18 | * 19 | * GPL Classpath Exception: 20 | * Oracle designates this particular file as subject to the "Classpath" 21 | * exception as provided by Oracle in the GPL Version 2 section of the License 22 | * file that accompanied this code. 23 | * 24 | * Modifications: 25 | * If applicable, add the following below the License Header, with the fields 26 | * enclosed by brackets [] replaced by your own identifying information: 27 | * "Portions Copyright [year] [name of copyright owner]" 28 | * 29 | * Contributor(s): 30 | * If you wish your version of this file to be governed by only the CDDL or 31 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 32 | * elects to include this software in this distribution under the [CDDL or GPL 33 | * Version 2] license." If you don't indicate a single choice of license, a 34 | * recipient has the option to distribute your version of this file under 35 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 36 | * its licensees as provided above. However, if you add GPL Version 2 code 37 | * and therefore, elected the GPL Version 2 license, then the option applies 38 | * only if the new code is made subject to such option by the copyright 39 | * holder. 40 | */ 41 | 42 | package com.sun.mail.pop3; 43 | 44 | import javax.mail.Provider; 45 | 46 | /** 47 | * The POP3 SSL protocol provider. 48 | */ 49 | public class POP3SSLProvider extends Provider { 50 | public POP3SSLProvider() { 51 | super(Provider.Type.STORE, "pop3s", POP3SSLStore.class.getName(), 52 | "Oracle", null); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /gimap/src/main/java/com/sun/mail/gimap/GmailSSLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.gimap; 42 | 43 | import javax.mail.Provider; 44 | 45 | /** 46 | * The Gmail IMAP protocol provider. 47 | */ 48 | public class GmailSSLProvider extends Provider { 49 | public GmailSSLProvider() { 50 | super(Provider.Type.STORE, "gimaps", GmailSSLStore.class.getName(), 51 | "Oracle", null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/smtp/SMTPSSLProvider.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4 | * 5 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 6 | * 7 | * The contents of this file are subject to the terms of either the GNU 8 | * General Public License Version 2 only ("GPL") or the Common Development 9 | * and Distribution License("CDDL") (collectively, the "License"). You 10 | * may not use this file except in compliance with the License. You can 11 | * obtain a copy of the License at 12 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 13 | * or LICENSE.txt. See the License for the specific 14 | * language governing permissions and limitations under the License. 15 | * 16 | * When distributing the software, include this License Header Notice in each 17 | * file and include the License file at LICENSE.txt. 18 | * 19 | * GPL Classpath Exception: 20 | * Oracle designates this particular file as subject to the "Classpath" 21 | * exception as provided by Oracle in the GPL Version 2 section of the License 22 | * file that accompanied this code. 23 | * 24 | * Modifications: 25 | * If applicable, add the following below the License Header, with the fields 26 | * enclosed by brackets [] replaced by your own identifying information: 27 | * "Portions Copyright [year] [name of copyright owner]" 28 | * 29 | * Contributor(s): 30 | * If you wish your version of this file to be governed by only the CDDL or 31 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 32 | * elects to include this software in this distribution under the [CDDL or GPL 33 | * Version 2] license." If you don't indicate a single choice of license, a 34 | * recipient has the option to distribute your version of this file under 35 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 36 | * its licensees as provided above. However, if you add GPL Version 2 code 37 | * and therefore, elected the GPL Version 2 license, then the option applies 38 | * only if the new code is made subject to such option by the copyright 39 | * holder. 40 | */ 41 | 42 | package com.sun.mail.smtp; 43 | 44 | import javax.mail.Provider; 45 | 46 | /** 47 | * The SMTP SSL protocol provider. 48 | */ 49 | public class SMTPSSLProvider extends Provider { 50 | public SMTPSSLProvider() { 51 | super(Provider.Type.TRANSPORT, "smtps", 52 | SMTPSSLTransport.class.getName(), "Oracle", null); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /gimap/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | module com.sun.mail.gimap { 42 | exports com.sun.mail.gimap; 43 | exports com.sun.mail.gimap.protocol; 44 | provides javax.mail.Provider with 45 | com.sun.mail.gimap.GmailProvider, com.sun.mail.gimap.GmailSSLProvider; 46 | 47 | requires java.mail; 48 | requires java.logging; 49 | requires java.security.sasl; 50 | requires com.sun.mail.imap; 51 | } 52 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/remote/POP3RemoteProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.remote; 42 | 43 | import javax.mail.Provider; 44 | 45 | /** 46 | * The POP3 remote protocol provider. 47 | */ 48 | public class POP3RemoteProvider extends Provider { 49 | public POP3RemoteProvider() { 50 | super(Provider.Type.STORE, "pop3remote", 51 | POP3RemoteStore.class.getName(), "Oracle", null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/smtp/SaslAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.smtp; 42 | 43 | import javax.mail.MessagingException; 44 | 45 | /** 46 | * Interface to make it easier to call SMTPSaslAuthenticator. 47 | */ 48 | 49 | public interface SaslAuthenticator { 50 | public boolean authenticate(String[] mechs, String realm, String authzid, 51 | String u, String p) throws MessagingException; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/pop3/POP3SSLStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.pop3; 42 | 43 | import javax.mail.*; 44 | 45 | /** 46 | * A POP3 Message Store using SSL. Contains only one folder, "INBOX". 47 | * 48 | * @author Bill Shannon 49 | */ 50 | public class POP3SSLStore extends POP3Store { 51 | 52 | public POP3SSLStore(Session session, URLName url) { 53 | super(session, url, "pop3s", true); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /webapp/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. 4 | REM 5 | REM Redistribution and use in source and binary forms, with or without 6 | REM modification, are permitted provided that the following conditions 7 | REM are met: 8 | REM 9 | REM - Redistributions of source code must retain the above copyright 10 | REM notice, this list of conditions and the following disclaimer. 11 | REM 12 | REM - Redistributions in binary form must reproduce the above copyright 13 | REM notice, this list of conditions and the following disclaimer in the 14 | REM documentation and/or other materials provided with the distribution. 15 | REM 16 | REM - Neither the name of Oracle nor the names of its 17 | REM contributors may be used to endorse or promote products derived 18 | REM from this software without specific prior written permission. 19 | REM 20 | REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | REM IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | REM THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | REM PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | REM CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | REM EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | REM PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | REM PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | REM LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | REM NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | REM 32 | mkdir src\docroot\WEB-INF\classes 33 | mkdir src\docroot\WEB-INF\classes\demo 34 | mkdir src\docroot\WEB-INF\lib 35 | cd src\classes 36 | echo compiling classes directory 37 | javac -d ..\docroot\WEB-INF\classes demo\*.java 38 | cd ..\taglib 39 | echo compiling lib directory 40 | javac -classpath "..\docroot\WEB-INF\classes;%CLASSPATH%" demo\*.java 41 | echo creating tag library archive 42 | jar cvf ..\docroot\WEB-INF\lib\taglib.jar META-INF demo\*.class 43 | del demo\*.class 44 | cd ..\docroot 45 | echo creating web archive 46 | jar cvf ..\..\javamail.war index.html *.jsp WEB-INF 47 | cd WEB-INF\classes\demo 48 | del *.* 49 | cd .. 50 | rmdir demo 51 | cd .. 52 | rmdir classes 53 | cd lib 54 | del *.* 55 | cd .. 56 | rmdir lib 57 | cd ..\..\.. 58 | -------------------------------------------------------------------------------- /android/activation/src/main/java/com/sun/activation/registries/MailcapParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.activation.registries; 42 | 43 | /** 44 | * A class to encapsulate Mailcap parsing related exceptions 45 | */ 46 | public class MailcapParseException extends Exception { 47 | 48 | public MailcapParseException() { 49 | super(); 50 | } 51 | 52 | public MailcapParseException(String inInfo) { 53 | super(inInfo); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/protocol/Item.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap.protocol; 42 | 43 | /** 44 | * A tagging interface for all IMAP data items. 45 | * Note that the "name" field of all IMAP items MUST be in uppercase.

46 | * 47 | * See the BODY, BODYSTRUCTURE, ENVELOPE, FLAGS, INTERNALDATE, RFC822DATA, 48 | * RFC822SIZE, and UID classes. 49 | * 50 | * @author John Mani 51 | */ 52 | 53 | public interface Item { 54 | } 55 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/protocol/SaslAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap.protocol; 42 | 43 | import com.sun.mail.iap.ProtocolException; 44 | 45 | /** 46 | * Interface to make it easier to call IMAPSaslAuthenticator. 47 | */ 48 | 49 | public interface SaslAuthenticator { 50 | public boolean authenticate(String[] mechs, String realm, String authzid, 51 | String u, String p) throws ProtocolException; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/mbox/Mailbox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.mbox; 42 | 43 | public abstract class Mailbox { 44 | /** 45 | * Return a MailFile object for the specified user's folder. 46 | */ 47 | public abstract MailFile getMailFile(String user, String folder); 48 | 49 | /** 50 | * Return the file name corresponding to a folder with the given name. 51 | */ 52 | public abstract String filename(String user, String folder); 53 | } 54 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | 48 | 49 | 50 | Listeners and events for the JavaMail API. 51 | This package defines listener classes and event classes used by the classes 52 | defined in the javax.mail package. 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /android/activation/src/main/java/javax/activation/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | javax.activation package 48 | 49 | 50 | 51 |

52 | The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) 53 | API to manage MIME data. 54 |

55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /dsn/src/test/java/com/sun/mail/dsn/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2009-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.dsn; 42 | 43 | import java.io.*; 44 | 45 | /** 46 | * An OutputStream that throws away all data written to it. 47 | */ 48 | public class NullOutputStream extends OutputStream { 49 | 50 | public void write(int b) throws IOException { 51 | } 52 | 53 | public void write(byte[] b) throws IOException { 54 | } 55 | 56 | public void write(byte[] b, int off, int len) throws IOException { 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | javax.mail.util package 48 | 49 | 50 | 51 |

52 | JavaMail API utility classes. 53 | This package specifies utility classes that are useful with 54 | other JavaMail APIs. 55 |

56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/iap/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | com.sun.mail.iap package 48 | 49 | 50 | 51 |

52 | This package includes internal IMAP support classes and 53 | SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 54 |

55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/auth/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | com.sun.mail.auth package 48 | 49 | 50 | 51 |

52 | This package includes internal authentication support classes and 53 | SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 54 |

55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/handlers/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | com.sun.mail.handlers package 48 | 49 | 50 | 51 |

52 | This package includes internal data handler support classes and 53 | SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 54 |

55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/handlers/text_html.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.handlers; 42 | 43 | import javax.activation.ActivationDataFlavor; 44 | 45 | /** 46 | * DataContentHandler for text/html. 47 | * 48 | */ 49 | public class text_html extends text_plain { 50 | private static ActivationDataFlavor[] myDF = { 51 | new ActivationDataFlavor(String.class, "text/html", "HTML String") 52 | }; 53 | 54 | @Override 55 | protected ActivationDataFlavor[] getDataFlavors() { 56 | return myDF; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/protocol/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 46 | 47 | com.sun.mail.imap.protocol package 48 | 49 | 50 | 51 |

52 | This package includes internal IMAP support classes and 53 | SHOULD NOT BE USED DIRECTLY BY APPLICATIONS. 54 |

55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/handlers/image_jpeg.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.handlers; 42 | 43 | import java.awt.Image; 44 | import javax.activation.ActivationDataFlavor; 45 | 46 | /** 47 | * DataContentHandler for image/jpeg. 48 | */ 49 | public class image_jpeg extends image_gif { 50 | private static ActivationDataFlavor[] myDF = { 51 | new ActivationDataFlavor(Image.class, "image/jpeg", "JPEG Image") 52 | }; 53 | 54 | @Override 55 | protected ActivationDataFlavor[] getDataFlavors() { 56 | return myDF; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/iap/LiteralException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.iap; 42 | 43 | /** 44 | * @author Bill Shannon 45 | */ 46 | 47 | public class LiteralException extends ProtocolException { 48 | 49 | private static final long serialVersionUID = -6919179828339609913L; 50 | 51 | /** 52 | * Constructs a LiteralException with the specified Response object. 53 | * 54 | * @param r the response object 55 | */ 56 | public LiteralException(Response r) { 57 | super(r.toString()); 58 | response = r; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /mail/src/test/java/com/sun/mail/test/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2009-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.test; 42 | 43 | import java.io.*; 44 | 45 | /** 46 | * An OutputStream that throws away all data written to it. 47 | */ 48 | public class NullOutputStream extends OutputStream { 49 | 50 | @Override 51 | public void write(int b) throws IOException { 52 | } 53 | 54 | @Override 55 | public void write(byte[] b) throws IOException { 56 | } 57 | 58 | @Override 59 | public void write(byte[] b, int off, int len) throws IOException { 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/StoreListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.event; 42 | 43 | import java.util.*; 44 | 45 | /** 46 | * This is the Listener interface for Store Notifications. 47 | * 48 | * @author John Mani 49 | */ 50 | 51 | public interface StoreListener extends java.util.EventListener { 52 | 53 | /** 54 | * Invoked when the Store generates a notification event. 55 | * 56 | * @param e the StoreEvent 57 | * @see StoreEvent#ALERT 58 | * @see StoreEvent#NOTICE 59 | */ 60 | public void notification(StoreEvent e); 61 | } 62 | -------------------------------------------------------------------------------- /mail/src/test/java/com/sun/mail/util/MimeUtilTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.util; 42 | 43 | import org.junit.runner.RunWith; 44 | import org.junit.runners.Suite.SuiteClasses; 45 | 46 | import com.sun.mail.test.ClassLoaderSuite; 47 | import com.sun.mail.test.ClassLoaderSuite.TestClass; 48 | 49 | /** 50 | * Suite of MimeUtil tests that need to be run in a separate class loader. 51 | */ 52 | @RunWith(ClassLoaderSuite.class) 53 | @TestClass(MimeUtil.class) 54 | @SuiteClasses( { 55 | ContentTypeCleaner.class 56 | }) 57 | public class MimeUtilTestSuite { 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/AppendUID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap; 42 | 43 | import com.sun.mail.iap.*; 44 | 45 | /** 46 | * Information from the APPENDUID response code 47 | * defined by the UIDPLUS extension - 48 | * RFC 4315. 49 | * 50 | * @author Bill Shannon 51 | */ 52 | 53 | public class AppendUID { 54 | public long uidvalidity = -1; 55 | public long uid = -1; 56 | 57 | public AppendUID(long uidvalidity, long uid) { 58 | this.uidvalidity = uidvalidity; 59 | this.uid = uid; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /mbox/src/main/java/com/sun/mail/remote/POP3RemoteStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.remote; 42 | 43 | import javax.mail.*; 44 | import com.sun.mail.pop3.POP3Store; 45 | 46 | /** 47 | * A local store that uses POP3 to populate the INBOX. 48 | * 49 | * @author Bill Shannon 50 | */ 51 | public class POP3RemoteStore extends RemoteStore { 52 | 53 | public POP3RemoteStore(Session session, URLName url) { 54 | super(session, url); 55 | } 56 | 57 | protected Store getRemoteStore(Session session, URLName url) { 58 | return new POP3Store(session, url); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /mail/src/test/java/javax/mail/internet/MimeMessageTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.internet; 42 | 43 | import org.junit.runner.RunWith; 44 | import org.junit.runners.Suite.SuiteClasses; 45 | 46 | import com.sun.mail.test.ClassLoaderSuite; 47 | import com.sun.mail.test.ClassLoaderSuite.TestClass; 48 | 49 | /** 50 | * Suite of MimeMessage tests that need to be run in a separate class loader. 51 | */ 52 | @RunWith(ClassLoaderSuite.class) 53 | @TestClass(MimeMessage.class) 54 | @SuiteClasses( { 55 | AllowEncodedMessages.class 56 | }) 57 | public class MimeMessageTestSuite { 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/test/java/javax/mail/internet/NewsAddressTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.internet; 42 | 43 | import org.junit.*; 44 | import static org.junit.Assert.assertEquals; 45 | 46 | /** 47 | * Test the NewsAddress class. 48 | * 49 | * XXX - for now, just some simple regression tests for reported bugs. 50 | */ 51 | public class NewsAddressTest { 52 | 53 | @Test 54 | public void testReflexiveEquality() throws Exception { 55 | NewsAddress a = new NewsAddress(); 56 | assertEquals(a, a); // bug 6365 57 | a = new NewsAddress("net.unix"); 58 | assertEquals(a, a); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/MailSessionDefinitions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2012-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail; 42 | 43 | import java.lang.annotation.Target; 44 | import java.lang.annotation.Retention; 45 | import java.lang.annotation.ElementType; 46 | import java.lang.annotation.RetentionPolicy; 47 | 48 | /** 49 | * Declares one or more MailSessionDefinition annotations. 50 | * 51 | * @see MailSessionDefinition 52 | * @since JavaMail 1.5 53 | */ 54 | @Target({ElementType.TYPE}) 55 | @Retention(RetentionPolicy.RUNTIME) 56 | public @interface MailSessionDefinitions { 57 | MailSessionDefinition[] value(); 58 | } 59 | -------------------------------------------------------------------------------- /mailapi/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | module java.mail { 42 | exports javax.mail; 43 | exports javax.mail.event; 44 | exports javax.mail.internet; 45 | exports javax.mail.search; 46 | exports javax.mail.util; 47 | exports com.sun.mail.util; 48 | exports com.sun.mail.auth; 49 | exports com.sun.mail.handlers; 50 | 51 | requires transitive java.activation; 52 | requires java.logging; 53 | requires java.xml; // for text/xml handler 54 | requires java.desktop; // for image/jpeg handler 55 | requires java.security.sasl; // for OAuth2 support 56 | uses javax.mail.Provider; 57 | } 58 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/MessageCountAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.event; 42 | 43 | /** 44 | * The adapter which receives MessageCount events. 45 | * The methods in this class are empty; this class is provided as a 46 | * convenience for easily creating listeners by extending this class 47 | * and overriding only the methods of interest. 48 | * 49 | * @author John Mani 50 | */ 51 | public abstract class MessageCountAdapter implements MessageCountListener { 52 | @Override 53 | public void messagesAdded(MessageCountEvent e) {} 54 | @Override 55 | public void messagesRemoved(MessageCountEvent e) {} 56 | } 57 | -------------------------------------------------------------------------------- /webapp/src/main/webapp/folders.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | 3 | Copyright (c) 2001-2010 Oracle and/or its affiliates. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | - Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | - Neither the name of Oracle nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | --%> 33 | 34 | <%@ page language="java" import="javax.mail.*, demo.MailUserBean" %> 35 | <%@ page errorPage="errorpage.jsp" %> 36 | 37 | 38 | 39 | 40 | JavaMail folders 41 | 42 | 43 | 44 | 45 |
46 | 47 | Welcome to JavaMail!
48 | 49 | 50 |
53 |
56 | 57 | 58 |
60 | 63 |
51 | 52 | FolderName 54 | 55 | Messages
59 | Inbox 61 | <%= mailuser.getMessageCount() %> 62 |
64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/CopyUID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap; 42 | 43 | import com.sun.mail.imap.protocol.UIDSet; 44 | 45 | /** 46 | * Information from the COPYUID response code 47 | * defined by the UIDPLUS extension - 48 | * RFC 4315. 49 | * 50 | * @author Bill Shannon 51 | */ 52 | 53 | public class CopyUID { 54 | public long uidvalidity = -1; 55 | public UIDSet[] src; 56 | public UIDSet[] dst; 57 | 58 | public CopyUID(long uidvalidity, UIDSet[] src, UIDSet[] dst) { 59 | this.uidvalidity = uidvalidity; 60 | this.src = src; 61 | this.dst = dst; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/IMAPSSLStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap; 42 | 43 | import javax.mail.*; 44 | 45 | /** 46 | * This class provides access to an IMAP message store over SSL. 47 | */ 48 | 49 | public class IMAPSSLStore extends IMAPStore { 50 | 51 | /** 52 | * Constructor that takes a Session object and a URLName that 53 | * represents a specific IMAP server. 54 | * 55 | * @param session the Session 56 | * @param url the URLName of this store 57 | */ 58 | public IMAPSSLStore(Session session, URLName url) { 59 | super(session, url, "imaps", true); // call super constructor 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/smtp/SMTPSSLTransport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.smtp; 42 | 43 | import javax.mail.*; 44 | 45 | /** 46 | * This class implements the Transport abstract class using SMTP 47 | * over SSL for message submission and transport. 48 | * 49 | * @author Bill Shannon 50 | */ 51 | 52 | public class SMTPSSLTransport extends SMTPTransport { 53 | 54 | /** 55 | * Constructor. 56 | * 57 | * @param session the Session 58 | * @param urlname the URLName of this transport 59 | */ 60 | public SMTPSSLTransport(Session session, URLName urlname) { 61 | super(session, urlname, "smtps", true); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /mail/src/test/java/javax/mail/internet/ContentDispositionTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2009-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.internet; 42 | 43 | import org.junit.runner.RunWith; 44 | import org.junit.runners.Suite.SuiteClasses; 45 | 46 | import com.sun.mail.test.ClassLoaderSuite; 47 | import com.sun.mail.test.ClassLoaderSuite.TestClass; 48 | 49 | /** 50 | * Suite of ParameterList tests that need to be run in a separate class loader. 51 | */ 52 | @RunWith(ClassLoaderSuite.class) 53 | @TestClass(ContentDisposition.class) 54 | @SuiteClasses( { 55 | ContentDispositionNoStrict.class, 56 | ContentDispositionStrict.class 57 | }) 58 | public class ContentDispositionTestSuite { 59 | } 60 | -------------------------------------------------------------------------------- /android/activation/src/main/java/com/sun/activation/registries/MimeTypeEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.activation.registries; 42 | 43 | import java.lang.*; 44 | 45 | public class MimeTypeEntry { 46 | private String type; 47 | private String extension; 48 | 49 | public MimeTypeEntry(String mime_type, String file_ext) { 50 | type = mime_type; 51 | extension = file_ext; 52 | } 53 | 54 | public String getMIMEType() { 55 | return type; 56 | } 57 | 58 | public String getFileExtension() { 59 | return extension; 60 | } 61 | 62 | public String toString() { 63 | return "MIMETypeEntry: " + type + ", " + extension; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /mail/src/test/java/javax/mail/internet/MimeBodyPartTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2015-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.internet; 42 | 43 | import org.junit.runner.RunWith; 44 | import org.junit.runners.Suite.SuiteClasses; 45 | 46 | import com.sun.mail.test.ClassLoaderSuite; 47 | import com.sun.mail.test.ClassLoaderSuite.TestClass; 48 | 49 | /** 50 | * Suite of MimeBodyPart tests that need to be run in a separate class loader. 51 | */ 52 | @RunWith(ClassLoaderSuite.class) 53 | @TestClass(MimeBodyPart.class) 54 | @SuiteClasses( { 55 | NoEncodeFileName.class, 56 | EncodeFileName.class, 57 | EncodeFileNameNoEncodeParameters.class 58 | }) 59 | public class MimeBodyPartTestSuite { 60 | } 61 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/FolderAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.event; 42 | 43 | /** 44 | * The adapter which receives Folder events. 45 | * The methods in this class are empty; this class is provided as a 46 | * convenience for easily creating listeners by extending this class 47 | * and overriding only the methods of interest. 48 | * 49 | * @author John Mani 50 | */ 51 | public abstract class FolderAdapter implements FolderListener { 52 | @Override 53 | public void folderCreated(FolderEvent e) {} 54 | @Override 55 | public void folderRenamed(FolderEvent e) {} 56 | @Override 57 | public void folderDeleted(FolderEvent e) {} 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/MessageChangedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.event; 42 | 43 | import java.util.*; 44 | 45 | /** 46 | * This is the Listener interface for MessageChanged events 47 | * 48 | * @author John Mani 49 | */ 50 | 51 | public interface MessageChangedListener extends java.util.EventListener { 52 | /** 53 | * Invoked when a message is changed. The change-type specifies 54 | * what changed. 55 | * 56 | * @param e the MessageChangedEvent 57 | * @see MessageChangedEvent#FLAGS_CHANGED 58 | * @see MessageChangedEvent#ENVELOPE_CHANGED 59 | */ 60 | public void messageChanged(MessageChangedEvent e); 61 | } 62 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/MessageAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail; 42 | 43 | /** 44 | * An interface optionally implemented by DataSources to 45 | * supply information to a DataContentHandler about the 46 | * message context in which the data content object is operating. 47 | * 48 | * @see javax.mail.MessageContext 49 | * @see javax.activation.DataSource 50 | * @see javax.activation.DataContentHandler 51 | * @since JavaMail 1.1 52 | */ 53 | public interface MessageAware { 54 | /** 55 | * Return the message context. 56 | * 57 | * @return the message context 58 | */ 59 | public MessageContext getMessageContext(); 60 | } 61 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/ConnectionAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.event; 42 | 43 | /** 44 | * The adapter which receives connection events. 45 | * The methods in this class are empty; this class is provided as a 46 | * convenience for easily creating listeners by extending this class 47 | * and overriding only the methods of interest. 48 | * 49 | * @author John Mani 50 | */ 51 | public abstract class ConnectionAdapter implements ConnectionListener { 52 | @Override 53 | public void opened(ConnectionEvent e) {} 54 | @Override 55 | public void disconnected(ConnectionEvent e) {} 56 | @Override 57 | public void closed(ConnectionEvent e) {} 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/test/java/javax/mail/internet/EncodeFileNameNoEncodeParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2015-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.internet; 42 | 43 | import org.junit.*; 44 | 45 | /** 46 | * Test "mail.mime.encodefilename" System property set to "true" 47 | * and "mail.mime.encodeparameters" set to "false". 48 | */ 49 | public class EncodeFileNameNoEncodeParameters extends EncodeFileName { 50 | 51 | @BeforeClass 52 | public static void before() { 53 | System.out.println("EncodeFileNameNoEncodeParameters"); 54 | System.setProperty("mail.mime.charset", "utf-8"); 55 | System.setProperty("mail.mime.encodefilename", "true"); 56 | System.setProperty("mail.mime.encodeparamters", "false"); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /android/activation/src/main/java/javax/activation/MimeTypeParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.activation; 42 | 43 | /** 44 | * A class to encapsulate MimeType parsing related exceptions. 45 | */ 46 | public class MimeTypeParseException extends Exception { 47 | 48 | /** 49 | * Constructs a MimeTypeParseException with no specified detail message. 50 | */ 51 | public MimeTypeParseException() { 52 | super(); 53 | } 54 | 55 | /** 56 | * Constructs a MimeTypeParseException with the specified detail message. 57 | * 58 | * @param s the detail message. 59 | */ 60 | public MimeTypeParseException(String s) { 61 | super(s); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/iap/Literal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.iap; 42 | 43 | import java.io.*; 44 | 45 | /** 46 | * An interface for objects that provide data dynamically for use in 47 | * a literal protocol element. 48 | * 49 | * @author Bill Shannon 50 | */ 51 | 52 | public interface Literal { 53 | /** 54 | * Return the size of the data. 55 | * 56 | * @return the size of the data 57 | */ 58 | public int size(); 59 | 60 | /** 61 | * Write the data to the OutputStream. 62 | * 63 | * @param os the output stream 64 | * @exception IOException for I/O errors 65 | */ 66 | public void writeTo(OutputStream os) throws IOException; 67 | } 68 | -------------------------------------------------------------------------------- /mail/src/main/java/javax/mail/event/TransportAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package javax.mail.event; 42 | 43 | /** 44 | * The adapter which receives Transport events. 45 | * The methods in this class are empty; this class is provided as a 46 | * convenience for easily creating listeners by extending this class 47 | * and overriding only the methods of interest. 48 | * 49 | * @author John Mani 50 | */ 51 | public abstract class TransportAdapter implements TransportListener { 52 | @Override 53 | public void messageDelivered(TransportEvent e) {} 54 | @Override 55 | public void messageNotDelivered(TransportEvent e) {} 56 | @Override 57 | public void messagePartiallyDelivered(TransportEvent e) {} 58 | } 59 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/imap/protocol/UID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.imap.protocol; 42 | 43 | import com.sun.mail.iap.*; 44 | 45 | /** 46 | * This class represents the UID data item. 47 | * 48 | * @author John Mani 49 | */ 50 | 51 | public class UID implements Item { 52 | 53 | static final char[] name = {'U','I','D'}; 54 | public int seqnum; 55 | 56 | public long uid; 57 | 58 | /** 59 | * Constructor. 60 | * 61 | * @param r the FetchResponse 62 | * @exception ParsingException for parsing failures 63 | */ 64 | public UID(FetchResponse r) throws ParsingException { 65 | seqnum = r.getNumber(); 66 | r.skipSpaces(); 67 | uid = r.readLong(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /mail/src/main/java/com/sun/mail/util/DecodingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package com.sun.mail.util; 42 | 43 | import java.io.IOException; 44 | 45 | /** 46 | * A special IOException that indicates a failure to decode data due 47 | * to an error in the formatting of the data. This allows applications 48 | * to distinguish decoding errors from other I/O errors. 49 | * 50 | * @author Bill Shannon 51 | */ 52 | 53 | public class DecodingException extends IOException { 54 | 55 | private static final long serialVersionUID = -6913647794421459390L; 56 | 57 | /** 58 | * Constructor. 59 | * 60 | * @param s the exception message 61 | */ 62 | public DecodingException(String s) { 63 | super(s); 64 | } 65 | } 66 | --------------------------------------------------------------------------------