Added documentation.

This commit is contained in:
Antoine Nguyen
2020-06-17 16:04:03 +02:00
parent 5b0bba4341
commit 2b80118e33
3 changed files with 67 additions and 0 deletions
+33
View File
@@ -204,5 +204,38 @@ following content inside::
# Generate DKIM keys (they will belong to the user running this job)
* * * * * root umask 077 && $PYTHON $INSTANCE/manage.py modo manage_dkim_keys
.. _policy_daemon:
Policy daemon
-------------
Modoboa comes with a built-in `Policy Daemon for Postfix <http://www.postfix.org/SMTPD_POLICY_README.html>`_. Current features are:
* Define daily sending limits for domains and/or accounts
A `redis server <https://redis.io/>`_ is required to run this new daemon.
You can launch it manually using the following command:
.. sourcecode:: bash
(env)> python manage.py policy_daemon
But we recommend an automatic start using ``systemd`` or
``supervisor``. Here is a configuration example for ``supervisor``:
.. sourcecode:: ini
[program:policyd]
autostart=true
autorestart=true
command=/srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py policy_daemon
directory=/srv/modoboa
redirect_stderr=true
user=modoboa
numprocs=1
It will listen by default on ``127.0.0.1`` and port ``9999``. The
policy daemon won't do anything unless you tell :ref:`postfix <policyd_config>` to use it.
Now you can continue to the :ref:`webserver` section.
+20
View File
@@ -65,3 +65,23 @@ Use the following configuration in the :file:`/etc/postfix/main.cf` file
Replace ``<driver>`` by the name of the database you use.
Restart Postfix.
.. _policyd_config:
Policy daemon
-------------
If you want to enable the built-in policy daemon, add the following
content to the :file:`/etc/postfix/main.cf` file::
smtpd_recipient_restrictions =
# ...
check_policy_service inet:127.0.0.1:9999
# ...
And reload postfix.
.. note::
The ``check_policy_service`` line must be placed before the
``permit_mynetworks`` one, otherwise the daemon won't be called.
+14
View File
@@ -91,6 +91,20 @@ Rebuild Virtual Environment
Specific instructions
*********************
1.16.0
======
A new :ref:`policy daemon <policy_daemon>` has been added. Make sure
to have a Redis instance running on your server, then add the following
settings to your ``settings.py`` file:
.. sourcecode:: python
REDIS_HOST = '<IP or hostname here>'
REDIS_PORT = 6379
REDIS_QUOTA_DB = 0
REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB)
1.15.0
======