GreenMail alternatives and similar libraries
Based on the "Testing" category.
Alternatively, view GreenMail alternatives based on common mentions on social networks and blogs.
-
Karate
Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. -
TestContainers
Provides throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. -
PowerMock
Enables mocking of static methods, constructors, final classes and methods, private methods and removal of static initializers. -
PIT
Fast mutation-testing framework for evaluating fault-detection abilities of existing JUnit or TestNG test-suites. -
Arquillian
Integration and functional testing platform for Java EE containers. -
Scott Test Reporter
Detailed failure reports and hassle free assertions for Java tests - Power Asserts for Java -
J8Spec
J8Spec is a library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine.
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of GreenMail or a related project?
README
GreenMail
GreenMail is an open source, intuitive and easy-to-use test suite of email servers for testing purposes. Supports SMTP, POP3, IMAP with SSL socket support, and can be run either embedded in a junit test, as a standalone Java application or as a docker container. GreenMail is the first and only library that offers a test framework for both receiving and retrieving emails from Java.
Go to the project site for details:
The GreenMail project welcomes any contribution, so go ahead and fork/open a pull request! See the guidelines below.
Note: GreenMail recently moved to Github and was previously hosted on SF.
Development

- Build GreenMail from source
mvn clean install -Pdocker
Make sure you got Maven 3.6 or higher, and run a JDK 8 or newer.
If you want to skip building the docker image, leave out the -Pdocker
profile option.
If you want to skip the long running tests, use the Maven option -DskipITs
.
- Build the Maven site (and the optional example report)
mvn site -Psite
- Build and deploy a release
For rolling a release including version increment and release upload, do
mvn clean release:prepare -Prelease,release-ossrh,docker,docker-tag-latest
mvn release:perform -Prelease,release-ossrh,docker,docker-tag-latest
For a tagged release and deployment to Sonatype OpenSource Repository Hosting and later syncing to Maven Central, do
mvn clean deploy -Prelease,release-ossrh,docker,docker-tag-latest
Note: Do only use docker-tag-latest profile if you really want the tag latest, e.g. for newest release of highest version.
- Build and deploy a snapshot
For a Maven Snapshot deployment to Sonatype, do
mvn clean deploy -Prelease-ossrh,docker
- Check Sonar report
Roadmap
- 1.6 (current)
- Bugfix / maintenance
- 1.7
- Deprecations (no GreenMailRule in greenmail-core, ...)
- 2.x
- JakartaMail 2.x
Contribution guidelines
We really appreciate your contribution! To make it easier for integrating your contribution, have a look at the following guidelines.
Be concise
Try to keep your changes focused. Please avoid (major) refactorings and avoid re-formatting existing code. A good check is looking at the diff of the your pull requrest. Also, please refer to the open issue you're fixing by including a reference in your commit message.
Code formatter
Please set your code formatter to use 4 spaces for indentation of Java files (not tabs) and to two spaces for xml files (like the pom.xml). As a general best practise, your contribution should adhere to existing code style.
Bill of Materials
We have the pom.xml in the root where we set the versions of all dependencies to keep them consistent among subprojects. Please do not add any version tags into the child pom.xml files.
Please also do not introduce new dependencies as we try to keep these to a minimum. If you think you require a new dependencies or dependency update, discuss this up front with committers.
Starting your pull request
The best strategy for opening a pull request after a fork is to add the this repository as the "upstream" to your .git/config such as:
[remote "upstream"]
url = https://github.com/greenmail-mail-test/greenmail.git
fetch = +refs/heads/*:refs/remotes/upstream/*
Then you fetch "upstream" and create a new branch at upstream/master (name it issue-XXX or something like that). Now you can add commits on that branch and then create a pull request for that branch (after pushing it to your github). That way commits are isolated for one feature.
Tests for your pull request
Please also create a test for every feature you add. We know that currently there aren't many tests but in the medium term we want to increase test coverage.
Misc
Many thanks to JProfiler and Jetbrains for supporting this project with free OSS licenses
*Note that all licence references and agreements mentioned in the GreenMail README section above
are relevant to that project's source code only.