add global mail notification
diff --git a/src/cfgparse-global.c b/src/cfgparse-global.c
index b117ebc..4e185e2 100644
--- a/src/cfgparse-global.c
+++ b/src/cfgparse-global.c
@@ -26,6 +26,7 @@
*/
int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
{
+ int i = 0;
int err_code = 0;
char *errmsg = NULL;
@@ -1172,6 +1173,20 @@
env++;
}
}
+ else if (!strcmp(args[0], "email_alert")) {
+ global.email_alert = 1;
+ if (*(args[1]) == 0) {
+ ha_alert("parsing [%s:%d] : email_alert Expects email address as argument.\n", file, linenum);
+ global.email_alert = 0;
+ err_code |= ERR_ALERT;
+ goto out;
+ }
+ strncpy(global.email_from,args[1],50);
+ for (i=0; i<3; i++) {
+ if (*(args[i+2]) != 0)
+ strncpy(global.email_to[i],args[i+2],50);
+ }
+ }
else {
struct cfg_kw_list *kwl;
int index;