]> source.dussan.org Git - rspamd.git/commitdiff
Fix patch for exim.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 21 Feb 2011 18:19:07 +0000 (21:19 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 21 Feb 2011 18:19:07 +0000 (21:19 +0300)
Fix parsing of wrong headers.

contrib/exim/patch-exim-src_spam.c.diff
src/message.c

index 528c063280d7444ef13fabfda75980bf7bfac510..1109874b51dbf1e4b504c12b09aa6e52750468b2 100644 (file)
@@ -1,5 +1,5 @@
 --- src/spam.c.orig    2011-01-20 19:29:51.179597017 +0300
-+++ src/spam.c 2011-01-20 19:40:42.818516872 +0300
++++ src/spam.c 2011-02-21 21:17:15.051230555 +0300
 @@ -21,6 +21,9 @@
  int spam_ok = 0;
  int spam_rc = 0;
 +  
 +  r = 0;
 +  r += push_line(request_v, request_p++, "REPORT SPAMC/1.2\r\n");
-+  r += push_line(request_v, request_p++, "Content-length: " OFF_T_FMT "\r\n", mbox_size);
++  r += push_line(request_v, request_p++, "Content-length: %lu\r\n", mbox_size);
 +  r += push_line(request_v, request_p++, "Queue-Id: %s\r\n", message_id);
-+  r += push_line(request_v, request_p++, "From: %s\r\n", sender_address);
++  r += push_line(request_v, request_p++, "From: <%s>\r\n", sender_address);
 +  r += push_line(request_v, request_p++, "Recipient-Number: %d\r\n", recipients_count);
 +  for (i = 0; i < recipients_count; i ++)
-+    r += push_line(request_v, request_p++, "Rcpt: %s\r\n", recipients_list[i].address);
++    r += push_line(request_v, request_p++, "Rcpt: <%s>\r\n", recipients_list[i].address);
 +  if ((helo = expand_string(US"$sender_helo_name")) != NULL && *helo != '\0')
 +    r += push_line(request_v, request_p++, "Helo: %s\r\n", helo);
 +  if (sender_host_address != NULL)
      (void)close(spamd_sock);
      log_write(0, LOG_MAIN|LOG_PANIC,
           "spam acl condition: spamd send failed: %s", strerror(errno));
+@@ -329,7 +344,7 @@
+   (void)close(spamd_sock);
+   /* dig in the spamd output and put the report in a multiline header, if requested */
+-  if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n",
++  if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\n\r\nSpam: %*s ; %lf / %lf\r\nContent-length: %*u\r\n\r\n%n",
+              spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) {
+     /* try to fall back to pre-2.50 spamd output */
 @@ -420,4 +435,31 @@
    };
  }
index 2df435eb84ed56d681324881aa4f0ddbf3c267f2..bf2896009734fa972cd77653e9ace8a2003f4ad9 100644 (file)
@@ -616,6 +616,7 @@ process_raw_headers (struct worker_task *task)
                                if (*(p + 1) == '\r') {
                                        p ++;
                                }
+                               p ++;
                                state = next_state;
                        }
                        else {