diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-11-11 12:12:35 +0100 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2008-11-11 12:12:35 +0100 |
commit | 03a1d105eaa49ab0717f048ab9e09d9ede1d287f (patch) | |
tree | 80c09621b511fbe195f6e3aff12a43f8fb3b9da2 | |
parent | ae940d8ab29da4a09d4d0ec5a8fdc87b40382407 (diff) | |
download | dovecot-antispam-03a1d105eaa49ab0717f048ab9e09d9ede1d287f.tar.gz dovecot-antispam-03a1d105eaa49ab0717f048ab9e09d9ede1d287f.tar.xz dovecot-antispam-03a1d105eaa49ab0717f048ab9e09d9ede1d287f.zip |
dspam-exec: log dspam output
-rw-r--r-- | dspam-exec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dspam-exec.c b/dspam-exec.c index b0316aa..bbb8338 100644 --- a/dspam-exec.c +++ b/dspam-exec.c @@ -63,14 +63,14 @@ static int call_dspam(const char *signature, enum classification wanted) if (pid) { int status; - char buf[1024]; + char buf[1025]; int readsize; bool error = FALSE; close(pipes[1]); do { - readsize = read(pipes[0], buf, sizeof(buf)); + readsize = read(pipes[0], buf, sizeof(buf) - 1); if (readsize < 0) { readsize = -1; if (errno == EINTR) @@ -84,6 +84,11 @@ static int call_dspam(const char *signature, enum classification wanted) */ if (readsize > 0 || readsize == -1) error = TRUE; + + if (readsize > 0) { + buf[readsize] = '\0'; + debug("dspam error: %s\n", buf); + } } while (readsize == -2 || readsize > 0); /* |