Do you have a frontend defined for SMTP that’s bound to one or more standard ports?
You don’t appear to have any servers defined in your backend, so it appears haproxy is connecting to localhost on one of the webservice ports by default. As you can’t talk SMTP to a web server, that won’t work.
Thanks for the reply. Error is coming because of the option smtpchk (server health check). I even did add correct domain (option smtpchk HELO domain). Is this health check necessary? below is the frontend and backend config for SMTP
frontend smtp
bind 127.0.0.1:25
bind HAProxy_Server_IP:25
mode tcp
# Route all traffic to our backend
default_backend smtp-backend-mail
log global
option tcplog
option logasap
backend smtp-backend-mail
# Layer 4 based load balancing
mode tcp
option smtpchk HELO HAProxy_Server_IP
# IP stickyness
balance source
hash-type consistent
stick-table type ip size 20k
stick on src
server APP_Hostname APP_IP:25 check on-marked-down shutdown-sessions
There more configurations defined I only posted backend smtp. How to overcome this? @nlindq
The problem isn’t with the smtpchk (although the option after HELO is just for what to announce during the SMTP conversation), it’s with your server configuration.
You only seem to have one SMTP server defined (APP_Hostname); what problem are you trying to solve with HAProxy?
I’d note that for SMTP, I’ve found the frontend/backend configuration excessively cumbersome as it’s generally pretty simple.
@nlindq Tried your way of simple configuration for smtp server but the error is still coming. Is it because of network connection? Error is coming randomly.
@nlindq I did that already. Check above for configuration of SMTP frontend and backend. And proxy is sending [RST, ACK] instead of closing properly the connection after having received the answer to the “HELO localhost” command.
tcpdump: I think HA-proxy server is the one resetting the connection. (10:09:59.551109 IP HAProxy_SERVER.38910 > APP_Server.smtp: Flags [R], seq 951036460, win 0, length 0)
@nlindq SMTP server (i.e app server) infront that HAproxy server as proxy server. Email send and receive functionality is working fine. It’s just this error in log file.