MogiMail
MogiMail is an embedded SMTP server for testing.
It enables testing of email code without using mocks.
Installation
Add the following to Cargo.toml.
[]
= "0.1.1"
Usage
As a library
use SmtpServer;
use mpsc;
use thread;
use Duration;
As a standalone server
# Start with default settings (localhost:2525)
# Start with specified address and hostname
The standalone server will output received emails to standard output in order.
Running example code
Testing
Run the test suite:
Supported SMTP commands
HELO- Identify the senderMAIL FROM- Specify the sender's addressRCPT TO- Specify the destination (multiple destinations are supported)DATA- Send the bodyRSET- Reset the current transactionNOOP- Do nothingQUIT- Close connection
Notes
- Only the "minimal implementation" defined in RFC 821 is implemented.
- Runs in-memory only. Email persistence is not supported.
- SMTP authentication is not supported.
- SSL/TLS connection is not supported.
- Mail relay is not supported.
License
This library is licensed under the MIT License. See the LICENSE file for details.