Mail autodetect pour thunderbird

This commit is contained in:
Alan Garcia 2013-07-22 16:37:44 +00:00
parent 2ffb6ba295
commit 46669dddf7
4 changed files with 17 additions and 6 deletions

1
.gitattributes vendored
View File

@ -469,7 +469,6 @@ etc/alternc/templates/apache2/vhost.conf -text
etc/alternc/templates/bind/automatic.conf -text
etc/alternc/templates/bind/named.conf.options -text
etc/alternc/templates/bind/slaveip.conf -text
etc/alternc/templates/bind/templates/mx.template -text
etc/alternc/templates/bind/templates/named.template -text
etc/alternc/templates/bind/templates/slave.template -text
etc/alternc/templates/bind/templates/zone.template -text

View File

@ -1 +0,0 @@
IN MX 5 @@MX@@.

View File

@ -71,6 +71,10 @@ get_uid_by_name() {
mysql_query 'SELECT uid FROM membres WHERE login="'"$1"'" LIMIT 1;'
}
get_variable_from_db() {
mysql_query 'SELECT value FROM membres WHERE name="'"$1"'" LIMIT 1;'
}
# imprime le nom d'usager associé au domaine
get_account_by_domain() {

View File

@ -127,10 +127,19 @@ dns_regenerate() {
$MYSQL_DO "select distinct replace(replace(dt.entry,'%TARGET%',sd.valeur), '%SUB%', if(length(sd.sub)>0,sd.sub,'@')) as entry from sub_domaines sd,domaines_type dt where sd.type=dt.name and sd.domaine='$domain' and sd.enable in ('ENABLE', 'ENABLED') order by entry ;"
)
# Get some usefull vars
# Deprecated ?
# local mx=$( $MYSQL_DO "select mx from domaines where domaine='$domain' limit 1;")
##### Mail autodetect for thunderbird / outlook - START
# If $file contain DEFAULT_MX
if [ ! -z "$(echo -e "$file" |egrep 'DEFAULT_MX' )" ] ; then
# If $file ! contain autoconfig -> add entry
if [ -z "$(echo -e "$file" |egrep '^autoconfig' )" ] ; then
file="$(echo -e "$file" ; echo -e "autoconfig IN CNAME $FQDN.\n")"
fi
# if $file ! contain autodiscover -> add entry
if [ -z "$(echo -e "$file" |egrep '^autodiscover' )" ] ; then
file="$(echo -e "$file" ; echo -e "autodiscover IN CNAME $FQDN.\n")"
fi
fi # End if containt DEFAULT_MX
##### Mail autodetect for thunderbird / outlook - END
# Replace the vars by their values
# Here we can add dynamic value for the default MX