Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions conf/spotbugs-exclude-filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
<!-- the javadoc states that the default character encoding is used -->
<!-- when converting a string into a byte[] -->
<Match>
<Class name="org.apache.commons.mail.util.MimeMessageUtils" />
<Method name="createMimeMessage" params="javax.mail.Session, java.lang.String" returns="javax.mail.internet.MimeMessage" />
<Class name="org.apache.commons.mail2.util.MimeMessageUtils" />
<Method name="createMimeMessage" params="jakarta.mail.Session, java.lang.String" returns="jakarta.mail.internet.MimeMessage" />
<Bug pattern="DM_DEFAULT_ENCODING" />
</Match>

<!-- printStackTrace is supposed to use the default character encoding -->
<Match>
<Class name="org.apache.commons.mail.EmailException" />
<Class name="org.apache.commons.mail2.EmailException" />
<Method name="printStackTrace" params="java.io.PrintStream" returns="void" />
<Bug pattern="DM_DEFAULT_ENCODING" />
</Match>
Expand Down
31 changes: 18 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
<version>58</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>commons-email</artifactId>
<version>1.6.0-SNAPSHOT</version>
<artifactId>commons-email2</artifactId>
<version>2.0.0-SNAPSHOT</version>
<name>Apache Commons Email</name>

<inceptionYear>2001</inceptionYear>
<description>
Apache Commons Email aims to provide an API for sending email. It is built on top of
the JavaMail API, which it aims to simplify.
the JakartaMail API, which it aims to simplify.
</description>

<url>https://commons.apache.org/proper/commons-email/</url>
Expand Down Expand Up @@ -239,13 +239,17 @@
<name>Vegard Stuen</name>
<email>vegard.stuen@gmail.com</email>
</contributor>
<contributor>
<name>Réda Housni Alaoui</name>
<email>reda-alaoui@hey.com</email>
</contributor>
</contributors>

<dependencies>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.6.7</version>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-mail</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -271,9 +275,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.subethamail</groupId>
<groupId>com.github.davidmoten</groupId>
<artifactId>subethasmtp</artifactId>
<version>3.1.7</version>
<version>6.0.5</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -308,13 +312,13 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<commons.componentid>email</commons.componentid>
<commons.module.name>org.apache.commons.mail</commons.module.name>
<commons.module.name>org.apache.commons.mail2</commons.module.name>
<commons.jira.id>EMAIL</commons.jira.id>
<commons.jira.pid>12310474</commons.jira.pid>
<commons.release.version>1.6.0</commons.release.version>
<commons.release.desc>(Java 8)</commons.release.desc>
<commons.rc.version>RC1</commons.rc.version>
<commons.bc.version>1.5</commons.bc.version>
<commons.bc.version>2.0.0-SNAPSHOT</commons.bc.version>

<!-- override the default commons encoding property -->
<commons.encoding>UTF-8</commons.encoding>
Expand All @@ -324,16 +328,16 @@
</properties>

<build>
<defaultGoal>clean verify apache-rat:check japicmp:cmp pmd:check pmd:cpd-check spotbugs:check javadoc:javadoc</defaultGoal>
<defaultGoal>clean verify apache-rat:check pmd:check pmd:cpd-check spotbugs:check javadoc:javadoc</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- exclude test case support classes -->
<excludes>
<exclude>org/apache/commons/mail/mocks/*</exclude>
<exclude>org/apache/commons/mail/settings/*</exclude>
<exclude>org/apache/commons/mail2/mocks/*</exclude>
<exclude>org/apache/commons/mail2/settings/*</exclude>
<exclude>**/Abstract*Test.java</exclude>
</excludes>
</configuration>
Expand Down Expand Up @@ -536,6 +540,7 @@
--add-opens java.base/java.util.regex=ALL-UNNAMED
--add-opens java.base/java.nio.charset=ALL-UNNAMED
--add-opens java.base/sun.nio.cs=ALL-UNNAMED
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.logging/java.util.logging=ALL-UNNAMED
</argLine>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.mail;
package org.apache.commons.mail2;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand All @@ -25,7 +25,7 @@
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;

import javax.activation.DataSource;
import jakarta.activation.DataSource;

/**
* This class implements a typed DataSource from:<br>
Expand All @@ -39,7 +39,7 @@
* and it is recommended to do so.
*
* @since 1.0
* @deprecated since 1.4, use {@link javax.mail.util.ByteArrayDataSource} instead
* @deprecated since 1.4, use {@link jakarta.mail.util.ByteArrayDataSource} instead
*/
@Deprecated
public class ByteArrayDataSource implements DataSource
Expand All @@ -55,7 +55,7 @@ public class ByteArrayDataSource implements DataSource

/**
* The name associated with this data source.
* By default, the name is an empty string, similar to javax.mail.util.ByteArrayDataSource.
* By default, the name is an empty string, similar to jakarta.mail.util.ByteArrayDataSource.
* @since 1.3.1
*/
private String name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.mail;
package org.apache.commons.mail2;

