diff --git a/.gitattributes b/.gitattributes
index 8c35a88f..97a122ed 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -530,6 +530,14 @@ lang/.svnignore -text
lang/README -text
lang/en_US.po -text
lang/nl_NL.po -text
+mailautoconfig/apache_mail-autoconfig.conf -text
+mailautoconfig/cron_bash -text
+mailautoconfig/var/www/mail_autoconfig/.htaccess -text
+mailautoconfig/var/www/mail_autoconfig/index.html -text
+mailautoconfig/var/www/mail_autoconfig/outlook.php -text
+mailautoconfig/var/www/mail_autoconfig/outlook.php__DYN -text
+mailautoconfig/var/www/mail_autoconfig/thunderbird.php -text
+mailautoconfig/var/www/mail_autoconfig/thunderbird.php__DYN -text
man/alternc-admintools.8 -text
man/alternc-admintools.fr.8 -text
man/alternc.install.pod -text
diff --git a/mailautoconfig/apache_mail-autoconfig.conf b/mailautoconfig/apache_mail-autoconfig.conf
new file mode 100644
index 00000000..fa4ebdd8
--- /dev/null
+++ b/mailautoconfig/apache_mail-autoconfig.conf
@@ -0,0 +1,49 @@
+
+# ce vhosts est fonctionnel sur le serveur ici dans l'exemple, hostname : petdev.octopuce.fr
+# la plus belle façon de faire, serait que le vhosts d'apache par defaut gere les alias
+# exemple de log pour icedov (comme thunderboird) :
+# /var/log/apache2/mailconfig.log:10.1.0.254 - - [22/Jul/2013:12:54:29 +0200] begin:1374490469 end:1374490469 "GET /mail/config-v1.1.xml?emailaddress=test%40petdev2.octopuce.fr HTTP/1.1" 200 sent 602 328 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130704 Icedove/17.0.7" autoconfig.petdev2.octopuce.fr
+# exemple pour outlook
+# /var/log/apache2/mailconfig.log:10.1.0.254 - - [22/Jul/2013:14:23:23 +0200] begin:1374495803 end:1374495803 "GET /autodiscover/autodiscover.xml HTTP/1.1" 200 sent 1044 794 0 "-" "Microsoft Office/14.0 (Windows NT 5.1; Microsoft Outlook 14.0.6126; Pro)" autodiscover.petdev2.octopuce.fr
+
+
+# configuration du repertoire :
+
+ php_admin_value open_basedir "/var/www/mail_autoconfig/:/usr/share/php/:/var/alternc/tmp:/tmp"
+ Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch
+ AllowOverride AuthConfig FileInfo Limit Options Indexes
+ Order allow,deny
+ allow from all
+
+
+
+# 443/SSL pour les clients outlook
+# normalement autidiscover serait suffisant, car autoconfig est utilise par thunderbird
+NameVirtualHost autodiscover.petdev.octopuce.fr:443
+
+ ServerName autodiscover.localhost
+ ServerAlias autoconfig.*
+ ServerAlias autodiscover.*
+
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/private/localhost.all
+ SSLCaCertificatePath /etc/ssl/certs
+
+ LogFormat "%h %l %u %t %{begin:%s}t %{end:%s}t \"%r\" %>s sent %O %b %T \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i" mailconfig
+ CustomLog ${APACHE_LOG_DIR}/mailconfig.log mailconfig
+
+ DocumentRoot /var/www/mail_autoconfig/
+
+
+
+
+ ServerName autodiscover.localhost
+ ServerAlias autoconfig.*
+ ServerAlias autodiscover.*
+
+ LogFormat "%h %l %u %t %{begin:%s}t %{end:%s}t \"%r\" %>s sent %O %b %T \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i" mailconfig
+ CustomLog ${APACHE_LOG_DIR}/mailconfig.log mailconfig
+
+ DocumentRoot /var/www/mail_autoconfig/
+
+
diff --git a/mailautoconfig/cron_bash b/mailautoconfig/cron_bash
new file mode 100644
index 00000000..33c0460c
--- /dev/null
+++ b/mailautoconfig/cron_bash
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# cron pouvant servir au cas ou la foinctionnalite n est pas intergre a alternc
+
+PUBLIC_IP="`awk -F'"' '/^PUBLIC_IP/ {print $2}' /etc/alternc/local.sh`"
+
+if [ -d "/var/alternc/bind/zones" ]
+then
+ BINDDIR="/var/alternc/bind/zones"
+fi
+if [ -d "/var/lib/alternc/bind/zones" ]
+then
+ BINDDIR="/var/lib/alternc/bind/zones"
+fi
+BINDRELOAD=0
+
+while read domaine gesmx gesdns
+do
+ # for debug
+ #echo $domaine $gesmx $gesdns
+ if [ $gesdns -eq 0 ]
+ then
+ sed -i '/^autodiscover/d' $BINDDIR/$domaine
+ sed -i '/^autoconfig/d' $BINDDIR/$domaine
+ else
+ if [ $gesmx -eq 0 ]
+ then
+ sed -i '/^autodiscover/d' $BINDDIR/$domaine
+ sed -i '/^autoconfig/d' $BINDDIR/$domaine
+ else
+ ZNSERIAL="`awk '/; serial/ {print $1}' $BINDDIR/$domaine`"
+ NEWZNSERIAL=$((ZNSERIAL+1))
+ # for debug
+ #echo $ZNSERIAL $NEWZNSERIAL $BINDDIR
+ if [ `grep "^autodiscover " $BINDDIR/$domaine | wc -l` -ge 1 ]
+ then
+ echo -e "autodiscover IN A $PUBLIC_IP" >> /dev/null
+ else
+ echo -e "autodiscover IN A $PUBLIC_IP" >> $BINDDIR/$domaine
+ sed -i '/; serial[ \t]*$/ s/'$ZNSERIAL'/'$NEWZNSERIAL'/' $BINDDIR/$domaine
+ fi
+ if [ `grep "^autoconfig " $BINDDIR/$domaine | wc -l` -ge 1 ]
+ then
+ echo -e "autoconfig IN A $PUBLIC_IP" >> /dev/null
+ else
+ echo -e "autoconfig IN A $PUBLIC_IP" >> $BINDDIR/$domaine
+ sed -i '/; serial[ \t]*$/ s/'$ZNSERIAL'/'$NEWZNSERIAL'/' $BINDDIR/$domaine
+ fi
+ fi
+ fi
+if [ `awk '/; serial/ {print $1}' $BINDDIR/$domaine` -gt $ZNSERIAL ]
+then
+ BINDRELOAD=$((BINDRELOAD+1))
+fi
+done < <(mysql --defaults-file=/etc/alternc/my.cnf -e "select domaine,gesmx,gesdns from domaines;" alternc | grep -v \| | tail --lines=+2)
+
+if [ $BINDRELOAD -ne 0 ]
+then
+ /usr/sbin/rndc reload
+fi
+
+
diff --git a/mailautoconfig/var/www/mail_autoconfig/.htaccess b/mailautoconfig/var/www/mail_autoconfig/.htaccess
new file mode 100644
index 00000000..969a412b
--- /dev/null
+++ b/mailautoconfig/var/www/mail_autoconfig/.htaccess
@@ -0,0 +1,8 @@
+RewriteEngine On
+RewriteRule ^mail/mailautoconfig.xml$ /thunderbird.php [L]
+RewriteRule ^mail/config-v1.1.xml$ /thunderbird.php [L]
+RewriteRule ^autodiscover/autodiscover.xml$ /outlook.php [L]
+RewriteRule ^Autodiscover/Autodiscover.xml$ /outlook.php [L]
+RewriteRule ^Autodiscover.xml$ outlook.php [L]
+RewriteRule ^autodiscover.xml$ outlook.php [L]
+
diff --git a/mailautoconfig/var/www/mail_autoconfig/index.html b/mailautoconfig/var/www/mail_autoconfig/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/mailautoconfig/var/www/mail_autoconfig/outlook.php b/mailautoconfig/var/www/mail_autoconfig/outlook.php
new file mode 100644
index 00000000..000cb6e2
--- /dev/null
+++ b/mailautoconfig/var/www/mail_autoconfig/outlook.php
@@ -0,0 +1,46 @@
+ \n";
+?>
+
+
+
+ email
+ settings
+
+ IMAP
+
+ 993
+
+
+ off
+ on
+ on
+
+
+ SMTP
+
+ 587
+ off
+ on
+ on
+ on
+ off
+
+
+
+
diff --git a/mailautoconfig/var/www/mail_autoconfig/outlook.php__DYN b/mailautoconfig/var/www/mail_autoconfig/outlook.php__DYN
new file mode 100644
index 00000000..11a74347
--- /dev/null
+++ b/mailautoconfig/var/www/mail_autoconfig/outlook.php__DYN
@@ -0,0 +1,43 @@
+ \n";
+
+}
+?>
+
+
+
+ email
+ settings
+
+ IMAP
+ mail.
+ 993
+
+
+ off
+ on
+ on
+
+
+ SMTP
+ mail.
+ 465
+ off
+ on
+ on
+ on
+ off
+
+
+
+
diff --git a/mailautoconfig/var/www/mail_autoconfig/thunderbird.php b/mailautoconfig/var/www/mail_autoconfig/thunderbird.php
new file mode 100644
index 00000000..e0701ac0
--- /dev/null
+++ b/mailautoconfig/var/www/mail_autoconfig/thunderbird.php
@@ -0,0 +1,39 @@
+
+
+
+
+Octopuce SARL
+Octopuce
+
+
+ 993
+ SSL
+ password-cleartext
+ %EMAILADDRESS%
+
+
+
+ 995
+ SSL
+ password-cleartext
+ %EMAILADDRESS%
+
+
+
+ 587
+ STARTTLS
+ %EMAILADDRESS%
+ password-cleartext
+
+
+
+ 465
+ SSL
+ password-cleartext
+ %EMAILADDRESS%
+
+
+
diff --git a/mailautoconfig/var/www/mail_autoconfig/thunderbird.php__DYN b/mailautoconfig/var/www/mail_autoconfig/thunderbird.php__DYN
new file mode 100644
index 00000000..e4f13973
--- /dev/null
+++ b/mailautoconfig/var/www/mail_autoconfig/thunderbird.php__DYN
@@ -0,0 +1,40 @@
+
+
+
+octopuce.fr
+octopuce.biz
+Octopuce Mail
+Octopuce
+
+ mail.%EMAILDOMAIN%
+ 993
+ SSL
+ password-cleartext
+ %EMAILADDRESS%
+
+
+ mail.%EMAILDOMAIN%
+ 995
+ SSL
+ password-cleartext
+ %EMAILADDRESS%
+
+
+ mail.%EMAILDOMAIN%
+ 587
+ STARTTLS
+ %EMAILADDRESS%
+ password-cleartext
+
+
+ mail.%EMAILDOMAIN%
+ 465
+ SSL
+ password-cleartext
+ %EMAILADDRESS%
+
+
+