Metadata-Version: 2.4
Name: minismtpd
Version: 0.3
Summary: A minimal SMTP server
Author-email: Pēteris Caune <cuu508@monkeyseemonkeydo.lv>
License-Expression: BSD-3-Clause AND PSF-2.0
Project-URL: Repository, https://github.com/cuu508/minismtpd.git
Project-URL: Issues, https://github.com/cuu508/minismtpd/issues
Project-URL: Changelog, https://github.com/cuu508/minismtpd/blob/main/CHANGELOG.md
Keywords: smtp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# minismtpd

[![Tests](https://github.com/cuu508/minismtpd/actions/workflows/test.yaml/badge.svg)](https://github.com/cuu508/minismtpd/actions/workflows/test.yaml)

## 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](https://docs.python.org/3/library/socketserver.html)
  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

```python
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()
```
