python-slimta

Python libraries to send, receive, and queue email.

Stars
168
Forks
43
Open issues
8
Closed issues
84
Last release
over 1 year ago
Last commit
about 1 year ago
Watchers
168
Total releases
14
Total commits
869
Open PRs
4
Closed PRs
84
Repo URL
Platform
License
mit
Category
Usecase
Technology
Python
Offers premium version?
NO
Proprietary?
NO
About

API Documentation and Manual

About

The python-slimta project is a Python library offering the building blocks necessary to create a full-featured MTA. Most MTAs must be configured, but an MTA built with python-slimta is coded. An MTA built with python-slimta can incorporate any protocol or policy, custom or built-in. An MTA built with python-slimta can integrate with other Python libraries and take advantage of Python's great community.

The python-slimta project is released under the MIT License. It is tested for Python 3.6+.

Getting Started

Use a virtualenv to get started developing against python-slimta:

$ cd python-slimta/
$ python3 -m venv .venv
$ source .venv/bin/activate
(.venv)$ pip install -U pip wheel setuptools

To run the suite of unit tests included with slimta:

(.venv)$ pip install -r requirements-dev.txt
(.venv)$ py.test
Running the Example

The example in examples/slimta-mail.py provides a fully functional mail server for inbound and outbound email. To avoid needing to run as superuser, the example uses ports 1025, 1465 and 1587 instead.

It needs several things to run:

  • An activated virtualenv as created above in Getting Started.

  • A TLS certificate and key file. The easiest way to generate one:

openssl req -x509 -nodes -subj '/CN=localhost' -newkey rsa:1024 -keyout cert.pem -out cert.pem

Check out the in-line documentation with --help, and then run:

(.venv)$ ./slimta-mail.py

Manually or with a mail client, you should now be able to deliver messages. On port 1025, messages will go to unique files in the current directory. On port 1587, messages will be delivered to others using MX records! To try out a TLS connection:

$ openssl s_client -host localhost -port 1587 -starttls smtp
Contributing

If you want to fix a bug or make a change, follow the fork pull request model. We've had quite a few awesome contributors over the years, and are always open to more.

Special thanks to JocelynDelalande for extensive work bringing Python 3 compatibility to the project!

Alternative Projects
No projects found

Subscribe to Open Source Businees Newsletter

Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.

We'll never share your email with anyone else.