Index: src/backend/sys_cmd.c
===================================================================
--- src/backend/sys_cmd.c	(revision 9133)
+++ src/backend/sys_cmd.c	(working copy)
@@ -92,6 +92,8 @@
 #include "avx_macpool.h"
 #include "avxbond.h"
 #include "avxpci.h"
+#include "avx_ha.h"
+#include "../../src/library/ca_mail/sys_mail.h"
 
 #define MAXLEN			8192
 #define MAXUSRPASSLEN		2048
@@ -7687,3 +7689,15 @@
 
     return (0);
 }
+
+int set_system_from_mail(char *mail) {
+    int ret1 = ha_set_from_mail(mail);
+    int ret2 = system_mail_from(mail);
+    return (ret1 && ret2);
+}
+
+int del_system_from_mail(char *mail) {
+    int ret1 = ha_del_from_mail(mail);
+    int ret2 = no_system_mail_from(mail);
+    return (ret1 && ret2);
+}
Index: src/generator/commands.pm
===================================================================
--- src/generator/commands.pm	(revision 9133)
+++ src/generator/commands.pm	(working copy)
@@ -188,7 +188,7 @@
         cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL",
         user_level => "CLI_LEVEL_CONFIG",
         help_string => "Set SMTP From header",
-        function_name => "system_mail_from",
+        function_name => "set_system_from_mail",
         function_args => [ {
                                 type => "STRING",
                                 help_string => "Value of SMTP From header",
@@ -254,7 +254,7 @@
         cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL",
         user_level => "CLI_LEVEL_CONFIG",
         help_string => "Reset SMTP From header",
-        function_name => "no_system_mail_from",
+        function_name => "del_system_from_mail",
         function_args => [],
     },
     {
@@ -1916,15 +1916,6 @@
 		help_string => "Delete system mail configuration",
 	},
 	{
-        obj_type => "ITEM",
-        name => "from",
-        cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL",
-        user_level => "CLI_LEVEL_CONFIG",
-        menu => "root_no_system_mail",
-        help_string => "Delete the setting of system email address",
-        function_name => "ha_del_from_mail",
-    },
-	{
 		obj_type => "ITEM",
 		name => "reboot",
 		help_string => "Reboot the system",
@@ -2621,20 +2612,6 @@
     },
 	{
 		obj_type => "ITEM",
-		name => "from",
-		help_string => "Set sender's email address",
-		cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_INTERACTIVE",
-		user_level => "CLI_LEVEL_CONFIG",
-		menu => "root_system_mail",
-		function_name => "ha_set_from_mail",
-		function_args => [ {
-				     type => "STRING",
-				     help_string => "Sender's email address",
-				     optional => "NO",
-				   }, ],
-	},
-	{
-		obj_type => "ITEM",
 		name => "license",
 		help_string => "Load license key to the system",
 		cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_INTERACTIVE",
Index: src/library/avx_log/avx_log.c
===================================================================
--- src/library/avx_log/avx_log.c	(revision 9133)
+++ src/library/avx_log/avx_log.c	(working copy)
@@ -650,7 +650,9 @@
                         snprintf(buff, buf_size, "log alert %d \"%s\" \"%s\" %d \"%s\"\n",
                                  id, alert->match, alert->email, alert->interval / 60,
                                  (alert->flags & AVX_LOG_ALERT_COUNT) ? "count" : "data");
-                }
+                } else { 
+		        snprintf(buff, buf_size, "Log alert %d is not configured.\n",id);
+		}
         }
 
         return buff;
Index: src/library/avxha/avx_ha.c
===================================================================
--- src/library/avxha/avx_ha.c	(revision 9133)
+++ src/library/avxha/avx_ha.c	(working copy)
@@ -49,7 +49,8 @@
 #define MAX_CHALLENGE_LEN		32
 #define HA_STRING_NONE "None"
 #define HA_VCID_INVALID "512"
- 
+#define DEF_MAIL_FROM "%h<alert@log.domain>"
+
 const char* RSYNC_OPT_BUF[RSYNC_MAX] = {
     "RSYNC_AVX_CONFIG",
     "RSYNC_AVX_IMAGE",
@@ -65,6 +66,40 @@
 } sync_info_t;
 
 int
