mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
@@ -55,6 +55,15 @@ For dovecot 2.0 and older, use the `autocreate
|
||||
Operations on the file system
|
||||
-----------------------------
|
||||
|
||||
.. warning::
|
||||
|
||||
Modoboa needs to access the ``dovecot`` binary to check its
|
||||
version. To find the binary path, we use the ``which`` command
|
||||
first and then try known locations (:file:`/usr/sbin/dovecot` and
|
||||
:file:`/usr/local/sbin/dovecot`). If you installed dovecot in a
|
||||
custom location, please tell us where the binary is by using the
|
||||
``DOVECOT_LOOKUP_PATH`` setting (see :file:`settings.py`).
|
||||
|
||||
Three operation types are considered:
|
||||
|
||||
#. Mailbox creation
|
||||
|
||||
@@ -172,6 +172,8 @@ SOUTH_TESTS_MIGRATE = False
|
||||
|
||||
#MODOBOA_CUSTOM_LOGO = os.path.join(MEDIA_URL, "custom_logo.png")
|
||||
|
||||
#DOVECOT_LOOKUP_PATH = ('/path/to/dovecot', )
|
||||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'modoboa.lib.authbackends.SimpleBackend',
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy
|
||||
from modoboa.lib.formutils import YesNoField, SeparatorField
|
||||
from modoboa.lib.sysutils import exec_cmd
|
||||
@@ -49,10 +50,13 @@ class AdminParametersForm(parameters.AdminParametersForm):
|
||||
hide_fields = False
|
||||
dpath = None
|
||||
code, output = exec_cmd("which dovecot")
|
||||
known_paths = ("/usr/sbin/dovecot", "/usr/local/sbin/dovecot")
|
||||
if not code:
|
||||
dpath = output.strip()
|
||||
else:
|
||||
known_paths = getattr(
|
||||
settings, "DOVECOT_LOOKUP_PATH",
|
||||
("/usr/sbin/dovecot", "/usr/local/sbin/dovecot")
|
||||
)
|
||||
for fpath in known_paths:
|
||||
if os.path.isfile(fpath) and os.access(fpath, os.X_OK):
|
||||
dpath = fpath
|
||||
|
||||
Reference in New Issue
Block a user