Ajout de fichiers dans le plugins python.
darcs-hash:20071218042114-af139-8ce65c1c19fb24d871bddf18dfc29bd0627a40b1.gz
This commit is contained in:
parent
30982be082
commit
81ab684f93
12 changed files with 135 additions and 7 deletions
24
Python/etc/apt/sources.list/gen.py
Normal file
24
Python/etc/apt/sources.list/gen.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
|
||||||
|
include("mode/space")
|
||||||
|
header()
|
||||||
|
|
||||||
|
if has("debian-mirror"):
|
||||||
|
mirror = "file:/mirror/"
|
||||||
|
else:
|
||||||
|
mirror = "ftp:/mirror.adm.crans.org/"
|
||||||
|
|
||||||
|
def source(args):
|
||||||
|
%deb mirror + args
|
||||||
|
%deb-src mirror + args
|
||||||
|
|
||||||
|
source("debian etch main contrib")
|
||||||
|
source("debian-volatile etch/volatile main contrib")
|
||||||
|
source("debian-security etch/updates main")
|
||||||
|
|
||||||
|
if has("test"):
|
||||||
|
@# Mplayer...
|
||||||
|
source("debian-multimedia etch main")
|
||||||
|
|
||||||
|
@# Paquet construit a la main
|
||||||
|
source("custom ./")
|
7
Python/etc/postfix/ldap-aliases.cf/gen.py
Normal file
7
Python/etc/postfix/ldap-aliases.cf/gen.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
|
||||||
|
header("Recherche des alias dans la base ldap.")
|
||||||
|
|
||||||
|
query="(|(mailAlias=%s)(canonicalAlias=%s))"
|
||||||
|
result="uid"
|
||||||
|
dump("template/postfix/ldap")
|
3
Python/etc/postfix/ldap-aliases.cf/info.xml
Normal file
3
Python/etc/postfix/ldap-aliases.cf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner="root" group="root" perms="0600"/>
|
||||||
|
</FileInfo>
|
7
Python/etc/postfix/ldap-canonical.cf/gen.py
Normal file
7
Python/etc/postfix/ldap-canonical.cf/gen.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
|
||||||
|
header()
|
||||||
|
|
||||||
|
query="(&(mail=%s)(canonicalAlias=*))"
|
||||||
|
result="canonicalAlias"
|
||||||
|
dump("template/postfix/ldap")
|
3
Python/etc/postfix/ldap-canonical.cf/info.xml
Normal file
3
Python/etc/postfix/ldap-canonical.cf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner="root" group="root" perms="0600"/>
|
||||||
|
</FileInfo>
|
7
Python/etc/postfix/ldap-sqlgrey.cf/gen.py
Normal file
7
Python/etc/postfix/ldap-sqlgrey.cf/gen.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
|
||||||
|
header("Test si le greylisting est active pour un certain compte.")
|
||||||
|
|
||||||
|
query="(|(uid=%u)(mailAlias=%u)(canonicalAlias=%u))"
|
||||||
|
result="contourneGreylist"
|
||||||
|
dump("template/postfix/ldap")
|
3
Python/etc/postfix/ldap-sqlgrey.cf/info.xml
Normal file
3
Python/etc/postfix/ldap-sqlgrey.cf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner="root" group="root" perms="0600"/>
|
||||||
|
</FileInfo>
|
21
Python/etc/postfix/transport/gen.py
Normal file
21
Python/etc/postfix/transport/gen.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- coding: utf-8; mode: python -*-
|
||||||
|
|
||||||
|
header("Transport des mails.")
|
||||||
|
|
||||||
|
if has("mailing-list-manager"):
|
||||||
|
@# Les mailing-listes sont delivrees localement
|
||||||
|
@lists.crans.org local
|
||||||
|
else:
|
||||||
|
@lists.crans.org smtp:[lists.adm.crans.org]
|
||||||
|
|
||||||
|
if has("news-server"):
|
||||||
|
@# Le corbeau, c'est ici
|
||||||
|
@corbeau@crans.org local
|
||||||
|
|
||||||
|
if not has("users"):
|
||||||
|
@# C'est le serveur des adherents qui fait les livraisons des
|
||||||
|
@# adresses clubs et adherents
|
||||||
|
@crans.org smtp:[users.adm.crans.org]
|
||||||
|
@crans.ens-cachan.fr smtp:[users.adm.crans.org]
|
||||||
|
@install-party.ens-cachan.fr smtp:[users.adm.crans.org]
|
||||||
|
@clubs.ens-cachan.fr smtp:[users.adm.crans.org]
|
|
@ -28,12 +28,15 @@ def comment(line):
|
||||||
'''Écrit un commentaire'''
|
'''Écrit un commentaire'''
|
||||||
out("# " + line + "\n")
|
out("# " + line + "\n")
|
||||||
|
|
||||||
def header(desc, mode="conf-unix"):
|
emacs_mode = "conf-unix"
|
||||||
|
|
||||||
|
def header(desc=None, mode=None):
|
||||||
'''Écrit une en-tête de fichier avec un commentaire'''
|
'''Écrit une en-tête de fichier avec un commentaire'''
|
||||||
comment("-*- mode: %s; coding: utf-8 -*-" % mode)
|
comment("-*- mode: %s; coding: utf-8 -*-" % (mode or emacs_mode))
|
||||||
@#
|
@#
|
||||||
@# Fichier gere par BCfg2
|
@# Fichier gere par BCfg2
|
||||||
@#
|
@#
|
||||||
|
if desc:
|
||||||
lines = desc.split('\n')
|
lines = desc.split('\n')
|
||||||
if lines[-1] == "":
|
if lines[-1] == "":
|
||||||
lines.pop()
|
lines.pop()
|
||||||
|
@ -69,3 +72,16 @@ def onoff(b):
|
||||||
return "on"
|
return "on"
|
||||||
else:
|
else:
|
||||||
return "off"
|
return "off"
|
||||||
|
|
||||||
|
def outl(line):
|
||||||
|
out(line)
|
||||||
|
out("\n")
|
||||||
|
|
||||||
|
# Le serveur qui gère la base de données
|
||||||
|
if has("db-server"):
|
||||||
|
# Pour ceux qui ont la base ou une copie en locale
|
||||||
|
# on regarde dans celle-ci
|
||||||
|
ldap_host = "ldap://localhost/"
|
||||||
|
else:
|
||||||
|
# Sinon on regarde dans la base principale
|
||||||
|
ldap_host = "ldap://ldap.adm.crans.org/"
|
||||||
|
|
7
etc/python/mode/space.py
Normal file
7
etc/python/mode/space.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- coding: utf-8; mode: python -*-
|
||||||
|
#
|
||||||
|
# Pour les fichiers de configurations du type conf-space comme définit
|
||||||
|
# dans emacs
|
||||||
|
|
||||||
|
keysep = " "
|
||||||
|
emacs_mode = "conf-space"
|
7
etc/python/secrets.py
Normal file
7
etc/python/secrets.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Recuperation des mots de passe
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path.append("/etc/crans/secrets")
|
||||||
|
import secrets
|
23
etc/python/template/postfix/ldap.py
Normal file
23
etc/python/template/postfix/ldap.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Ce fichier sert de template pour les fichiers /etc/postfix/ldap-*.cf
|
||||||
|
# Pour l'utuliser, il faut l'inclure en instanciant les variables:
|
||||||
|
# query: requete faite a la base
|
||||||
|
# result: le champ a recuperer dans le resultat
|
||||||
|
|
||||||
|
include("secrets")
|
||||||
|
|
||||||
|
@# Connexion LDAP
|
||||||
|
%server_host = ldap_host
|
||||||
|
%search_base = "ou=data,dc=crans,dc=org"
|
||||||
|
%version = 3
|
||||||
|
%bind = True
|
||||||
|
%bind_dn = secrets.ldap_postfix_auth_dn
|
||||||
|
%bind_pw = secrets.ldap_postfix_password
|
||||||
|
|
||||||
|
@# Requete faite a la base, %s est remplace
|
||||||
|
@# par l'alias recherche
|
||||||
|
%query_filter = query
|
||||||
|
|
||||||
|
@# Le champ qui nous interresse en particulier
|
||||||
|
%result_attribute = result
|
Loading…
Add table
Add a link
Reference in a new issue