diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-12-24 10:04:35 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-12-24 10:04:35 +0000 |
| commit | 06e30742f0ce3f8cc2ff15bc7f733129fa3cbbf4 (patch) | |
| tree | ce7888b241b0fb5f92456d5c1f15e23e7843a1a5 | |
| parent | 446520fb44753f18c2f4c921831c20fbc5d55585 (diff) | |
- correct processing of RCPT TO responses from SMTP servers
(Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1098 97f52cf1-0a1b-0410-bd0e-c28be96e8082
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | TODO | 15 | ||||
| -rw-r--r-- | include/functions.c | 4 |
3 files changed, 5 insertions, 16 deletions
@@ -1,5 +1,7 @@ Changes for 1.0beta13: + - correct processing of RCPT TO responses from SMTP servers + (Alexei) - correct processing of unsupported internal checks (Alexei) - processing of DB stopped situations for MySQL (Alexei) - housekeeper to delete hosts_groups entries (Alexei) @@ -1,21 +1,6 @@ 1.0beta12: - timestamp for maps - -So functions.c should look -> -> if(strncmp(OK_250,c,strlen(OK_250)) != 0 && -> strncmp(OK_251,c,strlen(OK_251)) != 0) -> { -> zabbix_log(LOG_LEVEL_ERR, "Wrong answer on RCPT TO -> [%s]", c); -> close(s); -> -> where -> -> char *OK_251="251"; - - - change %s to {HOSTNAME}, {DATE},{TIME}, etc - add zabbix[unixtime] and lastupdate() to get rid of nodata() - check return code for alert scripts diff --git a/include/functions.c b/include/functions.c index c962badf..637d237f 100644 --- a/include/functions.c +++ b/include/functions.c @@ -520,6 +520,7 @@ int send_email(char *smtp_server,char *smtp_helo,char *smtp_email,char *mailto,c char *OK_220="220"; char *OK_250="250"; + char *OK_251="251"; char *OK_354="354"; zabbix_log( LOG_LEVEL_DEBUG, "SENDING MAIL"); @@ -671,7 +672,8 @@ int send_email(char *smtp_server,char *smtp_helo,char *smtp_email,char *mailto,c close(s); return FAIL; } - if(strncmp(OK_250,c,strlen(OK_250)) != 0) + /* May return 251 as well: User not local; will forward to <forward-path>. See RFC825 */ + if( strncmp(OK_250,c,strlen(OK_250)) != 0 && strncmp(OK_251,c,strlen(OK_251)) != 0) { zabbix_log(LOG_LEVEL_ERR, "Wrong answer on RCPT TO [%s]", c); close(s); |
