From 2b80118e331450ad406aff69ad2c6cc2755ee707 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Wed, 17 Jun 2020 16:04:03 +0200 Subject: [PATCH] Added documentation. --- doc/manual_installation/modoboa.rst | 33 +++++++++++++++++++++++++++++ doc/manual_installation/postfix.rst | 20 +++++++++++++++++ doc/upgrade.rst | 14 ++++++++++++ 3 files changed, 67 insertions(+) diff --git a/doc/manual_installation/modoboa.rst b/doc/manual_installation/modoboa.rst index 61d48fe02..d232a629a 100644 --- a/doc/manual_installation/modoboa.rst +++ b/doc/manual_installation/modoboa.rst @@ -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 `_. Current features are: + +* Define daily sending limits for domains and/or accounts + +A `redis server `_ 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 ` to use it. Now you can continue to the :ref:`webserver` section. diff --git a/doc/manual_installation/postfix.rst b/doc/manual_installation/postfix.rst index 3a5c4589e..6d331addb 100644 --- a/doc/manual_installation/postfix.rst +++ b/doc/manual_installation/postfix.rst @@ -65,3 +65,23 @@ Use the following configuration in the :file:`/etc/postfix/main.cf` file Replace ```` 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. diff --git a/doc/upgrade.rst b/doc/upgrade.rst index ecbac4b80..948ff7130 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -91,6 +91,20 @@ Rebuild Virtual Environment Specific instructions ********************* +1.16.0 +====== + +A new :ref:`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 = '' +REDIS_PORT = 6379 +REDIS_QUOTA_DB = 0 +REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB) + 1.15.0 ======