All Projects → SpartaSystems → holdmail

SpartaSystems / holdmail

Licence: Apache-2.0 license
HoldMail is a Java Application for proxying SMTP mail, providing a browsable viewer for captured emails.

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
Vue
7211 projects
shell
77523 projects

Projects that are alternatives of or similar to holdmail

Docker Postfix
Simple SMTP relay docker image.
Stars: ✭ 162 (+440%)
Mutual labels:  smtp-server
go-smtp-mock
SMTP mock server written on Golang. Mimic any 📤 SMTP server behavior for your test environment with fake SMTP server.
Stars: ✭ 76 (+153.33%)
Mutual labels:  smtp-server
Three-Factor-Security-Door
What do you get when you mix a Raspberry Pi, a MySQL database, an RFID reader, an LCD touchscreen, a relay switch, an electronic door strike and a Twilio SMS account?
Stars: ✭ 49 (+63.33%)
Mutual labels:  relays
Mailproxy
mailproxy is a simple SMTP proxy. It receives emails through an unencrypted, unauthenticated SMTP interface and retransmits them through a remote SMTP server that requires modern features such as encryption and/or authentication. mailproxy is primarily useful for enabling email functionality in legacy software that only supports plain SMTP.
Stars: ✭ 170 (+466.67%)
Mutual labels:  smtp-server
Tmail
Golang SMTP server
Stars: ✭ 251 (+736.67%)
Mutual labels:  smtp-server
PyEmailer
Send Emails In One Click With Python.
Stars: ✭ 29 (-3.33%)
Mutual labels:  smtp-server
Papercut Smtp
Papercut SMTP -- The Simple Desktop Email Server
Stars: ✭ 2,094 (+6880%)
Mutual labels:  smtp-server
ohmysmtp-rails
A plugin for ActionMailer to send emails via MailPace.com
Stars: ✭ 31 (+3.33%)
Mutual labels:  smtp-server
smtprelay
Simple Golang SMTP relay/proxy server
Stars: ✭ 270 (+800%)
Mutual labels:  smtp-server
blackhole
Blackhole is an MTA written on top of asyncio, utilising async and await statements that dumps all mail it receives to /dev/null.
Stars: ✭ 61 (+103.33%)
Mutual labels:  smtp-server
Smtpd
A Lightweight High Performance ESMTP email server
Stars: ✭ 175 (+483.33%)
Mutual labels:  smtp-server
Magento 2 Smtp
Magento 2 SMTP Extension helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers.
Stars: ✭ 228 (+660%)
Mutual labels:  smtp-server
MailDemon
Smtp server for mass emailing, managing email lists and more. Built on .NET Core. Linux, MAC and Windows compatible.
Stars: ✭ 113 (+276.67%)
Mutual labels:  smtp-server
Docker Postfix
Simple SMTP server / postfix null relay host for your Docker and Kubernetes containers. Based on Alpine Linux.
Stars: ✭ 163 (+443.33%)
Mutual labels:  smtp-server
sarlacc
SMTP server / sinkhole for collecting spam
Stars: ✭ 42 (+40%)
Mutual labels:  smtp-server
Go Guerrilla
Mini SMTP server written in golang
Stars: ✭ 2,173 (+7143.33%)
Mutual labels:  smtp-server
ControlCenter
Mirrored from GitLab! Monitoring and automation for Open Source email servers, starting with Postfix. Please do not submit issues or PRs here - join us at: https://gitlab.com/lightmeter
Stars: ✭ 88 (+193.33%)
Mutual labels:  smtp-server
docs
📚 Documentation for the Postal mail server!
Stars: ✭ 62 (+106.67%)
Mutual labels:  smtp-server
mailamie
🌈 Mailamie is a simple SMTP catch all server for testing written in PHP.
Stars: ✭ 73 (+143.33%)
Mutual labels:  smtp-server
SimpleKotlinMail
A simple, coroutine based Kotlin Email API for both client- and server-side projects
Stars: ✭ 56 (+86.67%)
Mutual labels:  smtp-server

HoldMail

HoldMail - A fake SMTP relay server

Build Status   Download

Release 2.0 Available!

