Skip to main content

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

podop-0.2.5.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

podop-0.2.5-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file podop-0.2.5.tar.gz.

File metadata

  • Download URL: podop-0.2.5.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.2

File hashes

Hashes for podop-0.2.5.tar.gz
Algorithm Hash digest
SHA256 ca5514a509c51e7c8e3093db85e8158c8c4402a0f581fce1452503ebbb7c813c
MD5 b09148fa148b38e6bee84cffe43f3e0b
BLAKE2b-256 21e300f368b10ae6586d5cbd629d116100733d747a224e671925f56a05ccf335

See more details on using hashes here.

File details

Details for the file podop-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: podop-0.2.5-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

Hashes for podop-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 251277f0b32d3ba7c1c50a1246483b5a37e43c30bc3643e5d6def58b851d6ab4
MD5 a0ab47b8eef285286c031b9a0567b158
BLAKE2b-256 fe2afb41b45785e3a78fb9140f9f040de0cc54b1f98edc2d3dd25812b56f1aee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page