aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/exim
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-05-26 15:23:00 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-05-26 15:23:00 +0400
commitd608ddf90823ba1fb60bed510751fb219f440f0e (patch)
treebdaf44d986c2356d778a2e3a882d6b5abf6d0c68 /contrib/exim
parent40104096312e987c4d7320eb35949b5bab66ddc2 (diff)
downloadrspamd-d608ddf90823ba1fb60bed510751fb219f440f0e.tar.gz
rspamd-d608ddf90823ba1fb60bed510751fb219f440f0e.zip
* Fix issue with folding multiline headers (submitted by Anton Nekhoroshikh).
Diffstat (limited to 'contrib/exim')
-rw-r--r--contrib/exim/local_scan.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/contrib/exim/local_scan.c b/contrib/exim/local_scan.c
index 472e07598..cffe9de29 100644
--- a/contrib/exim/local_scan.c
+++ b/contrib/exim/local_scan.c
@@ -561,8 +561,11 @@ int WaitForScanResult (uschar **resStr)
back = *tmp;
*tmp = '\0';
if(smb>0) {
- tok[0] = tok[1]= tok[2]= tok[3]= tok[4]= tok[5]= tok[6]= ' ';
- symbols = string_sprintf ("%s\n%s", symbols, tok+5);
+ tok += 7;
+ while(*tok && isspace(*tok)) tok++;
+ if(strlen(tok)>0) {
+ symbols = string_sprintf ("%s\n %s", symbols, tok);
+ }
} else {
tok += 7;
while(*tok && isspace(*tok)) tok++;
@@ -604,20 +607,13 @@ int WaitForScanResult (uschar **resStr)
header_del ((uschar *) "X-Spam-Sybmols");
header_add (' ', "%s: %s\n", "X-Spam-Sybmols", symbols);
while(*tmp!='\0') {
- if((*tmp == '\n') || (*tmp == '\r')) {
- tmp++;
- continue;
- }
- if ((*tmp == ' ') && (*(tmp+1)==' ')) {
- tok[i++] = ',';
- tmp += 2;
- continue;
- }
- tok[i] = *tmp;
- i++;
+ if(*tmp == '\r')
+ *tmp = ' ';
+ if(*tmp == '\n')
+ *tmp = ',';
tmp++;
}
- tok[i] = '\0';
+ *tmp = '\0';
log_write(0, LOG_MAIN, "rspam-exim: symbols: %s", tok);
}