------------
It is possible to send email alerts when the state of servers changes.
If configured email alerts are sent to each mailer that is configured
-in a mailers section. Email is sent to mailers using SMTP.
+in a mailers section. Email is sent to mailers through Lua (see
+examples/lua/mailers.lua).
mailers <mailersect>
Creates a new mailer list with the name <mailersect>. It is an
Defines a mailer inside a mailers section.
Example:
+ global
+ # mailers.lua file as provided in the git repository
+ # adjust path as needed
+ lua-load examples/lua/mailers.lua
+
mailers mymailers
mailer smtp1 192.168.0.1:587
mailer smtp2 192.168.0.2:587
#include <haproxy/list.h>
#include <haproxy/mailers.h>
#include <haproxy/pool.h>
-#include <haproxy/proxy-t.h>
+#include <haproxy/proxy.h>
#include <haproxy/server-t.h>
#include <haproxy/task.h>
#include <haproxy/tcpcheck.h>
const char *err_str;
int i = 0;
+ if (!send_email_disabled)
+ ha_warning("Legacy mailers used by %s '%s' will not be supported anymore in version 3.3. You should use Lua to send email-alerts, see 'examples/lua/mailers.lua' file.\n",
+ proxy_type_str(p), p->id);
+
if ((queues = calloc(mls->count, sizeof(*queues))) == NULL) {
memprintf(err, "out of memory while allocating mailer alerts queues");
goto fail_no_queue;