mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
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.
This commit is contained in:
parent
8ef1a6b0d8
commit
b797ae1f15
@ -3202,9 +3202,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
|
||||
|
||||
check->xprt = mailer->xprt;
|
||||
check->addr = mailer->addr;
|
||||
if (!get_host_port(&mailer->addr))
|
||||
/* Default to submission port */
|
||||
check->port = 587;
|
||||
check->port = get_host_port(&mailer->addr);
|
||||
//check->server = s;
|
||||
|
||||
if ((t = task_new(MAX_THREADS_MASK)) == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user