The Dumbster is a very simple fake SMTP server designed for unit and system testing applications that send email messages. It responds to all standard SMTP commands but does not deliver messages to the user. The messages are stored within the Dumbster for later extraction and verification.

The Dumbster slots itself very easily into your testing strategy. As long as your application talks to an email server using SMTP then the Dumbster can be used to test the application with no code changes.

The Dumbster is useful in the following scenarios:

The Dumbster is written in Java and is open source. It is distributed under the Apache License 2.0.


The following is a simple example of how to unit test the email components of your application

public class SimpleSmtpServerTest extends TestCase {
  public void testSend() {
    SimpleSmtpServer server = SimpleSmtpServer.start();

    try {
      // Submits an email using javamail to the email server listening on port 25 
      // (method not shown here). Replace this with a call to your app logic.
      sendMessage(25, "", "Test", "Test Body", "");
    } catch(Exception e) {
      fail("Unexpected exception: "+e);


    assertTrue(server.getReceivedEmailSize() == 1);
    Iterator emailIter = server.getReceivedEmail();
    SmtpMessage email = (SmtpMessage);
    assertTrue(email.getBody().equals("Test Body"));	


The Dumbster may be downloaded from the Dumbster SourceForge project page:


The JavaDoc is here. The JavaWorld article is here.


Any questions, bug fixes, suggestions should be submitted through the Dumbster forums on the SourceForge project page:

If you would like help with improving your unit testing strategy such as testing "untestable" parts of your code base the author is available on a freelance basis. For further information please contact me (Jason Kitchen) at the following address:


Donations are gratefully accepted and will be used to pay for hosting and beer in that order. They will also bump you to the top of the list for any new features you request.

Another important way you can donate is through reporting bugs, fixing bugs, and development of new features. I have a number of interesting projects for anyone interested in donating time to the project.