Plugins You can find out about all the publicly available Grails plugins.

Dumbster Plugin

1 vote
compile "org.grails.plugins:dumbster:0.2"
Custom repositories:
mavenRepo ""

 Documentation  Source  Issues


Adds support for the Dumbster SMTP server for testing


Add a dependency in the plugins section of BuildConfig.groovy:

plugins {
   test ':dumbster:0.1'


This plugin adds support for integration testing of sending emails using the Dumbster library.

The plugin creates a "dumbster" Spring bean which starts an SMTP server. You can call the getMessages method to get all sent messages (instances of com.dumbster.smtp.SmtpMessage ) and the getMessageCount to get the number of sent messages. You should add a call to the reset method in your integration test setUp method to clear all previously sent messages between tests.

The SmtpMessage class isn't very easy to work with since you must retrieve most data from header values. It has a getBody method to access the email body though. So the plugin adds some dynamic methods for use in testing:

  • getSubject
  • getDate
  • getTo
  • getTos
  • getCc
  • getCcs
  • getBcc
  • getBccs


The plugin will only be active if it is explicitly enabled in Config.groovy, e.g.

test {
   dumbster.enabled = true

In addition, you can specify the server port:

test {
   dumbster.enabled = true
   dumbster.port = 1200

If you don't specify the port, the plugin will test for open ports starting at 1025 until it finds one it can use. If you have the mail plugin installed this plugin will attempt to update its JavaMailSender (registered as the mailSender bean) with this discovered port.