The latest release of holdmail brings several improvements:

  • Support for attachments
  • Multilingual support
  • A new UI (We're now using Vue.js as the UI framework)
  • Direct linking to emails in the UI
  • Many miscellaneous bugfixes

For the list of issues included in this release, see the CHANGELOG.

What is Holdmail?

Instead of spamming real users (or worse - customers) while you test your applications, HoldMail offers the following:

  • An SMTP service that stores mails instead of relaying them for delivery.
  • A web interface for searching and viewing of those emails.
  • A REST API to query and fetch email content, very useful for testing.
  • The ability to manually release(forward) individually selected mails to the real world.

Screenshots

Mail List

Mail List

Mail Preview

Mail List

Installation

If you just want to try it out, grab and install the RPM from the 'rpm' folder here: Download

After installation, start the holdmail service:

#> sudo /etc/init.d/holdmail start
or
#> sudo service holdmail start

It's now ready to use! Without any configuration, HoldMail does the following:

  • It accepts SMTP messages on localhost port 25000. Configure your application to use this as the outgoing SMTP server.
  • It makes the webapp available at http://localhost:8080/.
  • Similarly, the REST API will be available at http://localhost:8080/rest/messages
  • A H2 embedded database will be created in holdmail's home directory (/opt/holdmail).

Upgrading

Running a new distibution of holdmail will automatically apply any needed changes to the attached database.

It's still always a good idea to make a backup first! If you just ran holdmail without configuring anything, that's going to be the H2 database file at $HOME/holdmail.mv.db.

REST API

Endpoint Description Method URI Request/Response
Find messages GET /rest/messages
Query Params:
'recipient' (str) - search by email address
'size' (int) - limit response hit size
'page' (int) - pagination support
Response: 200, application/json: a 'messages: [..]' array.
Get message by ID GET /rest/messages/{id} Response: 200, application/json: JSON object with summary attributes.
Get original raw message GET /rest/messages/{id}/raw Response: 200, text/plain: the original MIME message.
Get message text body GET /rest/messages/{id}/text Response: 200, text/plain: the text body if one was present, 404 otherwise.
Get message HTML body GET /rest/messages/{id}/html Response: 200, text/html: the HTML body if one was present, HTTP 404 otherwise. Any embedded content in the HTML will be replaced with a URI to the 'embedded content' endpoint (next)
Get embedded content GET /rest/messages/{id}/content/{cid} Response: 200, The embedded content with identifier 'cid' will be served with its related content type
Get attachment (new in 2.0) GET /rest/messages/{id}/att/{att_id} Response: 200 with the headers and content associated with the referenced attachment ID (the attachment ID is found in the attachments[] array in the /rest/messages/{id} response.
Forward message POST /rest/messages/{id}/forward Request: application/json: The recipient email, in the format: {"recipient":"[email protected]"}.

Response: 202 on acceptance.

Configuration

If using the RPM deployment, HoldMail will look for an optional file called /etc/holdmail.properties which it will use to override its default configuration.


Note: Since this is the initial release of holdmail, configuration is somewhat limited and is likely to receive some necessary cleanup/namespacing in the future. While any Spring Boot configuration is currently supported in this file, it may not be guaranteed to work in future releases.


Port Numbers

# HTTP/REST (default is 8080)
server.port=5555

# SMTP (default is 25000)
holdmail.smtp.port=22222

Security

HoldMail is designed to be open. There are no accounts or mailboxes to configure. Mail for any recipient will be stored and will be queryable. This is to facilitate the ease of email testing without requiring test authors/performers to perform mailbox setup in advance.

If you're going to have to expose the HTTP service to a larger group than desired, you can use spring basic configuration to lock it down:

security.basic.enabled=true
security.user.name=homer
security.user.password=mmmdonut

Using a different Datasource

By default, the application will create a H2 database file called holdmail.mv.db in the running user's home directory (this is /opt/holdmail/holdmail.mv.db if you used the RPM intaller).

This should be good enough for most users, but if you want to use a different RDBMS such as MySQL, you can configure your own datasource. Add your configuaration to /etc/holdmail.properties using the relevant Spring Boot DataSource properties. The following example shows how to configure to connect to a MySQL DB:

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://mysql-server-host:3306/holdmail?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=holdmail
spring.datasource.password=password
  • The app manages its own database, so this user will need to have sufficient provileges to create and modify tables.

  • HoldMail doesn't distribute drivers for external databases (for reasons of distributable size, but mostly to avoid farcical licensing complications 🙈).

    • If using the HoldMail RPM distribution, place your driver JAR file in /opt/holdmail/lib and the app will find it automatically.
    • To use the MySQL configuration above, you'll need to download the MySQL connector driver JAR yourself.

Mail Forwarding

To release forwarded mails from HoldMail to the real world, you'll need to configure an external SMTP relay server. By default, HoldMail is configured with itself as the outgoing SMTP relay, so forwarded messages will just end up back in HoldMail!

This feature is in its infancy, and can be temperamental. Most real-world relays are (and should be) pretty strict and may reject, or worse, silently discard a forwarded email. A familiar "From" email may be specified, as many relays won't trust arbitrary sender addresses. Your system/network administrator may be needed to help you trace outbound delivery issues.

# the outgoing relay hostname (default: localhost)
holdmail.outgoing.smtp.server=localhost

# the outgoing relay port (default: holdmail's SMTP port)
holdmail.outgoing.smtp.port=${holdmail.smtp.port}

# the "From" header to be set on a forwarded mail (default: [email protected])
[email protected]

Run It From Source

HoldMail's backend is a Spring Boot application, exposing a REST API and SMTP server. The UI is built with Vue.js.

You'll Need:

To build from the command line, use:

gradle build (this builds the UI as well)

You'll find the JARs under build/libs, with the RPM under build/rpm.

Most modern Java-aware IDEs should be able to import build.gradle and launch the app by running the HoldMailApplication class, but from the command line, the server can be launched in dev mode by using:

gradle bootRun

The UI can also be run in dev mode by navigating to the client/ directory and using:

npm start

Run it from Docker

Images of HoldMail are pushed to our private docker registry hosted on Bintray. The image pushed is our MySQL based image, and should be used within a docker compose or similar setup pointing to an external MySQL database. You can find an example at docker-compose.yml.

If you want to pull the container yourself, you can use docker pull spartasystems-docker-containers.bintray.io/sparta/holdmail

Building the Docker container

To build the application, including docker image and pushing to bintray, use the following gradle command:

./gradlew build docker dockerPush

If you want to push to another registry, you can use -DdockerName=your.repo/namespace/image-name on the command line.

Meta

License

HoldMail is licensed under the Apache 2.0 license.

Sparta Systems

© Copyright 2016 - 2018 Sparta Systems Inc.

Sparta Systems helps customers bring products to market safely and efficiently by delivering quality management software solutions that provide control and transparency throughout the enterprise and their critical supplier network.

HoldMail is a product of Sparta's R&D department, built to help us test notification systems in our applications. Efficient and comprehensive automated testing is an integral feature of how we build software. Come work with us!.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].