diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9007c0b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+SOURCES/javamail-1.6.2.tar.gz
diff --git a/.javamail.metadata b/.javamail.metadata
new file mode 100644
index 0000000..1d50ccc
--- /dev/null
+++ b/.javamail.metadata
@@ -0,0 +1 @@
+e6dd4e61e0f8c32dacbb502de8b19d52c1f70c3a SOURCES/javamail-1.6.2.tar.gz
diff --git a/SOURCES/0000-Disable-tests-that-use-networking.patch b/SOURCES/0000-Disable-tests-that-use-networking.patch
new file mode 100644
index 0000000..6ee8314
--- /dev/null
+++ b/SOURCES/0000-Disable-tests-that-use-networking.patch
@@ -0,0 +1,40 @@
+From 158e5fdcc7cbe38067a8e83d975cfe32999e650d Mon Sep 17 00:00:00 2001
+From: Marian Koncek <mkoncek@redhat.com>
+Date: Wed, 23 Oct 2019 12:55:51 +0200
+Subject: [PATCH] Disable tests that use networking
+
+---
+ .../test/java/com/sun/mail/util/WriteTimeoutSocketTest.java    | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java b/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java
+index b1d80d3..b04c827 100644
+--- a/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java
++++ b/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java
+@@ -62,6 +62,7 @@ import com.sun.mail.test.TestSocketFactory;
+ import com.sun.mail.test.TestSSLSocketFactory;
+ 
+ import org.junit.Test;
++import org.junit.Ignore;
+ import org.junit.Rule;
+ import org.junit.rules.Timeout;
+ import static org.junit.Assert.fail;
+@@ -111,6 +112,7 @@ public final class WriteTimeoutSocketTest {
+      * Test write timeouts with SSL sockets.
+      */
+     @Test
++    @Ignore
+     public void testSSL() {
+ 	final Properties properties = new Properties();
+ 	properties.setProperty("mail.imap.host", "localhost");
+@@ -127,6 +129,7 @@ public final class WriteTimeoutSocketTest {
+      * Test write timeouts with a custom SSL socket factory.
+      */
+     @Test
++    @Ignore
+     public void testSSLSocketFactory() throws Exception {
+ 	final Properties properties = new Properties();
+ 	properties.setProperty("mail.imap.host", "localhost");
+-- 
+2.21.0
+
diff --git a/SPECS/javamail.spec b/SPECS/javamail.spec
new file mode 100644
index 0000000..1090d15
--- /dev/null
+++ b/SPECS/javamail.spec
@@ -0,0 +1,226 @@
+Name:           javamail
+Version:        1.6.2
+Release:        2%{?dist}
+Summary:        Java Mail API
+License:        CDDL-1.0 or GPLv2 with exceptions
+URL:            http://www.oracle.com/technetwork/java/javamail
+BuildArch:      noarch
+
+Source:         https://github.com/javaee/javamail/archive/JAVAMAIL-1_6_2.tar.gz#/%{name}-%{version}.tar.gz
+
+Patch0:         0000-Disable-tests-that-use-networking.patch
+
+BuildRequires:  maven-local
+BuildRequires:  mvn(junit:junit)
+BuildRequires:  mvn(net.java:jvnet-parent:pom:)
+BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
+BuildRequires:  mvn(org.apache.maven.plugins:maven-dependency-plugin)
+BuildRequires:  mvn(org.apache.maven.plugins:maven-enforcer-plugin)
+BuildRequires:  mvn(org.apache.maven.plugins:maven-source-plugin)
+BuildRequires:  mvn(org.codehaus.mojo:build-helper-maven-plugin)
+
+# Adapted from the classpathx-mail (and JPackage glassfish-javamail) Provides.
+Provides:       javamail-monolithic = %{version}-%{release}
+
+Provides:       javax.mail
+
+%description
+The JavaMail API provides a platform-independent and protocol-independent
+framework to build mail and messaging applications.
+
+%package javadoc
+Summary:        Javadoc for %{name}
+
+%description javadoc
+%{summary}.
+
+%prep
+%setup -q -c
+pushd javamail-JAVAMAIL-1_6_2
+find -name module-info.java -delete
+mv * ..
+popd
+rm -rf javamail-JAVAMAIL-1_6_2
+
+%patch0 -p1
+
+# -Werror is harmful - harmless compiler warnings cause build failure
+%pom_xpath_remove "pom:arg[text()='-Werror']" mail
+
+# Use bundled fork of JAF which is not available in OpenJDK 11
+%pom_change_dep javax.activation:activation com.sun.mail:android-activation:\${mail.version} mail
+cp -p {android/,}mail/src/main/java/com/sun/mail/handlers/handler_base.java
+
+# Test requires full JAF and does not work with bundled JAF
+rm -f mail/src/test/java/com/sun/mail/handlers/TextXmlTest.java
+
+# Disable unneeded modules
+%pom_disable_module mail android
+%pom_disable_module dsn
+
+# Unneeded plugin
+%pom_remove_plugin :animal-sniffer-maven-plugin android
+
+# Remove profiles containing demos and other stuff that is not
+# supposed to be deployable.
+%pom_xpath_remove /pom:project/pom:profiles
+
+# osgiversion-maven-plugin is used to set ${mail.osgiversion} property
+# based on ${project.version}. We don't have osgiversion plugin in
+# Fedora so we'll set ${mail.osgiversion} explicitly.
+%pom_remove_plugin -r org.glassfish.hk2:osgiversion-maven-plugin
+%pom_xpath_inject /pom:project/pom:properties "<mail.osgiversion>%{version}</mail.osgiversion>"
+%pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true</_nouses>"
+
+# Alternative names for super JAR containing API and implementation.
+%mvn_alias com.sun.mail:mailapi javax.mail:mailapi
+%mvn_alias com.sun.mail:javax.mail javax.mail:mail \
+           org.eclipse.jetty.orbit:javax.mail.glassfish
+%mvn_file "com.sun.mail:{javax.mail}" %{name}/@1 %{name}/mail
+
+%build
+%mvn_build
+
+%install
+%mvn_install
+
+install -d -m 755 %{buildroot}%{_javadir}/javax.mail/
+ln -sf ../%{name}/javax.mail.jar %{buildroot}%{_javadir}/javax.mail/
+
+%files -f .mfiles
+%doc mail/src/main/java/overview.html
+%doc mail/src/main/resources/META-INF/LICENSE.txt
+%{_javadir}/javax.mail/
+
+%files javadoc -f .mfiles-javadoc
+%doc mail/src/main/resources/META-INF/LICENSE.txt
+
+%changelog
+* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.6.2-2
+- Mass rebuild for javapackages-tools 201902
+
+* Wed Oct 23 2019 Marian Koncek <mkoncek@redhat.com> - 1.6.2-1
+- Update to upstream version 1.6.2
+
+* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.2-8
+- Mass rebuild for javapackages-tools 201901
+
+* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+* Thu Nov 09 2017 Michael Simacek <msimacek@redhat.com> - 1.5.2-6
+- Specify CDDL license version
+
+* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Fri Mar 6 2015 Alexander Kurtakov <akurtako@redhat.com> 1.5.2-1
+- Update to upstream 1.5.2 using upstream tarball.
+
+* Fri Mar 6 2015 Alexander Kurtakov <akurtako@redhat.com> 1.5.1-5
+- Remove javax.activation:activation dependency.
+
+* Mon Aug  4 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.1-4
+- Fix build-requires on jvnet-parent
+
+* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+* Mon Mar 31 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.1-2
+- Regenerate build-requires
+
+* Mon Mar 31 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.1-1
+- Update to upstream version 1.5.1
+
+* Mon Mar 31 2014 Alexander Kurtakov <akurtako@redhat.com> 1.5.0-8
+- Do not generate uses clauses for osgi -too strict linking.
+
+* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.5.0-7
+- Use Requires: java-headless rebuild (#1067528)
+
+* Mon Aug 12 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.5.0-6
+- Add forgotten provides
+
+* Mon Aug 12 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.5.0-5
+- Add javax.mail provides and directory
+
+* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.0-3
+- Add compat symlink for javax.mail:mail
+
+* Mon Jun 24 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.0-2
+- Add Maven alias for javax.mail:mail
+
+* Mon Jun 24 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.0-1
+- Update to upstream version 1.5.0
+
+* Thu Mar  7 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.6-1
+- Update to upstream version 1.4.6
+
+* Mon Mar  4 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.3-16
+- Add depmap for org.eclipse.jetty.orbit
+- Resolves: rhbz#917624
+
+* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-15
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 1.4.3-14
+- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
+- Replace maven BuildRequires with maven-local
+
+* Thu Oct 11 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.3-13
+- Fix URL
+
+* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jun 11 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.3-11
+- Update OSGi manifest patch
+
+* Tue May 29 2012 Gerard Ryan <galileo@fedoraproject.org> - 1.4.3-10
+- Add extra information to OSGi manifest
+- Fix rpmlint error about mavendepmapfragdir
+
+* Wed Mar 21 2012 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-9
+- Drop tomcat6-jsp-api requires - it's dependency management not dependency, hence not needed.
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Tue Nov 29 2011 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-7
+- Build with maven3.
+- Adapt to current guidelines.
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Wed Dec  8 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.4.3-5
+- Fix pom filenames (#655806)
+- Versionless jars/javadocs (new guidelines)
+- Migrate to tomcat6 (#652004)
+- Other cleanups
+
+* Wed Sep 8 2010 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-4
+- Add surefire provider BR.
+
+* Wed Sep 8 2010 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-3
+- Drop gcj_support.
+- Use javadoc:aggregate.
+
+* Fri Jan  8 2010 Mary Ellen Foster <mefoster at gmail.com> 1.4.3-2
+- Remove unnecessary (build)requirement tomcat5-servlet-2.4-api
+- Move jar files into subdirectory
+
+* Wed Dec  2 2009 Mary Ellen Foster <mefoster at gmail.com> 1.4.3-1
+- Initial package