DevNullRecipients.txt in $INSTALL_DIR\config folder
domainone.com
and domaintwo.comsomeone@gmail.com. It
was denied by DevNullSmtp is not configured to accept emails for that domain.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:
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
| Argument | Description |
|---|---|
-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. |
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
DevNullSmtp supports STARTTLS by default, and uses a self-signed certificate.
Use the following command line argument to disable STARTTLS:
java -Ddevnull.disable.starttls=true -jar DevNullSmtp.jar
Use the following command line arguments to specify a custom SSL certificate:
java -Ddevnull.cert.pwd=secret -Ddevnull.cert.type=PKCS12 -Ddevnull.cert.file=path/to/certificate.pfx -jar DevNullSmtp.jarYour certificate must be in binary format, such as *.pfx and must include the primary key. If you're certificate is in ASCII, you must convert it to a binary format using instructions on this page
It is often helpful to see how your application behaves when the receiving SMTP server runs into errors. For example, what happens when the receiving server takes a long time after accepting the DATA command? You can simulate fake delays in DevNull, allowing you to test such scenarios. Delays can be added to the following commands, each with its own system property tag:
smtp.sleep.time.after.helo.plain, or smtp.sleep.time.after.helo.enc for helo after STARTTLSsmtp.sleep.time.after.mailfromsmtp.sleep.time.after.rcpttosmtp.sleep.time.after.datajava "-Dsmtp.sleep.time.after.data=60000" -jar .\DevNullSmtp.jar
In this case, a new system property called smtp.sleep.time.after.data is added with a value of 60000,
representing the number of milliseconds. When DevNull receives an email, it will go to sleep for 1 minute after the DATA command.