LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HA-Proxy and postfix (https://www.linuxquestions.org/questions/linux-newbie-8/ha-proxy-and-postfix-4175469031/)

moyorakkhi 07-09-2013 01:46 PM

HA-Proxy and postfix
 
Hi,

I'm using HA-proxy as frontend to load-balance between two backend postfix. I'm using a single postfix instance currently as test purpose.

Code:

HA-Proxy version: 1.5-dev19 2013/06/17
Postfix Version: 2.8.11

HA Proxy Config:

Code:

defaults
        log    global
        option  dontlognull
        retries 3
#      option redispatch
        maxconn 4000
        contimeout      50s
        clitimeout      50s
        srvtimeout      50s

frontend smtp_proxy 0.0.0.0:25
        mode tcp
        log global
        no option http-server-close
        timeout client 1m
        option tcplog
        default_backend bk_postfix

backend bk_postfix
        mode tcp
        log global
        no option http-server-close
#      option smtpchk EHLO mail.EXAMPLE.TEST
        option tcplog
        timeout server 1m
        timeout connect 40s
        #source 0.0.0.0 usesrc clientip
        server postfix 10.100.0.137:25 send-proxy

In postfix's main.cf, I have the following lines:

Code:

smtpd_upstream_proxy_protocol = haproxy
smtpd_upstream_proxy_timeout = 50s

I'm getting the following error:

Code:

Jul  9 18:03:02 mail postfix/smtpd[2383]: connect from haproxy.EXAMPLE.TEST[10.100.0.213]
Jul  9 18:03:03 mail postfix/smtpd[2383]: improper command pipelining after EHLO from haproxy.EXAMPLE.TEST[10.100.0.213]
Jul  9 18:03:03 mail postfix/smtpd[2383]: 90B4B1603D7: client=haproxy.EXAMPLE.TEST[10.100.0.213]
Jul  9 18:03:04 mail postfix/smtpd[2383]: lost connection after DATA (12 bytes) from haproxy.EXAMPLE.TEST[10.100.0.213]
Jul  9 18:03:04 mail postfix/smtpd[2383]: disconnect from haproxy.EXAMPLE.TEST[10.100.0.213]

I tried to send email from different domain, including gmail, yahoo etc. Same result. I tried different timeout value. But no luck. I googled a lot a tried suggested solutions.

What I'm missing here? Thanks for you help in advance.

moyorakkhi 07-10-2013 05:00 AM

Got it resolved. Actually there was no problem with the configuration. It was the postfix version. Postfix version has to be 2.10.* or up.


All times are GMT -5. The time now is 11:27 AM.