Skip to content

Commit

Permalink
Switch from Sun mail to Eclipse Angus Mail for jakarta.mail
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter authored and marcelmay committed Mar 6, 2023
1 parent 5ca644f commit b6f0ba2
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.icegreen.greenmail.Managers;
import com.icegreen.greenmail.server.ProtocolHandler;
import com.icegreen.greenmail.util.ServerSetup;
import com.sun.mail.imap.IMAPStore; // NOSONAR
import org.eclipse.angus.mail.imap.IMAPStore; // NOSONAR

import jakarta.mail.NoSuchProviderException;
import java.net.Socket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.icegreen.greenmail.imap.ImapRequestLineReader;
import com.icegreen.greenmail.imap.ProtocolException;
import com.icegreen.greenmail.store.MessageFlags;
import com.sun.mail.imap.protocol.BASE64MailboxDecoder;
import org.eclipse.angus.mail.imap.protocol.BASE64MailboxDecoder;

import jakarta.mail.Flags;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import com.icegreen.greenmail.imap.ProtocolException;
import com.icegreen.greenmail.store.FolderException;
import com.icegreen.greenmail.store.MailFolder;
import com.sun.mail.imap.protocol.BASE64MailboxDecoder; // NOSONAR
import com.sun.mail.imap.protocol.BASE64MailboxEncoder; // NOSONAR
import org.eclipse.angus.mail.imap.protocol.BASE64MailboxDecoder; // NOSONAR
import org.eclipse.angus.mail.imap.protocol.BASE64MailboxEncoder; // NOSONAR

import java.util.ArrayList;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.icegreen.greenmail.imap.ProtocolException;
import com.icegreen.greenmail.store.FolderException;
import com.icegreen.greenmail.store.MailFolder;
import com.sun.mail.imap.protocol.BASE64MailboxEncoder; // NOSONAR
import org.eclipse.angus.mail.imap.protocol.BASE64MailboxEncoder; // NOSONAR

/**
* Handles processeing for the STATUS imap command.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.icegreen.greenmail.pop3.commands.Pop3CommandRegistry;
import com.icegreen.greenmail.server.ProtocolHandler;
import com.icegreen.greenmail.util.ServerSetup;
import com.sun.mail.pop3.POP3Store; // NOSONAR
import org.eclipse.angus.mail.pop3.POP3Store; // NOSONAR

import jakarta.mail.NoSuchProviderException;
import java.net.Socket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import com.icegreen.greenmail.mail.MailAddress;
import com.icegreen.greenmail.util.GreenMailUtil;
import com.sun.mail.imap.protocol.INTERNALDATE;
import org.eclipse.angus.mail.imap.protocol.INTERNALDATE;
import jakarta.mail.BodyPart;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void renameMailbox(MailFolder existingFolder, String newName)
* Gets the quotas.
*
* @link http://www.ietf.org/rfc/rfc2087.txt
* @see com.sun.mail.imap.IMAPStore#getQuota(String)
* @see org.eclipse.angus.mail.imap.IMAPStore#getQuota(String)
* @param root the quota root
* @param qualifiedRootPrefix the user specific prefix
* @return the quotas, or an empty array.
Expand All @@ -115,7 +115,7 @@ void renameMailbox(MailFolder existingFolder, String newName)
* Sets the quota.
*
* @link http://www.ietf.org/rfc/rfc2087.txt
* @see com.sun.mail.imap.IMAPStore#setQuota(jakarta.mail.Quota)
* @see org.eclipse.angus.mail.imap.IMAPStore#setQuota(jakarta.mail.Quota)
* @param quota the quota.
* @param qualifiedRootPrefix the user specific prefix
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.icegreen.greenmail.junit.GreenMailRule;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.IMAPStore;
import org.junit.Rule;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import com.icegreen.greenmail.util.Retriever;
import com.icegreen.greenmail.util.ServerSetup;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.imap.AppendUID;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.AppendUID;
import org.eclipse.angus.mail.imap.IMAPFolder;
import org.eclipse.angus.mail.imap.IMAPStore;
import jakarta.mail.*;
import jakarta.mail.event.MessageCountEvent;
import jakarta.mail.event.MessageCountListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.icegreen.greenmail.store.MailFolder;
import com.icegreen.greenmail.user.GreenMailUser;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.SortTerm;
import org.eclipse.angus.mail.imap.IMAPFolder;
import org.eclipse.angus.mail.imap.SortTerm;
import org.junit.Rule;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import com.icegreen.greenmail.user.GreenMailUser;
import com.icegreen.greenmail.util.GreenMailUtil;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.iap.Argument;
import com.sun.mail.iap.ByteArray;
import com.sun.mail.iap.Response;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import com.sun.mail.imap.protocol.*;
import org.eclipse.angus.mail.iap.Argument;
import org.eclipse.angus.mail.iap.ByteArray;
import org.eclipse.angus.mail.iap.Response;
import org.eclipse.angus.mail.imap.IMAPFolder;
import org.eclipse.angus.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.protocol.*;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.icegreen.greenmail.util.Retriever;
import com.icegreen.greenmail.util.ServerSetup;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.pop3.POP3Folder;
import com.sun.mail.pop3.POP3Store;
import org.eclipse.angus.mail.pop3.POP3Folder;
import org.eclipse.angus.mail.pop3.POP3Store;
import jakarta.mail.AuthenticationFailedException;
import jakarta.mail.BodyPart;
import jakarta.mail.Message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.icegreen.greenmail.smtp.commands.AuthCommand;
import com.icegreen.greenmail.user.UserException;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.smtp.SMTPTransport;
import org.eclipse.angus.mail.smtp.SMTPTransport;
import jakarta.mail.MessagingException;
import jakarta.mail.Session;
import jakarta.mail.URLName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void testSendWithReusedConnection() throws Throwable {
try {
transport.sendMessage(message, message.getAllRecipients());
Assertions.fail("should have thrown");
} catch (com.sun.mail.smtp.SMTPSendFailedException e) { // Graceful server-side-close with 421
} catch (org.eclipse.angus.mail.smtp.SMTPSendFailedException e) { // Graceful server-side-close with 421
assertThat(e).hasNoCause();
} catch (MessagingException e) {
assertThat(e).hasCauseExactlyInstanceOf(SocketException.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.icegreen.greenmail.util.EncodingUtil;
import com.icegreen.greenmail.util.GreenMailUtil;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.IMAPFolder;
import org.eclipse.angus.mail.imap.IMAPStore;
import jakarta.mail.BodyPart;
import jakarta.mail.Folder;
import jakarta.mail.Message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.icegreen.greenmail.junit.GreenMailRule;
import com.icegreen.greenmail.util.GreenMailUtil;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.sun.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.IMAPStore;
import org.junit.Rule;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.icegreen.greenmail.util.Retriever;
import com.icegreen.greenmail.util.ServerSetupTest;
import com.icegreen.greenmail.util.UserUtil;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.IMAPFolder;
import org.eclipse.angus.mail.imap.IMAPStore;
import jakarta.mail.Address;
import jakarta.mail.Folder;
import jakarta.mail.Message;
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.0.0</version>
<version>2.0.1</version>
</dependency>

<dependency>
Expand All @@ -440,7 +440,7 @@
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-activation</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down

0 comments on commit b6f0ba2

Please sign in to comment.