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
7
votes
3 answers

Using Javamail and Greenmail for SMTPS/SSL

I'm trying to write a test that will uses JavaMail SMTP or SMTPS to send a message via SSL and authentication to a Greenmail server that I'm running. I've written a quick little sub that should do exactly what I'm wanting: import…
GreenKiwi
  • 1,025
  • 13
  • 28
5
votes
5 answers

Testing Greenmail without installing a SMTP server

I'm trying to use Greenmail to unit test email functions on my localhost. The problem is that I don't have a SMTP server installed already, and feels it over-killing to install one. My expectation is that there should be a free library that allow me…
Hoàng Long
  • 10,746
  • 20
  • 75
  • 124
5
votes
1 answer

How do you view email messages sent to greenmail

I have an application that uses camel to send email. There is a greenmail server set up in our environment. The testers testing the service need to be able to view the emails sent, to verify that the html is formatted correctly. There doesn't seem…
whomer
  • 575
  • 9
  • 21
4
votes
0 answers

Greenmail does not shutdown on Junit Test Fail

We've been trying to figure out how to stop Greenmail so it doesn't occupy the 3025 port when a Junit test case fails. When a unit test fails, Junit seems to bypass the @After annotation (correct if I'm wrong), and carries on with following tests.…
alwinc
  • 1,317
  • 3
  • 14
  • 21
3
votes
2 answers

GreenMail not returning BCC recipient addresses

I'm using GreenMail in a test to verify that our application is sending email correctly. I start GreenMail with: GreenMail greenMailServer = new GreenMail(new ServerSetup(port, "localhost", ServerSetup.PROTOCOL_SMTP)); greenMailServer.start(); I…
3
votes
0 answers

FloderClosedException while retrieving from dummy green mail imap server

I have created a dummy green mail server to simulate a mailbox for my application. My application basically connects to a mail server and retrieves new mails based on some criteria. So i have created a dummy mail server for my application using…
sameepsi
  • 307
  • 1
  • 6
2
votes
1 answer

Using Greenmail as a devlopment smtp server

I am using greenmail as development Mail server. My use case is to 1) send an email on the mail server and 2) another process will keep looking that mail server using IMAP and notify if there is any new email. To achieve first step 1) send an email…
MMJ
  • 519
  • 1
  • 9
  • 26
2
votes
0 answers

GreenMail Returning Multiple To Addresses

Running JUnit test cases utilizing GreenMail to do some basic email validation. I'm having issues when attempting to validate the RecipientType.TO. My JUnit assertion is failing - so I logged the message header, and it appears that the recipient is…
adam
  • 113
  • 1
  • 1
  • 8
2
votes
1 answer

Can't access properties of email received by GreenMail

I'm trying to use GreenMail as a mockup mail server for unit testing. It's job is to await a IMAP/POP3 request and deliver a dummy mail, but I can't get it to work. public class EMailMonitoringTest { private static final String USER_PASSWORD =…
RyuX51
  • 2,779
  • 3
  • 26
  • 33
1
vote
0 answers

Greenmail in Spring setup

I have problem that my GreenMail instance doesn't work properly in tests. I have an app with testcontainers and graphql tester, and everything works fine before I add GreenMail for testing. I use this to register extension: @RegisterExtension …
radek wilo
  • 11
  • 2
1
vote
1 answer

Springboot Testing via Greenmail

I tried to test my Gmail smtp in my Spring-Application and followed this Tutorial. I have implemented it as specified in the tutorial, but my EmailService throws a MailSendException: org.springframework.mail.MailSendException: Mail server connection…
1
vote
2 answers

Spring Email with Greenmail: Authentication Credentials Invalid

I am trying to write test code for Spring Email using Greenmail. This works perfectly with 1.5.5 version of Greenmail, however when I try to update the version of Greenmail (1.5.6 to 1.5.11) it keeps giving me an error 535 5.7.8 Authentication…
jawsh
  • 163
  • 2
  • 11
1
vote
3 answers

How to disable authentication while testing email service using greenmail

I have written an email service using Spring Email and then used Greenmail to test the email service. But while running the test case it gives an error Authentication failed as below: javax.mail.AuthenticationFailedException: 535 5.7.0…
Arunabh
  • 167
  • 1
  • 7
  • 18
1
vote
1 answer

greenmail - keycloak connection doesn't work

I'm trying to write some integration tests on my keycload flows. To validate the registration and password forgotten mails, I would like to use greenmail. my docker configuration of greenmail (within docker compose): greenmail: image:…
Vandeperre Maarten
  • 556
  • 1
  • 8
  • 21
1
vote
4 answers

Java framework for sending emails

Do you know any framework in Java for reliably sending a huge amount of emails with the following features: Send and receive emails Concurrently process emails from a queue to maximize the throughput Keep track of emails that could not be…
Theo
  • 3,074
  • 7
  • 39
  • 54
1
2 3