mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
New plugin that allows the handling of an Amavisd-new SQL quarantine. NB: a DB connections manager has been added inside the lib because Django does not support multiple connections at the same time. The main consequence is that we don't use an ORM and that we have to rewrite a small wrapper that supports several DB (mysql, postgresql, etc.). Adding a dependancy to an existing ORM module (like SQLalchemy) is heavy, we don't want that for now.
24 lines
538 B
Python
24 lines
538 B
Python
# -*- coding: utf-8 -*-
|
|
import os
|
|
import re
|
|
|
|
extensions = []
|
|
|
|
def loadextensions():
|
|
from django.conf import settings
|
|
|
|
expr = re.compile("mailng\.extensions\.(.+)")
|
|
for app in settings.INSTALLED_APPS:
|
|
m = expr.match(app)
|
|
if not m:
|
|
continue
|
|
module = __import__(m.group(1), globals(), locals(), ['main'])
|
|
module.main.init()
|
|
globals()['extensions'] += [module]
|
|
|
|
def loadmenus():
|
|
result = ()
|
|
for mod in extensions:
|
|
result += mod.main.urls()
|
|
return result
|