On 11/01/2015 06:34 PM, Tommy Atkinson wrote:
I want to enable email alerts for all my backends so I added the
"email-alert" options to the defaults section and a mailers section at
the top level. The documentation indicates this is supported but it
doesn't seem to work. HAProxy connects to the mail server but doesn't
actually send anything. Copy/pasting the options to a backend works.
1.6.1 on Linux
Hi,
This seems to be a bug, I had the same problem.
Copying & pasting the "email-alert" settings in all the backend sections
did the trick.
When email-alert options are set only in the defaults section, just like
Tommy said, HAproxy connects to the mail server but doesn't send anything.
Here are the postfix logs from the problem :
Nov 30 09:31:01 host1 postfix/smtpd[2502]: connect from localhost[127.0.0.1]
Nov 30 09:31:03 host1 postfix/smtpd[2502]: lost connection after CONNECT
from localhost[127.0.0.1]
Nov 30 09:31:03 host1 postfix/smtpd[2502]: disconnect from
localhost[127.0.0.1]
With fixed config :
Nov 30 10:03:58 host1 postfix/smtpd[8335]: connect from localhost[127.0.0.1]
Nov 30 10:03:58 host1 postfix/smtpd[8335]: 79A28402E7:
client=localhost[127.0.0.1]
Nov 30 10:03:58 host1 postfix/cleanup[8338]: 79A28402E7:
message-id=<20151130090358.79A28402E7@host1>
Nov 30 10:03:58 host1 postfix/smtpd[8335]: disconnect from
localhost[127.0.0.1]
Nov 30 10:03:58 host1 postfix/qmgr[1346]: 79A28402E7:
from=<haproxy-d...@reservit.com>, size=600, nrcpt=1 (queue active)
Nov 30 10:03:58 host1 postfix/smtp[8339]: 79A28402E7:
to=<x...@reservit.com>, relay=xxxxx:25, delay=0.14,
delays=0.06/0.03/0.04/0, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as
962E420D9C)
Nov 30 10:03:58 host1 postfix/qmgr[1346]: 79A28402E7: removed
(using 1.6.2 Ubuntu package)
Best regards,
Sylvain