Re: [exim] Bad DKIM mainlog entries

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Björn Schlögl
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] Bad DKIM mainlog entries
Hi!

I wasn't happy with this multi-line log entry as well. The problem is that
libdkim already outputs the signature in multiple lines. It is necessary to
combine those lines into one. I wrote a small patch that does this but I am
not sure if it is save to be used in a production environment.

A better solution would be to have libdkim output the signature header in only
one line and let exim break it up into multiple lines.

Björn
diff -NaurwB exim-4.69.orig/src/dkim-exim.c exim-4.69/src/dkim-exim.c
--- exim-4.69.orig/src/dkim-exim.c    2007-10-09 16:10:34.000000000 +0200
+++ exim-4.69/src/dkim-exim.c    2008-03-07 18:12:01.000000000 +0100
@@ -480,7 +480,17 @@
     goto CLEANUP;
   }


-  log_write(0, LOG_MAIN, "Message signed with DKIM: %s\n",signature);
+  {
+    uschar buffer[71];
+    int seperator = '\n';
+    uschar* iterator = signature;
+    uschar* log_message = NULL;
+    int log_message_size = 0, log_message_offset = 0;
+    while(string_nextinlist(&iterator, &seperator, buffer, 71)) { log_message = string_append(log_message, &log_message_size, &log_message_offset, 2, buffer, US" "); }
+    log_message[log_message_offset] = '\0';
+    log_write(0, LOG_MAIN, "%s", log_message);
+    store_release(log_message);
+  }


rc = store_get(strlen(signature)+3);
Ustrcpy(rc,US signature);