Skip to main content

minismtpd

Tests

License

This library is based on now-discontinued smtpd module from the Python 3.11 standard library. The original module and its tests are licensed under Python Software Foundation License Version 2.

The modifications and new code is licensed under the BSD-3-Clause license.

Modifications

  • Updated to run using socketserver instead of asyncore and asynchat
  • Removed CLI
  • Removed DebuggingProxy and PureProxy classes
  • Removed the decode_data constructor argument (always disabled)
  • Removed the enable_SMTPUTF8 constructor argument (always enabled)
  • Added type annotations

Install

pip install minismtpd

Use

import signal

from minismtpd import SMTPServer


class MyServer(SMTPServer):
    def process_message(self, peer, mailfrom, rcpttos, data):
        print(f"Peer: {peer}")
        print(f"Mail from: {mailfrom}")
        print(f"Rcpt To: {rcpttos}")
        print(f"Data: {data}")


with MyServer(("localhost", 2525)) as server:
    print("Listening on localhost:2525 ...")

    def on_signal(signum, frame):
        print("Shutting down...")
        server.shutdown()

    # Run until Ctrl-C
    signal.signal(signal.SIGINT, on_signal)
    server.serve_forever()

Metadata

Release files for minismtpd 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for minismtpd 0.5
File Interpreter ABI Platform Actions
minismtpd-0.5-py3-none-any.whl Python 3 none any Details for minismtpd-0.5-py3-none-any.whl

Release files / minismtpd-0.5-py3-none-any.whl

Download URL minismtpd-0.5-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22375bac0366d7fd86c98d99932785f57f9a7a2778140245c6b0e7ca456e20e8
BLAKE2b-256 checksum
How to use checksums
59d06c2a5ce51f4bd1baf3040b138882f733556f1f0241066bbb6073f6ef2d8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for minismtpd 0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page