]> source.dussan.org Git - rspamd.git/commitdiff
* Fix issue with folding multiline headers (submitted by Anton Nekhoroshikh).
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 26 May 2010 11:23:00 +0000 (15:23 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 26 May 2010 11:23:00 +0000 (15:23 +0400)
contrib/exim/local_scan.c

index 472e075984c444c82cea8fe41fe13f63259da5c6..cffe9de290f7080a50611fe09cf80af194f81405 100644 (file)
@@ -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);
         }