Index: dkim-filter/dkim-filter.c
--- dkim-filter/dkim-filter.c.orig	2007-10-05 23:14:21 +0200
+++ dkim-filter/dkim-filter.c	2007-10-07 10:14:13 +0200
@@ -56,7 +56,7 @@
 #include <sm/string.h>
 
 /* libmilter includes */
-#include "libmilter/mfapi.h"
+#include "milter/mfapi.h"
 
 /* libdkim includes */
 #include <dkim.h>
@@ -2879,6 +2879,13 @@
 		}
 	}
 
+	/* Determine the job ID for logging. */
+	if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) {
+		char *jobid = smfi_getsymval(ctx, "i");
+		if (jobid != 0)
+			dfc->mctx_jobid = jobid;
+	}
+
 	/* get hostname; used in the X header and in new MIME boundaries */
 	hostname = dkimf_getsymval(ctx, "j");
 	if (hostname == NULL)
Index: dkim-filter/dkim-filter.h
--- dkim-filter/dkim-filter.h.orig	2008-01-25 19:45:56.000000000 +0100
+++ dkim-filter/dkim-filter.h	2008-01-26 08:46:45.000000000 +0100
@@ -19,7 +19,7 @@
 #include <sm/gen.h>
 
 /* libmilter */
-#include <libmilter/mfapi.h>
+#include <milter/mfapi.h>
 
 /* libdkim */
 #include <dkim.h>
Index: dkim-filter/test.h
--- dkim-filter/test.h.orig	2007-10-03 03:02:33.000000000 +0200
+++ dkim-filter/test.h	2008-01-26 08:47:19.000000000 +0100
@@ -21,7 +21,7 @@
 #include <sm/cdefs.h>
 
 /* libmilter includes */
-#include <libmilter/mfapi.h>
+#include <milter/mfapi.h>
 
 /* libdkim includes */
 #include "dkim.h"
