{"id":17832419,"url":"https://github.com/4commerce-technologies-ag/midi-smtp-server","last_synced_at":"2025-04-07T13:06:28.943Z","repository":{"id":18408258,"uuid":"21589958","full_name":"4commerce-technologies-AG/midi-smtp-server","owner":"4commerce-technologies-AG","description":"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.","archived":false,"fork":false,"pushed_at":"2023-11-20T03:40:17.000Z","size":2859,"stargazers_count":77,"open_issues_count":9,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-07T13:06:23.730Z","etag":null,"topics":["automation","fake-mail","mail","message-routing","mock-mail","mock-server","mta","openssl","receive-messages","ruby","smtp","smtp-server","smtp-services","starttls"],"latest_commit_sha":null,"homepage":"https://4commerce-technologies-ag.github.io/midi-smtp-server/","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4commerce-technologies-AG.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-07-07T23:08:14.000Z","updated_at":"2025-02-19T15:12:23.000Z","dependencies_parsed_at":"2024-01-05T21:59:09.380Z","dependency_job_id":null,"html_url":"https://github.com/4commerce-technologies-AG/midi-smtp-server","commit_stats":{"total_commits":404,"total_committers":7,"mean_commits":"57.714285714285715","dds":"0.022277227722772297","last_synced_commit":"a9f38701602eb66e9c15dbd6dc0aa6aca4eed2e6"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4commerce-technologies-AG%2Fmidi-smtp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4commerce-technologies-AG%2Fmidi-smtp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4commerce-technologies-AG%2Fmidi-smtp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4commerce-technologies-AG%2Fmidi-smtp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4commerce-technologies-AG","download_url":"https://codeload.github.com/4commerce-technologies-AG/midi-smtp-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657277,"owners_count":20974344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","fake-mail","mail","message-routing","mock-mail","mock-server","mta","openssl","receive-messages","ruby","smtp","smtp-server","smtp-services","starttls"],"created_at":"2024-10-27T19:56:49.911Z","updated_at":"2025-04-07T13:06:28.920Z","avatar_url":"https://github.com/4commerce-technologies-AG.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" style=\"margin-bottom: 2em\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/4commerce-technologies-AG/midi-smtp-server/master/mkdocs/img/midi-smtp-server-logo.png\" alt=\"MidiSmtpServer Logo\" width=\"40%\"/\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eMidiSmtpServer\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThe highly customizable ruby SMTP-Service library\u003c/strong\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n-- Mail-Server, SMTP-Service, MTA, Email-Gateway \u0026 Router, Mail-Automation --\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\n## MidiSmtpServer\n\nMidiSmtpServer 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.\n\nAs 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 event functions to handle and operate on incoming mails. We are using this in conjunction with [Mikel Lindsaar](https://github.com/mikel) great Mail component (https://github.com/mikel/mail). Time to run your own SMTP-Server service.\n\nCheckout all the features and improvements (3.1.1 Process parallelization, 3.0.1 Logging enhancement, 2.3.x Multiple ports and addresses, 2.2.x Encryption [StartTLS], 2.1.0 Authentication [AUTH], 2.1.1 significant speed improvement, etc.) and get more details from section [changes and updates](https://github.com/4commerce-technologies-AG/midi-smtp-server#changes-and-updates).\n\nMidiSmtpServer is an extremely flexible library and almost any aspect of SMTP communications can be handled by deriving its events and using its configuration options.\n\n\u003cbr\u003e\n\n\n## Using the library\n\nTo derive your own SMTP-Server service with DATA processing simply do:\n\n```ruby\n# Server class\nclass MySmtpd \u003c MidiSmtpServer::Smtpd\n\n  # get each message after DATA \u003cmessage\u003e .\n  def on_message_data_event(ctx)\n    # Output for debug\n    logger.debug(\"[#{ctx[:envelope][:from]}] for recipient(s): [#{ctx[:envelope][:to]}]...\")\n\n    # Just decode message once to make sure, that this message ist readable\n    mail = Mail.read_from_string(ctx[:message][:data])\n\n    # handle incoming mail, just show the message subject\n    logger.debug(mail.subject)\n  end\n\nend\n```\n\nPlease checkout the source codes from [Examples](https://github.com/4commerce-technologies-AG/midi-smtp-server/tree/master/examples) for working SMTP-Services.\n\n\u003cbr\u003e\n\n\n## Operation purposes\n\nThere is an endless field of application for SMTP\u0026nbsp;services. You want to create your own SMTP\u0026nbsp;Server as a mail\u0026nbsp;gateway to clean up routed emails from spam and virus content. Incoming mails may be processed and handled native and by proper functions. A SMTP\u0026nbsp;daemon can receive messages and forward them to a service like Slack, Trello, Redmine, Twitter, Facebook, Instagram and others.\n\nThis source code shows the example to receive messages via SMTP and store them to RabbitMQ (Message-Queue-Server) for subsequent processings etc.:\n\n```ruby\n  # get each message after DATA \u003cmessage\u003e .\n  def on_message_data_event(ctx)\n    # Just decode message once to make sure, that this message ist readable\n    mail = Mail.read_from_string(ctx[:message])\n\n    # Publish to rabbit\n    @bunny_exchange.publish(mail.to_s, :headers =\u003e { 'x-smtp' =\u003e mail.header.to_s }, :routing_key =\u003e \"to_queue\")\n  end\n```\n\n\u003cbr\u003e\n\n\n## Installation\n\nMidiSmtpServer is packaged as a RubyGem and hosted on rubygems.\n\n#### CLI\n\nYou can easily install the package by entering following at your command line:\n\n  `gem install midi-smtp-server`\n\nUse the component in your project sources by:\n\n  `require 'midi-smtp-server'`\n\n#### Gemfile\n\nWhen a `Gemfile` handles your dependencies, please consider to use the [pessimistic operator](https://thoughtbot.com/blog/rubys-pessimistic-operator) at least:\n\n  `gem 'midi-smtp-server', '~\u003e 3.1.2''`\n\nAll changes by PATCH versions are always functional and compatible with no issues on update!\n\n\u003cbr\u003e\n\n\n## Library documentation\n\nRead the [MidiSmtpServer Documentation](https://midi-smtp-server.readthedocs.io/) for a complete library documentation.\n\n\u003cbr\u003e\n\n\n## Reliable code\n\nSince version 2.3 implementation and integration tests by minitest framework are added to this repository. While the implementation tests are mostly checking the components, the integration tests try to verify the correct exchange of messages for different scenarios. Last but not least the stress tests do catch some rare conditions to make sure that no information is leaving its thread and process. In addition all sources are checked by rubocop to ensure they fit to the style guides.\n\nYou may run all rubocop tests through the `rake` helper:\n\n```bash\n  bundle exec rake rubocop\n```\n\nYou may also run all tests through the `rake` helper:\n\n```bash\n  bundle exec rake test:all\n```\n\nor with more verbose output:\n\n```bash\n  bundle exec rake test:all v=1\n```\n\nTo just run just a part of the tests, you may select the `specs`, `unit`, `integration` or `stress` tests:\n\n```bash\n  bundle exec rake test:specs\n```\n\nTo just run some selected (by regular expression) tests, you may use the `T=filter` option. The example will run only the tests and specs containing the word _connections_ in their method_name or describe_text:\n\n```bash\n  bundle exec rake test:all v=1 T=connections\n```\n\n_Be aware that the parameters and filter are case sensitive._\n\n#### Style guide links\n\n1. [Ruby style guide](https://rubystyle.guide)\n2. [Minitest style guide](https://minitest.rubystyle.guide)\n3. [Rubocop/Cop documentation](https://docs.rubocop.org)\n4. [Rubocop/Minitest](https://docs.rubocop.org/rubocop-minitest/)\n\n\u003cbr\u003e\n\n\n## Changes and updates\n\nWe suggest everybody using MidiSmtpServer to switch at least to latest 2.3.y. or best to 3.x. The update is painless and mostly without any source code changes :sunglasses:\n\nFor upgrades from previous versions or outdated _MiniSmtpServer_ gem you may follow the guides (see appendix) how to change your existing code to be compatible with the latest releases.\n\n\n#### Latest release: 3.2.1 (2023-08-15)\n\n1. New feature [proxy](https://midi-smtp-server.readthedocs.io/feature_proxy) ([check issue 49](https://github.com/4commerce-technologies-AG/midi-smtp-server/issues/49))\n2. mkdocs update for readthedocs\n\n\n#### Changelog history\n\nA complete list of updates and features can be read in the [CHANGELOG](https://github.com/4commerce-technologies-AG/midi-smtp-server/blob/master/CHANGELOG.md).\n\n\u003cbr\u003e\n\n\n## Upgrading from previous releases :small_red_triangle:\n\nCheckout the [Appendix Upgrade](https://midi-smtp-server.readthedocs.io/appendix_upgrade/) to get your code ready for the latest releases and read about any incompatibilities.\n\n\u003cbr\u003e\n\n\n## Gem Package\n\nYou may find, use and download the gem package on [RubyGems.org](http://rubygems.org/gems/midi-smtp-server).\n\n[![Gem Version](https://badge.fury.io/rb/midi-smtp-server.svg)](http://badge.fury.io/rb/midi-smtp-server) \u0026nbsp;\n[![Ruby](https://github.com/4commerce-technologies-AG/midi-smtp-server/actions/workflows/push-and-pr-testing-ruby-ci.yml/badge.svg)](https://github.com/4commerce-technologies-AG/midi-smtp-server/actions/workflows/push-and-pr-testing-ruby-ci.yml) \u0026nbsp;\n\n\u003cbr\u003e\n\n## Documentation\n\n**[Project homepage](https://4commerce-technologies-ag.github.io/midi-smtp-server)** - you will find a micro-site at [Github](https://4commerce-technologies-ag.github.io/midi-smtp-server)\n\n**[Class documentation](http://www.rubydoc.info/gems/midi-smtp-server/MidiSmtpServer/Smtpd)** - you will find a detailed description at [RubyDoc](http://www.rubydoc.info/gems/midi-smtp-server/MidiSmtpServer/Smtpd)\n\n**[Library manual](https://midi-smtp-server.readthedocs.io/)** - you will find a manual at [ReadTheDocs](https://midi-smtp-server.readthedocs.io/)\n\n\u003cbr\u003e\n\n\n## Author \u0026 Credits\n\nAuthor: [Tom Freudenberg](http://about.me/tom.freudenberg)\n\n[MidiSmtpServer Class](https://github.com/4commerce-technologies-AG/midi-smtp-server/) is inspired from [MiniSmtpServer Class](https://github.com/aarongough/mini-smtp-server) and code written by [Aaron Gough](https://github.com/aarongough) and [Peter Cooper](https://github.com/4commerce-technologies-AG/midi-smtp-server#author--credits)\n\nCopyright (c) 2014-2023 [Tom Freudenberg](https://github.com/TomFreudenberg), [4commerce technologies AG](https://www.4commerce.de/), released under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4commerce-technologies-ag%2Fmidi-smtp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4commerce-technologies-ag%2Fmidi-smtp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4commerce-technologies-ag%2Fmidi-smtp-server/lists"}