gpg-lacre/doc/adv-filt.md

46 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2022-10-17 23:41:03 +02:00
# Advanced Filter
## Postfix Filters
There are two types of Postfix mail filters: Simple Filters and Advanced
Filters. Simple Filters are executed for each incoming email as a new
process, which may turn out to be expensive in terms of resources. Advanced
Filters work as a mail-processing proxies.
2022-10-17 23:41:03 +02:00
For detailed documentation, see [FILTER README](https://www.postfix.org/FILTER_README.html).
## Installation
Just use the following command to install dependencies:
```
pip install -r requirements.txt
```
2022-10-17 23:41:03 +02:00
## Configuration
Lacre Advanced Filter, also known as daemon, is configured in the `[daemon]`
section of configuration file. Two obligatory parameters to be defined there
2022-10-17 23:41:03 +02:00
are:
* `host` -- IP address or a host name;
2022-10-17 23:41:03 +02:00
* `port` -- TCP port Lacre should listen on.
The other very important section is `[relay]`, which by default uses Simple
Filter destination. It has to be adjusted for Advanced Filter to work,
2022-10-17 23:41:03 +02:00
setting port to `10026`.
Command to spawn a Lacre daemon process is:
2022-10-17 23:41:03 +02:00
```
LACRE_CONFIG=/etc/lacre.conf PYTHONPATH=... python -m lacre.daemon
```
2022-10-17 23:41:03 +02:00
Two environment variables used here are:
* `LACRE_CONFIG` (not mandatory) -- path to Lacre configuration,
unless it's kept in default location (`/etc/lacre.conf`).
* `PYTHONPATH` (not mandatory) -- location of Lacre modules. You can place
2022-10-17 23:41:03 +02:00
them below your Python's `site-packages` to be reachable by any other
Python software.