GithubHelp home page GithubHelp logo

vschwaberow / mailtutan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mailtutan/mailtutan

0.0 1.0 0.0 1.26 MB

An SMTP server for test and development environments written in Rust

License: MIT License

Rust 91.68% Makefile 1.59% HTML 5.89% Dockerfile 0.84%

mailtutan's Introduction

Mailtutan

This is a repository for Mailtutan, a SMTP server built in Rust. The server allows you to simulate an SMTP (Simple Mail Transfer Protocol) server for testing and development purposes without actually sending emails to real addresses.

screenshot-1

Features

  • Simulates an SMTP server locally for testing and development.
  • Logs all incoming emails, including the headers and body.
  • Provides a web interface and REST API to view the list of emails.
  • Basic HTTP Authentication on web interface and REST API ( rfc7617 )
  • Supports multiple client connections simultaneously.
  • Supports encryption on transit (TLS) on SMTP
  • Supports real-time updates using WebSockets for the web interface.
  • Lightweight and efficient implementation in Rust. The docker image on docker hub is < 2MB.
  • Multiple storage options: Memory ( default ), Maildir ( in file )
  • Supports SMTP Auth ( Plain )

Installation

Compile from source

git clone [email protected]:mailtutan/mailtutan.git
cd mailtutan
make all # app will be available at ./target/release/mailtutan

Cargo

cargo install mailtutan

AUR

yay -S mailtutan-bin

Docker

docker run -p 1080:1080 -p 1025:1025 -d mailtutan/mailtutan:latest

Download binary executables

Check out the latest release

Configuration

By default, Mailtutan listens on port 1025 for SMTP and logs incoming emails to memory. The web interface is available on port 1080. However, you can customize the server configuration by supported parameters and environment variables.

$ mailtutan -h
An SMTP server for test and development environments.

Usage: mailtutan [OPTIONS]

Options:
      --ip <IP>
          IPv4 address [env: MAILTUTAN_IPADDR=] [default: 0.0.0.0]
      --http-port <HTTP_PORT>
          HTTP Port number [env: MAILTUTAN_HTTP_PORT=] [default: 1080]
      --smtp-port <SMTP_PORT>
          SMTP Port number [env: MAILTUTAN_SMTP_PORT=] [default: 1025]
      --smtp-cert-path <SMTP_CERT_PATH>
          SMTP Cert Path [env: MAILTUTAN_SMTP_CERT_PATH=]
      --smtp-key-path <SMTP_KEY_PATH>
          SMTP Key Path [env: MAILTUTAN_SMTP_KEY_PATH=]
      --smtp-auth-username <SMTP_AUTH_USERNAME>
          SMTP Auth Username [env: MAILTUTAN_AUTH_USERNAME=]
      --smtp-auth-password <SMTP_AUTH_PASSWORD>
          SMTP Auth Password [env: MAILTUTAN_AUTH_PASSWORD=]
      --http-auth
          HTTP Auth [env: MAILTUTAN_HTTP_AUTH=]
      --http-username <HTTP_USERNAME>
          HTTP Username [env: MAILTUTAN_HTTP_USERNAME=] [default: admin]
      --http-password <HTTP_PASSWORD>
          HTTP Password [env: MAILTUTAN_HTTP_PASSWORD=] [default: admin]
      --messages-limit <MESSAGES_LIMIT>
          Messages Limit [env: MAILTUTAN_MESSAGES_LIMIT=] [default: 1000]
      --storage <STORAGE>
          Storage [env: MAILTUTAN_STORAGE=] [default: memory] [possible values: memory, maildir]
      --maildir-path <MAILDIR_PATH>
          Storage [env: MAILTUTAN_MAILDIR_PATH=] [default: maildir]
  -h, --help
          Print help
  -V, --version
          Print version

Usage

To send emails to Mailtutan, configure your email client or application to use the server's IP address or hostname and the configured port number. Any emails sent to this server will be captured and logged.

You can access the web interface to view the list of logged emails by navigating to http://localhost:1080 in your web browser. Additionally, a REST API is available at http://localhost:1080/api/ to programmatically access the email data.

API

HTTP method endpoint description
GET /api/messages get list of messages
GET /api/messages/:id/json get message's details
GET /api/messages/:id/source get message's source
GET /api/messages/:id/plain get message's plain text
GET /api/messages/:id/html get message's HTML
GET /api/messages/:id/parts/:cid get message's attachment
DELETE /api/messages/:id delete a message
DELETE /api/messages delete all messages
GET /api/version get application version
GET /api/ws subscribe to web socket to get updates

Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository. Make sure to follow the existing coding style and guidelines.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.

Acknowledgments

  • This project was inspired by the need for a lightweight fake SMTP server for testing and development purposes.
  • Thanks to the Rust programming language community for providing excellent tools and libraries for building efficient and reliable software.

mailtutan's People

Contributors

mohsen-alizadeh avatar stappersg avatar akbari10352 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.