mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Documentation update
This commit is contained in:
@@ -422,7 +422,7 @@ be used by Postfix to lookup into Modoboa tables.
|
||||
To automaticaly generate the requested map files and store them in a
|
||||
directory, run the following command::
|
||||
|
||||
$ modoboa-admin.py postfix_maps --dbtype <mysql|postgres|sqlite> --extensions <extension names> <directory>
|
||||
$ modoboa-admin.py postfix_maps --dbtype <mysql|postgres|sqlite> --extensions all <directory>
|
||||
|
||||
``<directory>`` is the directory where the files will be
|
||||
stored. Answer the few questions and you're done.
|
||||
|
||||
@@ -11,6 +11,7 @@ from django.template import Context, Template
|
||||
|
||||
import dj_database_url
|
||||
|
||||
from modoboa.lib.api_client import ModoAPIClient
|
||||
from . import Command
|
||||
|
||||
MAP_FILE_TEMPLATE = """user = {{ dbuser }}
|
||||
@@ -85,8 +86,11 @@ class MapFilesGenerator(object):
|
||||
"""Load specified extensions."""
|
||||
if "all" in extensions:
|
||||
# Retrieve extension list from the API
|
||||
return
|
||||
official_exts = ModoAPIClient().list_extensions()
|
||||
extensions = [extension["name"] for extension in official_exts]
|
||||
|
||||
for extension in extensions:
|
||||
extension = extension.replace("-", "_")
|
||||
try:
|
||||
__import__(extension, locals(), globals(), ["postfix_maps"])
|
||||
except ImportError:
|
||||
@@ -126,6 +130,9 @@ query = {{ query|safe }}
|
||||
|
||||
|
||||
class PostfixMapsCommand(Command):
|
||||
|
||||
"""Base command to generate map files."""
|
||||
|
||||
help = "Generate ready-to-use postfix map files"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user