Postfix and Dovecot proxy
Project description
Podop is a piece of middleware designed to run between Postfix or Dovecot on one side, any Python implementation of a table lookup protocol on the other side.
It is thus able to forward Postfix maps and Dovecot dicts to the same (or multiple) backends in order to write a single, more flexible backend for a mail distribution.
Examples
- Connect Postfix to a DNS lookup so that every domain that has a proper MX record to your Postfix is actually accepted as a local domain
- Connect both Postfix and Dovecot to an HTTP microservice to run a high availability microservice-based mail service
- Use a single database server running any Python-compatible API for both your Postfix and Dovecot servers
Configure Podop tables
Podop tables are configured through CLI arguments when running the server.
You must provide a --name for the table, a --type for the table and
a --param that parametrizes the map.
URL table
The URL table will initiate an HTTP GET request for read access and an HTTP
POST request for write access to a table. The table is parametrized with
a template URL containing § (or {}) for inserting the table key.
--name test --type url --param http://microservice/api/v1/map/tests/§
GET requests should return 200 and a JSON-encoded object
that will be passed either to Postfix or Dovecot. They should return 4XX
for access issues that will result in lookup miss, and 5XX for backend
issues that will result in a temporary failure.
POST requests will contain a JSON-encoded object in the request body, that will be saved in the table.
Postfix usage
In order to access Podop tables from Postfix, you should setup socketmap
Postfix maps. For instance, in order to access the test table on a Podop
socket at /tmp/podop.socket, use the following setup:
virtual_alias_maps = socketmap:unix:/tmp/podop.socket:test
Multiple maps or identical maps can be configured for various usages.
virtual_alias_maps = socketmap:unix:/tmp/podop.socket:alias
virtual_mailbox_domains = socketmap:unix:/tmp/podop.socket:domain
virtual_mailbox_maps = socketmap:unix:/tmp/podop.socket:alias
In order to simplify the configuration, you can setup a shortcut.
podop = socketmap:unix:/tmp/podop.socket
virtual_alias_maps = ${podop}:alias
virtual_mailbox_domains = ${podop}:domain
virtual_mailbox_maps = ${podop}:alias
Dovecot usage
In order to access Podop tables from Dovecot, you should setup a proxy
Dovecot dictionary. For instance, in order to access the test table on
a Podop socket at /tmp/podop.socket, use the following setup:
mail_attribute_dict = proxy:/tmp/podop.socket:test
Multiple maps or identical maps can be configured for various usages.
mail_attribute_dict = proxy:/tmp/podop.socket:meta
passdb {
driver = dict
args = /etc/dovecot/auth.conf
}
userdb {
driver = dict
args = /etc/dovecot/auth.conf
}
# then in auth.conf
uri = proxy:/tmp/podop.socket:auth
iterate_disable = yes
default_pass_scheme = plain
password_key = passdb/%u
user_key = userdb/%u
Contributing
Podop is free software, open to suggestions and contributions. All components are free software and compatible with the MIT license. All the code is placed under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file podop-0.2.6.tar.gz.
File metadata
- Download URL: podop-0.2.6.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d269a2b8eb13b1017f1df48349e7f6d40d5fdfc089e0d7752de7b2034870ae25
|
|
| MD5 |
1a5608be353fe2f3c1cf29323447bc2a
|
|
| BLAKE2b-256 |
963c91d620a56fa6cbd94e439e9fe42f0a6b19d891da187c0718321e820acf2e
|
File details
Details for the file podop-0.2.6-py3-none-any.whl.
File metadata
- Download URL: podop-0.2.6-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a0a1d3a8d5447f3a30c775e52e4c61f6a913ee823fd1850a6a310b0c4e89243
|
|
| MD5 |
379e80e3151a19a0cff847dac03e8a71
|
|
| BLAKE2b-256 |
e57b7b83d53208566fedfab7d253cbacc384d9fa739f0f62009a7b1b3cd2668a
|