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

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:
    # Run until Ctrl-C
    server.serve_forever()

Metadata

Release files for minismtpd 0.3

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.3
File Interpreter ABI Platform
minismtpd-0.3-py3-none-any.whl Python 3 none any Details

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

Download URL minismtpd-0.3-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7a5b4b88396f145b3a1975be62e808e26487eb3c3504c814ee674a2e1734886
BLAKE2b-256 checksum
How to use checksums
726b852bc7d9ecb91b4404e1881131d05a5a91621c197bee939cef78fa0ae6dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

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