BUG/MINOR: email-alert: Set the mailer port during alert initialization
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Mar 2018 13:35:35 +0000 (15:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Apr 2018 08:36:50 +0000 (10:36 +0200)
commitb797ae1f15b0fb97d1ae8550d37c3fd58a24f5b3
tree19bf6eed8d15645e59746806a262bd2dfe211f73
parent8ef1a6b0d8c2ea1d8075e0b757007f05527952b8
BUG/MINOR: email-alert: Set the mailer port during alert initialization

Since the commit 2f3a56b4f ("BUG/MINOR: tcp-check: use the server's service port
as a fallback"), email alerts stopped working because the mailer's port was
overriden by the server's port. Remember, email alerts are defined as checks
with specific tcp-check rules and triggered on demand to send alerts. So to send
an email, a check is executed. Because no specific port's was defined, the
server's one was used.

To fix the bug, the ports used for checks attached an email alert are explicitly
set using the mailer's port. So this port will be used instead of the server's
one.

In this patch, the assignement to a default port (587) when an email alert is
defined has been removed. Indeed, when a mailer is defined, the port must be
defined. So the default port was never used.

This patch must be backported in 1.8.
src/checks.c