BUG/MEDIUM: checks: email-alert not working when declared in defaults

Tommy Atkinson and Sylvain Faivre reported that email alerts didn't work when
they were declared in the defaults section. This is due to the use of an
internal attribute which is set once an email-alert is at least partially
configured. But this attribute was not propagated to the current proxy during
the configuration parsing.

Not that the issue doesn't occur if "email-alert myhostname" is configured in
the defaults section.

This fix must be backported to 1.6.
This commit is contained in:
Cyril Bont 2015-12-04 03:07:06 +01:00 committed by Willy Tarreau
parent a7bbdd9559
commit 7e0847045a

View file

@ -2804,6 +2804,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
if (defproxy.email_alert.myhostname)
curproxy->email_alert.myhostname = strdup(defproxy.email_alert.myhostname);
curproxy->email_alert.level = defproxy.email_alert.level;
curproxy->email_alert.set = defproxy.email_alert.set;
goto out;
}