Skip to content

Commit

Permalink
Upgrade Jakarta Mail 2.1 dependencies (#124)
Browse files Browse the repository at this point in the history
* Upgrade Jakarta Mail 2.1 dependencies

- jakarta.mail:jakarta.mail-api:2.1.2
- org.eclipse.angus:angus-mail:2.0.2

* Set mail.smtp.ssl.checkserveridentity=false for unit tests
  • Loading branch information
rtaugerbeck authored Dec 20, 2023
1 parent 369de6e commit 6249fe0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
18 changes: 15 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<mail-api.version>2.1.2</mail-api.version>
<angus-mail.version>2.0.2</angus-mail.version>

<slf4j.version>1.7.36</slf4j.version>
</properties>

Expand Down Expand Up @@ -84,10 +88,18 @@
</build>
<dependencies>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>2.0.1</version>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<version>${mail-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-mail</artifactId>
<version>${angus-mail.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/subethamail/smtp/BigAttachmentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;

import com.sun.mail.smtp.SMTPTransport;
import org.eclipse.angus.mail.smtp.SMTPTransport;

/**
* This class tests the transfer speed of emails that carry
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/subethamail/smtp/ErrorResponseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.subethamail.smtp.helper.BasicMessageListener;
import org.subethamail.smtp.server.SMTPServer;

import com.sun.mail.smtp.SMTPSendFailedException;
import org.eclipse.angus.mail.smtp.SMTPSendFailedException;

public class ErrorResponseTest {

Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/subethamail/smtp/TestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import org.subethamail.util.ExtendedTrustManager;

import com.sun.mail.util.MailSSLSocketFactory;
import org.eclipse.angus.mail.util.MailSSLSocketFactory;

class TestUtil {

Expand Down Expand Up @@ -86,8 +86,10 @@ static void send(TrustManager[] trustManagers, ConnectionType connectionType, St
props.put("mail.smtp.port", PORT + "");
if (connectionType == ConnectionType.START_TLS) {
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.ssl.checkserveridentity", "false");
} else {
props.put("mail.smtp.ssl.enable", "true");
props.put("mail.smtp.ssl.checkserveridentity", "false");
}
if (username != null) {
props.setProperty("mail.smtp.submitter", username);
Expand Down

0 comments on commit 6249fe0

Please sign in to comment.