import javax.activation.DataSource;
import jakarta.activation.DataSource;
import java.io.IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.mail;
package org.apache.commons.mail2;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
import jakarta.mail.Authenticator;
import jakarta.mail.PasswordAuthentication;

/**
* This is a very simple authentication object that can be used for any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.mail;
package org.apache.commons.mail2;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
Expand All @@ -26,22 +26,22 @@
import java.util.Map;
import java.util.Properties;

import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeUtility;
import jakarta.mail.Authenticator;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Session;
import jakarta.mail.Store;
import jakarta.mail.Transport;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMultipart;
import jakarta.mail.internet.MimeUtility;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.apache.commons.mail.util.IDNEmailAddressConverter;
import org.apache.commons.mail2.util.IDNEmailAddressConverter;

/**
* The base class for all email messages. This class sets the
Expand Down Expand Up @@ -597,7 +597,7 @@ public void setMailSession(final Session aSession)
/**
* Supply a mail Session object from a JNDI directory.
*
* @param jndiName name of JNDI resource (javax.mail.Session type), resource
* @param jndiName name of JNDI resource (jakarta.mail.Session type), resource
* if searched in java:comp/env if name does not start with "java:"
* @throws IllegalArgumentException if the JNDI name is null or empty
* @throws NamingException if the resource cannot be retrieved from JNDI directory
Expand Down Expand Up @@ -857,7 +857,7 @@ public Email addTo(final String email, final String name, final String charset)
* @param aCollection collection of {@code InternetAddress} objects.
* @return An Email.
* @throws EmailException Indicates an invalid email address.
* @see javax.mail.internet.InternetAddress
* @see jakarta.mail.internet.InternetAddress
* @since 1.0
*/
public Email setTo(final Collection<InternetAddress> aCollection) throws EmailException
Expand Down Expand Up @@ -966,7 +966,7 @@ public Email addCc(final String email, final String name, final String charset)
* @param aCollection collection of {@code InternetAddress} objects.
* @return An Email.
* @throws EmailException Indicates an invalid email address.
* @see javax.mail.internet.InternetAddress
* @see jakarta.mail.internet.InternetAddress
* @since 1.0
*/
public Email setCc(final Collection<InternetAddress> aCollection) throws EmailException
Expand Down Expand Up @@ -1075,7 +1075,7 @@ public Email addBcc(final String email, final String name, final String charset)
* @param aCollection collection of {@code InternetAddress} objects
* @return An Email.
* @throws EmailException Indicates an invalid email address
* @see javax.mail.internet.InternetAddress
* @see jakarta.mail.internet.InternetAddress
* @since 1.0
*/
public Email setBcc(final Collection<InternetAddress> aCollection) throws EmailException
Expand Down Expand Up @@ -1154,7 +1154,7 @@ public Email addReplyTo(final String email, final String name, final String char
* @param aCollection collection of {@code InternetAddress} objects
* @return An Email.
* @throws EmailException Indicates an invalid email address
* @see javax.mail.internet.InternetAddress
* @see jakarta.mail.internet.InternetAddress
* @since 1.1
*/
public Email setReplyTo(final Collection<InternetAddress> aCollection) throws EmailException
Expand Down Expand Up @@ -1785,7 +1785,7 @@ public boolean isSendPartial()
* Sets whether the email is partially send in case of invalid addresses.
* <p>
* In case the mail server rejects an address as invalid, the call to {@link #send()}
* may throw a {@link javax.mail.SendFailedException}, even if partial send mode is enabled (emails
* may throw a {@link jakarta.mail.SendFailedException}, even if partial send mode is enabled (emails
* to valid addresses will be transmitted). In case the email server does not reject
* invalid addresses immediately, but return a bounce message, no exception will be thrown
* by the {@link #send()} method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.mail;
package org.apache.commons.mail2;

import java.net.URL;

Expand All @@ -26,10 +26,10 @@
public class EmailAttachment
{
/** Definition of the part being an attachment. */
public static final String ATTACHMENT = javax.mail.Part.ATTACHMENT;
public static final String ATTACHMENT = jakarta.mail.Part.ATTACHMENT;

/** Definition of the part being inline. */
public static final String INLINE = javax.mail.Part.INLINE;
public static final String INLINE = jakarta.mail.Part.INLINE;

/** The name of this attachment. */
private String name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.mail;
package org.apache.commons.mail2;

/**
* Constants used by Email classes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.commons.mail;
package org.apache.commons.mail2;

import java.io.OutputStreamWriter;
import java.io.PrintStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
* limitations under the License.
*/

package org.apache.commons.mail;
package org.apache.commons.mail2;

import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.BitSet;
import java.util.Random;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.MimeMessage;

import org.apache.commons.mail.util.MimeMessageUtils;
import org.apache.commons.mail2.util.MimeMessageUtils;

/**
* Utility methods used by commons-email.
Expand Down
Loading