+check_from_string(char *from_str)
+{
+        int esc = 0;
+        char *str = from_str;
+
+        while (*str) {
+                if (esc == 1) {
+                        esc = 0;
+                        switch (*str) {
+                        case 'h':
+                        case 'q':
+                        case '%':
+                                break;
+
+                        default:
+                                printf("Unsupported escape sequence %%%c\n", *str);
+                                return -1;
+                        }
+                } else if (*str == '%') {
+                        esc = 1;
+                }
+
+                str++;
+        }
+
+        if (esc == 1) {
+                printf("Unsupported escape sequence %%\n");
+                return -1;
+        }
+
+        return 0;
+}
+
+int
 _is_master()
 {
     int ret = 0;
@@ -600,7 +635,10 @@
         printf("Incorrect email address format\n");
         goto cleanup;
     }
-
+    if (check_from_string(mail) == -1) {
+        printf("Incorrect email address\n");
+        goto cleanup;
+    }
     sinfo = (struct s_ha_info *)malloc(sizeof(struct s_ha_info));
     if(!sinfo) {
         printf("Error: can't malloc memory\n");
@@ -637,7 +675,7 @@
     }
 
     init_ha_info(sinfo);
-    strcpy(sinfo->from_mail, HA_STRING_NONE);
+    strcpy(sinfo->from_mail, DEF_MAIL_FROM);
 
     update_ha_info(sinfo);
     ret = 0;
Index: src/library/ca_mail/sys_mail.h
===================================================================
--- src/library/ca_mail/sys_mail.h	(revision 9133)
+++ src/library/ca_mail/sys_mail.h	(working copy)
@@ -99,5 +99,6 @@
 char *write_system_mail_conf(char *segment);
 int clear_system_mail_conf(void);
 extern int sysmail_get_domainame(char * output, size_t len);
+int system_mail_from(char *mail);
 
 #endif
Index: src/library/ca_mail/sys_mail.c
===================================================================
--- src/library/ca_mail/sys_mail.c	(revision 9133)
+++ src/library/ca_mail/sys_mail.c	(working copy)
@@ -21,7 +21,6 @@
 
 sys_mail_conf_t *attach_sys_mail_conf(void);
 void detach_sys_mail_conf(sys_mail_conf_t *conf_p);
-int check_from_string(char *from_str);
 int check_hostname_string(char *hostname);
 int write_fqdn_to_file(void);
 int write_hostname_to_file(char *hostname);
@@ -963,24 +962,7 @@
 int
 system_mail_from(char *from_string)
 {
-	int len = strlen(from_string);
 	sys_mail_conf_t *conf_p;
-
-	if (len == 0) {
-		printf("From string cannot be empty\n");
-		return 0;
-	}
-
-	if (len > MAX_MAIL_FROM_LEN) {
-		printf("Length of from string cannot be greater than %d\n",
-		       MAX_MAIL_FROM_LEN);
-		return 0;
-	}
-
-	if (check_from_string(from_string) == -1) {
-		return 0;
-	}
-
 	conf_p = attach_sys_mail_conf();
 	if (conf_p == NULL) {
 		printf("Could not set from string (Internal error)\n");
@@ -1387,7 +1369,7 @@
 {
 	shmdt(conf_p);
 }
-
+/*
 int
 check_from_string(char *from_str)
 {
@@ -1421,7 +1403,7 @@
 
 	return 0;
 }
-
+*/
 int
 check_hostname_string(char *hostname)
 {
Index: src/monitord/eventlog_monitor.c
===================================================================
--- src/monitord/eventlog_monitor.c	(revision 9133)
+++ src/monitord/eventlog_monitor.c	(working copy)
@@ -50,6 +50,26 @@
 
 sys_mail_conf_t *sys_mail_conf_p;
 int shm_init_done = 0;
+
+static void
+eventlog_sig_child(int signo)
+{
+    int sig_state;
+
+    /*not start at the beginning*/
+    if(waitpid(-1, &sig_state, WNOHANG) > 0) {
+
+        /*currently do nothing*/
+    }
+
+    return;
+}
+
+static void
+eventlog_sig_init(void) {
+        signal(SIGCHLD, eventlog_sig_child);
+}
+
 static int
 eventlog_shm_init(void)
 {
@@ -143,6 +163,7 @@
         if (eventlog_shm_init() == -1) {
 	    return -1;
         }
+	eventlog_sig_init();
     }
     log_alert_t *alert;
     log_mbox_t *mbox;
@@ -290,6 +311,7 @@
                 
                 //get data from mbox
                 //get data from dedicated mbox firstly
+		write(fd[1], "\n", 1);
                 write(fd[1], mbox->data, strlen(mbox->data));
 		write(fd[1], "\n", 1);
                 if (mbox->len > (AVX_LOG_MAX_DATA_SIZE - MAX_LOG_STRING) ) {
