DevNullSmtp

As the name implies, DevNullSmtp is a dummy SMTP server that can be used for testing purposes. By default, Emails sent to DevNullSmtp are lost. It can be used to troubleshoot email related problems

There are two variations of DevNullSmtp:
  1. Integrated with Xeams
  2. Stand-alone
Starting from v6.5, DevNullSmtp has been integrated with Xeams. Follow the steps below to add recipients for DevNullSMTP.

  • Add a new text file called DevNullRecipients.txt in $INSTALL_DIR\config folder
  • Add email addresses that are considered for DevNull - one address per line
  • Xeams will accept emails for addresses specified in this file but the message will be lost. You will NOT see the message either in Live Monitor or Message Repository
  • Needless to say, DO NOT put any important address in this file. Every email sent to these recipients will be lost
Important Note: There is no need to restart Xeams after modifying the file.

Instructions

  • Click here to download this tool.
  • Extract the zipped file in the same folder where you have installed Xeams
  • Double click DevNullSmtp.bat to run it
  • Specify a port number and click Start Server
  • By default, DevNullSmtp will run as an open relay - meaning it will accept messages for every domain and users.
  • Specify desired domain names in the text box below to restrict DevNullSmtp to certain domains
  • Specify complete email addresses to restrict recipients - meaning DevNullSmtp will only accept messages for these individuals


DevNullSmtp.png

How it works

  • The screenshot on the right shows DevNullSmtp running on port 25 and accepts messages for domainone.com and domaintwo.com
  • The log shows an incoming email that was supposed to be delivered to someone@gmail.com. It was denied by DevNullSmtp is not configured to accept emails for that domain.
  • Check Save incoming messages to box and specify a path on the local machine if you want to save incoming messages.


This version of DevNullSmtp is newer than the version found on http://www.aboutmyip.com/AboutMyXApp/DevNullSmtp.jsp

There are several benefits of running DevNullSmtp in a console mode, without any GUI. For example, you want to run it in console mode when:

  • Running on headless Linux
  • Through a script
  • Unit testing

Invoking in Console Mode

Simply pass -console as a command line argument in order to run DevNullSmtp in non-gui mode. For example:

java -jar DevNullSmtp.jar -console

Additionally, following command-line arguments are supported when running in console mode

ArgumentDescription
-p TCP/IP Port. If missing, 25 is assumed.
-d Comma separated value for acceptable domains. If missing, the server will run as an open-relay.
-s Path on disk where emails are saved. If missing, emails will not be saved.
-tr Sender's email address to terminate DevNullSmtp. An incoming email where sender's email address equals this value will cause DevNullSmtp to terminate.

Examples

Example 1 - Start listening on port 587 and save incoming emails to /testEmails.

java -jar DevNullSmtp.jar -console -p 587 -s /testEmails

Example 2 - Start listening on port 25 as an open relay. Terminate application if the sender of an incoming email is terminate@me.please.

java -jar DevNullSmtp.jar -console -tr terminate@me.please