github stars   gem version   gem usage   github license

MidiSmtpServer is the highly customizable ruby SMTP-Server and SMTP-Service library with builtin support for AUTH and SSL/STARTTLS, 8BITMIME and SMTPUTF8, IPv4 and IPv6 and additional features.

As a library it is mainly designed to be integrated into your projects as serving a SMTP-Server service. The lib will do nothing with your mail and you have to create your own suitable functions to handle and operate on incoming mails. MidiSmtpServer is an extremely flexible class and almost any aspect of SMTP communication can be handled by deriving its events and using its configuration options.

There is an endless field of application for SMTP services. You want to create your own SMTP Server as a mail gateway to clean up routed emails from spam and virus content. A SMTP daemon can receive messages and forward them to a service like Slack, Trello, Redmine, Twitter, Facebook, Instagram and others. Incoming mails may be processed and handled native and by proper functions.

Whatever purpose of operation is given, if SMTP processing is required, you can choose MidiSmtpServer.



Easy to use

MidiSmtpServer encapsulates the complexity and diversity of the SMTP standard and its extensions in a simple and consistent API. Parameters and methods allow specific usage in own applications, whether your requirements are simple or complex.


Extremely flexible

All relevant aspects of SMTP communication can be accessed and controlled by the extremely flexible API. No matter if mail routing, mail processing or automation is the purpose of operation - if SMTP processing is required, you can choose MidiSmtpServer.


High valueable

The library supports the development of high productive solutions while easy to use in own implementations. The stability and well defined API ensures to get a quick valueable result with little time and effort.



MidiSmtpServer allows encrypted connections secured by STARTTLS. The implementation uses the well developed OPENSSL library and allows to set a number of different ciphers and encryption methods. Optional choose the level and balance of security and compatibilty while the default setup defines a high secured environment.



The library comes up with an authentification API defined by SMTP standard AUTH (PLAIN and LOGIN). Integrations may run in strict or non authentificated mode as well as in mixed mode. The authentication itself is fully open to your development.


Reliable code

The included unit and integration tests are revealing of midi-smtp-server's stability. The tests get enhanced with any update of the library to ensure the stability of existing and new functions. The integration tests are well picked from real life scenarios. Creating new tests is always of particular interest.

Get started


Github is the first place to get the latest information and source codes for midi-smtp-server. The master branch is mostly work in progress. Stable releases are tagged and published on Github as well as on RubyGems. Following the semantic versioning pattern will allow painless updates to newer releases. Please also look at the Contribution guide - any help is appreciated.


The library is published on the well known ruby space at RubyGems. Checkout the library's status and downloads stats. For the past years the trends are looking quite nice. Thanks for supporting this work.

Read The Docs

Use the documentation at Read The Docs to get a practical guide about to use this library. This documentation is work in progress, so you will find new and updated interesting information from time to time. Do not miss the recipes at the Cookbook section.