Questions tagged [greenmail]

GreenMail is an open source suite of lightweight and sand boxed email servers supporting SMTP, POP3 and IMAP.

GreenMail is an open source, intuitive and easy-to-use test suite of email servers for testing purposes.

Typical use cases include mail integration testing or a lightweight sand boxed mail server for development.

GreenMail is the first and only library that offers a test framework for both receiving and retrieving emails from Java.

http://www.icegreen.com/greenmail/

36 questions
1
vote
1 answer

simulate imaps server - Greenmail

i want to use Greenmail in order to simulate imaps server. i want to use the server for system tests, i want to run the greenmail server and deliver it emails and then get those emails from jobs that run on my app server. my question is what is the…
oded
  • 9
  • 4
0
votes
1 answer

GreenMail atomic getReceivedMessages() and purgeEmailFromAllMailboxes()

Is there a way how to atomically receive messages from GreenMail and then purge those messages? I don't want to receive any message more than once. Something like getReceivedMessagesAndPurge(). In my code, I want to write any email received by…
0
votes
1 answer

GreenMail server works in single integration test class but not when all integration classes will be started

I have several integration test classes, when I am executing a single one, the greenmail server will be started and works as expected. But when I am starting all integrations tests it fails, and its random which of the integration test cases…
Al Phaba
  • 6,545
  • 12
  • 51
  • 83
0
votes
2 answers

Junit5 Tests for Spring Email with GreenMail Server using SMTP

I am trying to write JUnit5 tests for Spring Email. When i am running the test , Greenmail server is not receiving any messages. Attaching code snippets for the same: @ExtendWith(MockitoExtension.class) public class EmailServiceImplTest { Mail…
Prax
  • 91
  • 3
  • 12
0
votes
1 answer

How to randomize the ports in greenmail for CI Server

Using JUnit & Greenmail I want to achieve a random port used by greenmail rather than the default ports or the ports with offset. To do so I tried to get a random port with ServerSocket(0) and the start of greenmail works as designed. But when I try…
Stefan Höltker
  • 311
  • 5
  • 21
0
votes
2 answers

JUnit refers to same var value

I'm writing a test like this public String cc = ""; @Test public void testSendMailWithMissingData() throws MessagingException { String sender = "test@test.com"; String receiver = "test2@test.com"; String subject = ""; String…
lpkej
  • 445
  • 6
  • 23
0
votes
1 answer

How can I load .msg file into GreenMail mailbox

I'd like to load .msg bounce mail sample to GreenMail mock mailbox for testing. How can I do that?
Fadhlie Ikram
  • 119
  • 2
  • 14
0
votes
1 answer

GreenMail integration test sent email not being relayed to recipient

I'm using greenmail for mail integration test, and came out with below code. The intention is to create 2 fake email servers that act as sender and recipient. However when I ran the code, the test failed because the recipient doesn't receive the…
Fadhlie Ikram
  • 119
  • 2
  • 14
0
votes
1 answer

GreenMail - no error but no received messages

I am trying to use GreenMail to test if my code is sending an email correctly. I moved all the pieces in one place so that I can compact and paste here. The problem is that GreenMail seems not to receiving the email. If I replace the method call…
mr.Kame
  • 153
  • 3
  • 12
0
votes
0 answers

GreenMail - IMAP Server - Messages appended with wrong INTERNALDATE

I have an issue with GreenMail - IMAP server. The messages that are appended to the GreenMail IMAP server using JavaMail Library, are stored with wrong INTERNALDATE. The weird thing is that the issues occur between 12:00 PM - 1:00 PM. Both the…
Dmitri
  • 271
  • 2
  • 11
0
votes
1 answer

How to test it.ozimov.springboot Email?

I want to make unit test of sending message by using it.ozimov.springboot.mail.service.EmailService. https://github.com/ozimov/spring-boot-email-tools Here is my MailService: import com.google.common.collect.Lists; import…
Mar Mosh
  • 215
  • 2
  • 4
  • 9
0
votes
2 answers

How to send smtps message to standalone greenmail server

I have a mule flow that needs to send a smtps message to a greenmail server. The mule flow uses the smtps connector with configure keystore and truststore:
victor
  • 33
  • 7
0
votes
1 answer

Greenmail standalone smtp server email error

I started a standalone Greenmail SMTP server with the following configurations in root mode so that i can use 25 port, java -Dgreenmail.setup.all -Dgreenmail.users=test1:pwd1 -Dgreenmail.hostname=10.107.45.11 -jar greenmail-standalone.jar I am able…
Sathya
  • 82
  • 5
0
votes
0 answers

Java Spring email testing with GreenMail

I am implementing tests for a service which sends a lot of emails. As a testing tool I selected GreenMail. I'm doing like @Rule public GreenMailRule mail = new GreenMailRule(ServerSetupTest.SMTP); @Autowired MailService mailService; @Before public…
Rahul
  • 1,727
  • 3
  • 18
  • 33
0
votes
0 answers

FolderClosedException while fetching from green mail server IMAP

I was testing green mail api and received following error while trying to fetch from green mail server though server was correctly up. I am using green mail 1.4.1, java 8, java mail 1.5.3. Below is the code that i have been executing and the…
sameepsi
  • 307
  • 1
  • 6