Bonjour,

J'essaie de faire exactement la m?me chose et ait le m?me probl?me. Je suis 
donc preneur d'une solution :)


Merci ? tous,

Philippe

________________________________
From: FRsAG <frsag-boun...@frsag.org> on behalf of Michael JOIGNY 
<mjoi...@neteven.com>
Sent: Tuesday, October 13, 2015 17:02
To: frsag@frsag.org
Subject: [FRsAG] Postfix - Dovecot HA avec HAproxy

Bonjour ? tous,

Je souhaiterais mettre en place une configuration mail pour avoir 
postfix-dovecot en HA via HAproxy mais je n'arrive pas ? faire fonctionner le 
tout.

Je me suis bas? sur les documentations suivantes et sur ce que je pouvais 
trouver sur la toile :


  *   http://wiki2.dovecot.org/HAProxy (pour dovecot)
  *   
http://blog.haproxy.com/2012/06/30/efficient-smtp-relay-infrastructure-with-postfix-and-load-balancers/
 (pour postfix)

La version de mes packages :

  *   dovecot : 2:2.2.19 (>= 2.2.19 pour proxy protocol)
  *   haproxy : 1.5.14
  *   postfix : 2.11.2-1 (>2.10 pour postscreen)

Une partie de ma configuration :

##HAPROXY

#postfix
listen smtp
bind mail.xx.xx:465
balance roundrobin
timeout client 1m
timeout connect 5s
no option http-server-close
mode tcp
option smtpchk
option tcplog
server tst tst.xxx:10465 send-proxy
server tst2 tst2.xxx:10465 send-proxy
server tst3 tst3.xxx:10465 send-proxy

#dovecot
listen imap
bind mail.xxx.xx:993
timeout client 1m
no option http-server-close
balance leastconn
stick store-request src
stick-table type ip size 200k expire 30m
mode tcp
option tcplog
server tst tst.xxx:10993 send-proxy-v2
server tst2tst2.xxx:10993 send-proxy-v2
server tst3 tst3.xxx:10993 send-proxy-v2

##POSTFIX

postix main.cf
#Haproxy proxy protocol
postscreen_upstream_proxy_protocol = haproxy

postfix master.cf
#haproxy
10465 inet n - n - 1 postscreen
smtpd pass - - n - - smtpd
S

##DOVECOT

dovecot dovecot.conf
#trust haproxy requests
haproxy_trusted_networks = l'ip priv?e de mon HAproxy
haproxy_timeout = 5

inet_listener imap_haproxy {
port = 10993
haproxy = yes
}

Avec mon client de mail :

Lors d'une connexion IMAP, voici les logs, je ne comprends pas pourquoi il ne 
r?cup?re pas mon login.

dovecot: imap-login: Disconnected: Too many invalid commands (no auth attempts 
in 0 secs): user=<>, rip=mon_ip_publique, lip=ip_publique_haproxy, session= xxx

Lors d'une connexion SMTP, voici les logs, ?a mouline et au bout d'un moment 
j'ai un timeout.

postfix/postscreen[16654]: CONNECT from [my public ip]:49942 to [my haproxy 
public ip]:465
postfix/postscreen[16654]: PREGREET 166 after 0 from [mon ip publique]:49942: 
\22\3\1\161\1\157\3\3+0E\b\213\131\177\173>\r/\213\177i\223k"FjA#\144\145\153\vP\\\155HL\190

Si quelqu'un a une id?e, je suis preneur.

Cordialement.

--
[cid:part1.02090305.07060902@neteven.com]

[EDSI-Tech Sarl]<http://www.edsi-tech.com>
Philippe Bonvin, Directeur
EDSI-Tech S?rl<http://www.edsi-tech.com>
EPFL Innovation Park, Batiment C, 1015 Lausanne, Suisse | T?l?phone: +41 (0) 21 
566 14 15
Savoie Technolac, 17 Avenue du Lac L?man, 73375 Le Bourget-du-Lac, France | 
T?l?phone: +33 (0)4 86 15 44 78
_______________________________________________
Liste de diffusion du FRsAG
http://www.frsag.org/

Répondre à