Skip to content

Commit

Permalink
2020/02/26 01:22:59
Browse files Browse the repository at this point in the history
  • Loading branch information
MasahikoIto committed Feb 25, 2020
1 parent 9fd27d6 commit 1182617
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sample/smtp_filter2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ awk 'BEGIN{
if (out_sw == 1){
print $0;
fflush()
}
}
END{
if (out_sw == 0){
printf("[%d]:IP=%-s HOST=%-s REASON=NOT spam, but NO DATA\n", pid, from_ip, from_hostname)
fflush()
}
}' ${tmp}/smtp_filter2.1.$$.tmp
#
Expand Down
4 changes: 3 additions & 1 deletion smtp_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ int sock_read(s, buf, len, read_buf, ptr_tv)
{
int ret, read_len, return_len;
char *ptr_lf, *ptr_null;
char tmp_buf[BUF_LEN];

if (strchr(read_buf, '\n') == (char *)NULL){

Expand Down Expand Up @@ -1273,7 +1274,8 @@ int sock_read(s, buf, len, read_buf, ptr_tv)
strncpy(buf, read_buf, return_len);

ptr_null = strchr(read_buf, '\0');
strncpy(read_buf, (ptr_lf + 1), ptr_null - ptr_lf);
strncpy(tmp_buf, (ptr_lf + 1), ptr_null - ptr_lf);
strncpy(read_buf, tmp_buf, ptr_null - ptr_lf);
ptr_null = strchr(read_buf, '\0');
bzero(ptr_null + 1, BUF_LEN - (ptr_null - read_buf + 1));
}
Expand Down

0 comments on commit 1182617

Please sign in to comment.