diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c29adc7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+SOURCES/javamail-1.4.6-clean.tar.gz
diff --git a/.javamail.metadata b/.javamail.metadata
new file mode 100644
index 0000000..5fb2f7e
--- /dev/null
+++ b/.javamail.metadata
@@ -0,0 +1 @@
+269ac88b1da0d80e3727e86ff3f686b18786e4e9 SOURCES/javamail-1.4.6-clean.tar.gz
diff --git a/SOURCES/create-tarball.sh b/SOURCES/create-tarball.sh
new file mode 100755
index 0000000..0bee6ff
--- /dev/null
+++ b/SOURCES/create-tarball.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -C -e
+
+set -x
+rm -Rf javamail~mercurial/
+hg clone http://kenai.com/hg/javamail~mercurial
+( cd ./javamail~mercurial && hg archive -r JAVAMAIL-1_4_6 -X doc/ ../javamail-1.4.6 )
+rm -Rf javamail~mercurial/
+
+tar cvf javamail-1.4.6-clean.tar.gz javamail-1.4.6/
+
diff --git a/SPECS/javamail.spec b/SPECS/javamail.spec
new file mode 100644
index 0000000..f437d33
--- /dev/null
+++ b/SPECS/javamail.spec
@@ -0,0 +1,161 @@
+Name: javamail
+Version: 1.4.6
+Release: 8%{?dist}
+Summary: Java Mail API
+License: CDDL or GPLv2 with exceptions
+URL: http://www.oracle.com/technetwork/java/javamail
+BuildArch: noarch
+
+# ./create-tarball.sh
+Source0: javamail-1.4.6-clean.tar.gz
+Source1: create-tarball.sh
+
+BuildRequires: maven-local
+BuildRequires: jvnet-parent
+BuildRequires: maven-assembly-plugin
+BuildRequires: maven-dependency-plugin
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-plugin-bundle
+BuildRequires: maven-plugin-build-helper
+
+# Adapted from the classpathx-mail (and JPackage glassfish-javamail) Provides.
+Provides: javamail-monolithic = %{version}-%{release}
+
+%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
+
+# Remove profiles containing demos and other stuff that is not
+# supposed to be deployable.
+%pom_xpath_remove /pom:project/pom:profiles
+
+# Upstream uses maven-dependency-plugin for downloading and unpacking binary JARs
+# instead of specifying proper dependencies between modules
+%pom_xpath_inject "pom:project" "" mailapi
+%pom_add_dep 'com.sun.mail:javax.mail:${mail.version}' mailapi
+
+%pom_xpath_inject "pom:project" "" mailapijar
+%pom_add_dep 'com.sun.mail:javax.mail:${mail.version}' mailapijar
+
+%pom_xpath_inject "pom:project" "" parent-distrib
+%pom_add_dep 'com.sun.mail:javax.mail:${mail.version}' parent-distrib
+
+# Install parent POM
+%pom_xpath_inject pom:project/pom:modules "parent-distrib"
+
+# 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 org.glassfish.hk2:osgiversion-maven-plugin
+%pom_xpath_inject /pom:project/pom:properties "%{version}"
+
+# Alternative names for super JAR containing API and implementation.
+%mvn_alias javax.mail:javax.mail-api javax.mail:mailapi \
+ org.eclipse.jetty.orbit:javax.mail.glassfish
+
+%build
+%mvn_build
+
+%install
+%mvn_install
+
+%files -f .mfiles
+%doc mail/src/main/java/overview.html
+%doc mail/src/main/resources/META-INF/LICENSE.txt
+
+%files javadoc -f .mfiles-javadoc
+%doc mail/src/main/resources/META-INF/LICENSE.txt
+
+%changelog
+* Fri Dec 27 2013 Daniel Mach - 1.4.6-8
+- Mass rebuild 2013-12-27
+
+* Fri Aug 02 2013 Michal Srb - 1.4.6-7
+- Add create-tarball.sh script to SRPM
+
+* Fri Aug 02 2013 Michal Srb - 1.4.6-6
+- Add create-tarball.sh script to SRPM
+
+* Fri Jul 26 2013 Michal Srb - 1.4.6-5
+- Clean up tarball
+
+* Fri Jun 28 2013 Mikolaj Izdebski - 1.4.6-4
+- Rebuild to regenerate API documentation
+- Resolves: CVE-2013-1571
+
+* Mon Jun 24 2013 Mikolaj Izdebski - 1.4.6-3
+- Resore Maven aliases to point to super JAR
+
+* Wed Jun 12 2013 Michal Srb - 1.4.6-2
+- Fix FTBFS (Resolves: #973560)
+
+* Thu Mar 7 2013 Mikolaj Izdebski - 1.4.6-1
+- Update to upstream version 1.4.6
+
+* Mon Mar 4 2013 Mikolaj Izdebski - 1.4.3-16
+- Add depmap for org.eclipse.jetty.orbit
+- Resolves: rhbz#917624
+
+* Thu Feb 14 2013 Fedora Release Engineering - 1.4.3-15
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Wed Feb 06 2013 Java SIG - 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 - 1.4.3-13
+- Fix URL
+
+* Thu Jul 19 2012 Fedora Release Engineering - 1.4.3-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon Jun 11 2012 Mikolaj Izdebski - 1.4.3-11
+- Update OSGi manifest patch
+
+* Tue May 29 2012 Gerard Ryan - 1.4.3-10
+- Add extra information to OSGi manifest
+- Fix rpmlint error about mavendepmapfragdir
+
+* Wed Mar 21 2012 Alexander Kurtakov 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 - 1.4.3-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Tue Nov 29 2011 Alexander Kurtakov 1.4.3-7
+- Build with maven3.
+- Adapt to current guidelines.
+
+* Wed Feb 09 2011 Fedora Release Engineering - 1.4.3-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Wed Dec 8 2010 Stanislav Ochotnicky - 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 1.4.3-4
+- Add surefire provider BR.
+
+* Wed Sep 8 2010 Alexander Kurtakov 1.4.3-3
+- Drop gcj_support.
+- Use javadoc:aggregate.
+
+* Fri Jan 8 2010 Mary Ellen Foster 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 1.4.3-1
+- Initial package