From 97dfab3e912696b68da3eb8cf8515177bd89b95a Mon Sep 17 00:00:00 2001
From: pierreozoux <pierre@ozoux.net>
Date: Thu, 17 Dec 2015 20:15:02 +0000
Subject: [PATCH] fix mail autoconfig

---
 dockerfiles/confd/confd/templates/haproxy.cfg.tmpl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dockerfiles/confd/confd/templates/haproxy.cfg.tmpl b/dockerfiles/confd/confd/templates/haproxy.cfg.tmpl
index d7feed9..bc316c9 100644
--- a/dockerfiles/confd/confd/templates/haproxy.cfg.tmpl
+++ b/dockerfiles/confd/confd/templates/haproxy.cfg.tmpl
@@ -27,7 +27,6 @@ mode http
   rspadd  Strict-Transport-Security:\ max-age=15768000
   reqadd X-Forwarded-Proto:\ https
   acl autoconfig hdr_beg(host) -i autoconfig
-  use_backend mail.indie.host if autoconfig
 
 {{range $app := lsdir "/services"}}
 {{$hostnames := printf "/services/%s/*" $app}}
@@ -41,6 +40,8 @@ mode http
   {{end}}
 {{end}}
 
+  use_backend autoconfig  if autoconfig
+
 frontend http-in
   bind *:80
   redirect scheme https code 301
@@ -56,3 +57,6 @@ backend {{base $hostname}}
   server Server {{$data.ip}}:{{$data.port}} cookie Server
   {{end}}
 {{end}}
+backend autoconfig
+  cookie SERVERID insert nocache indirect
+  server Server mail.indie.host:443 cookie Server ssl verify none
-- 
GitLab