diff --git a/Cfg/etc/postfix/main.cf/main.cf.G50_mail-satellite b/Cfg/etc/postfix/main.cf/main.cf.G50_mail-satellite deleted file mode 100644 index 00a28f7..0000000 --- a/Cfg/etc/postfix/main.cf/main.cf.G50_mail-satellite +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8; mode: conf-unix -*- -# -# Fichier gere par BCfg2 - -# Les mails viennent de @crans.org -myorigin = crans.org - -# Alias -alias_database = hash:/etc/postfix/aliases -alias_maps = $alias_database - -# Les mails sont envoyes a notre MX -relayhost = smtp.adm.crans.org - -# Utilisation locale uniquement -mynetworks = 127.0.0.0/8 -inet_interfaces = loopback-only - -# Reecriture des entetes: @host.crans.org -> @crans.org -canonical_maps = regexp:/etc/postfix/canonical - -# Autres -recipient_delimiter = -smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) -biff = no diff --git a/TCheetah/etc/postfix/main.cf/template b/TCheetah/etc/postfix/main.cf/template index b9f9fa3..2f87e3f 100644 --- a/TCheetah/etc/postfix/main.cf/template +++ b/TCheetah/etc/postfix/main.cf/template @@ -18,6 +18,7 @@ directiveEndToken = % %# | Utils pour le template | %# +------------------------+ +%set @mx = "mail-mx" in @metadata.groups %# Indique si c'est un MX principal ou secondaire. %set @main = "mail-mx-main" in @metadata.groups %set @secondary = "mail-mx-secondary" in @metadata.groups @@ -56,42 +57,56 @@ mydomain = crans.org myorigin = crans.org # Reseaux locaux -mynetworks = 138.231.136.0/21, 138.231.144.0/21, 138.231.148.0/22, 127.0.0.1/8 +mynetworks = 127.0.0.1/8 +%if @mx + 138.231.136.0/21, 138.231.144.0/21, 138.231.148.0/22 +%end if +%if not @mx +# Ecoute en local uniquement +inet_interfaces = loopback-only +%end if + +%if @mx # Destinations acceptees mydestination = @shorthostname, $myhostname, localhost, localhost.$mydomain -%if @main + %if @main $mydomain, crans.ens-cachan.fr, clubs.ens-cachan.fr, install-party.ens-cachan.fr -%end if -%if @manage_ml + %end if + %if @manage_ml lists.$mydomain + %end if %end if -%if @resuce -# Origine des mails poste localement -myorigin = $myhostname -%end if - +%if @mx # Domaine relaye par ce MX relay_domains = $mydestination, -%if @secondary + %if @secondary $mydomain, crans.ens-cachan.fr, clubs.ens-cachan.fr, install-party.ens-cachan.fr -%end if -%if @public and not @manage_ml + %end if + %if @public and not @manage_ml lists.$mydomain + %end if +%end if + +%if not @mx +# Les mails sont envoyes au MX principal +relayhost = smtp.adm.crans.org %end if # Etre notifie ou non de l'arrive de nouveaux mails biff = @yesno(@users) +%if @mx # Pour pouvoir tester sans tout casser, on active les soft bounces. # Ca permet aux mails de ne pas etre bounces en cas d'erreur, mais # a la place, de renvoyer une erreur non permanente. En production # il faut enlever ca. soft_bounce = no +%end if %if @users # On delivre dans des maildir @@ -108,11 +123,18 @@ delay_warning_time = 24h # Esthetisme smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) +%if @mx # Reecriture des entetes canonical_maps = ldap:/etc/postfix/ldap-canonical.cf +%else +# Reecriture des entetes: @host.crans.org -> @crans.org +canonical_maps = regexp:/etc/postfix/canonical +%end if +%if @mx # Par ou passer (notement pour la distrtibution des adresse locales par bleu) transport_maps = hash:/etc/postfix/transport +%end if # Une infinite d'adresses mail par personne recipient_delimiter = + @@ -127,15 +149,24 @@ alias_database = hash:/etc/postfix/aliases hash:/var/lib/mailman/data/aliases %end if +alias_maps = $alias_database +%if @mx # Plus les alias dans la base de donnees -alias_maps = $alias_database, ldap:/etc/postfix/ldap-aliases.cf + ldap:/etc/postfix/ldap-aliases.cf +%end if +%if @mx # On prend aussi en compte les utilisateurs de /etc/passwd local_recipient_maps = $alias_maps unix:passwd.byname +%end if +%if @mx # Les anciennes ML @crans.org, @crans.ens-cachan.fr -> @lists.crans.org virtual_alias_maps = hash:/etc/postfix/virtual +%end if +%# Pour les non-mx il n'y a plus rien d'interessant jusqu'a la fin +%if @mx # +-------------+ # | TLS et SASL | # +-------------+ @@ -230,3 +261,5 @@ mime_header_checks = regexp:/etc/postfix/mime_header_checks #relayhost = [ultra-adsl.crans.org]:25 ### END RESCUR MODE %endif + +%end if