summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OS/Makefile-Base4
-rw-r--r--src/src/dkim.c18
-rw-r--r--src/src/macro_predef.c23
-rw-r--r--src/src/macro_predef.h1
-rw-r--r--src/src/pdkim/pdkim.c8
-rw-r--r--src/src/pdkim/pdkim.h9
6 files changed, 49 insertions, 14 deletions
diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base
index 67ac082ba..60c97c210 100644
--- a/src/OS/Makefile-Base
+++ b/src/OS/Makefile-Base
@@ -135,6 +135,7 @@ OBJ_MACRO = macro_predef.o \
macro-manualroute.o macro-queryprogram.o macro-redirect.o \
macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-tls.o\
+ macro-dkim.o
$(OBJ_MACRO): $(MACRO_HSRC)
@@ -222,6 +223,9 @@ macro-spa.o : auths/spa.c
macro-tls.o: auths/tls.c
@echo "$(CC) -DMACRO_PREDEF auths/tls.c"
$(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
+macro-dkim.o: dkim.c
+ @echo "$(CC) -DMACRO_PREDEF dkim.c"
+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ dkim.c
macro_predef: $(OBJ_MACRO)
@echo "$(LNCC) -o $@"
diff --git a/src/src/dkim.c b/src/src/dkim.c
index 038adb8b9..41540b39d 100644
--- a/src/src/dkim.c
+++ b/src/src/dkim.c
@@ -12,7 +12,20 @@
#ifndef DISABLE_DKIM
-#include "pdkim/pdkim.h"
+# include "pdkim/pdkim.h"
+
+# ifdef MACRO_PREDEF
+# include "macro_predef.h"
+
+void
+dkim_params(void)
+{
+builtin_macro_create_var(US"_DKIM_SIGN_HEADERS", US PDKIM_DEFAULT_SIGN_HEADERS);
+}
+# else /*!MACRO_PREDEF*/
+
+
+
int dkim_verify_oldpool;
pdkim_ctx *dkim_verify_ctx = NULL;
@@ -661,4 +674,5 @@ expand_bad:
goto bad;
}
-#endif
+# endif /*!MACRO_PREDEF*/
+#endif /*!DISABLE_DKIM*/
diff --git a/src/src/macro_predef.c b/src/src/macro_predef.c
index 6b3157fbe..1b5cf4795 100644
--- a/src/src/macro_predef.c
+++ b/src/src/macro_predef.c
@@ -21,7 +21,7 @@ uschar * syslog_facility_str;
/******************************************************************************/
void
-builtin_macro_create(const uschar * name)
+builtin_macro_create_var(const uschar * name, const uschar * val)
{
printf ("static macro_item p%d = { ", mp_index);
if (mp_index == 0)
@@ -29,12 +29,20 @@ if (mp_index == 0)
else
printf(".next=&p%d,", mp_index-1);
-printf(" .command_line=FALSE, .namelen=%d, .replen=1,"
- " .name=US\"%s\", .replacement=US\"y\" };\n",
- Ustrlen(name), CS name);
+printf(" .command_line=FALSE, .namelen=%d, .replen=%d,"
+ " .name=US\"%s\", .replacement=US\"%s\" };\n",
+ Ustrlen(name), Ustrlen(val), CS name, CS val);
mp_index++;
}
+
+void
+builtin_macro_create(const uschar * name)
+{
+builtin_macro_create_var(name, US"y");
+}
+
+
void
spf(uschar * buf, int len, const uschar * fmt, ...)
{
@@ -265,6 +273,12 @@ options_transports();
options_auths();
}
+static void
+params(void)
+{
+dkim_params();
+}
+
int
main(void)
@@ -272,6 +286,7 @@ main(void)
printf("#include \"exim.h\"\n");
features();
options();
+params();
printf("macro_item * macros = &p%d;\n", mp_index-1);
printf("macro_item * mlast = &p0;\n");
diff --git a/src/src/macro_predef.h b/src/src/macro_predef.h
index 1d3ba7f74..aece28cc7 100644
--- a/src/src/macro_predef.h
+++ b/src/src/macro_predef.h
@@ -9,6 +9,7 @@
extern void spf(uschar *, int, const uschar *, ...);
extern void builtin_macro_create(const uschar *);
+extern void builtin_macro_create_var(const uschar *, const uschar *);
extern void options_from_list(optionlist *, unsigned, const uschar *, uschar *);
extern void options_main(void);
diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c
index 06d455d7d..1420b1a79 100644
--- a/src/src/pdkim/pdkim.c
+++ b/src/src/pdkim/pdkim.c
@@ -51,14 +51,6 @@
#define PDKIM_MAX_HEADERS 512
#define PDKIM_MAX_BODY_LINE_LEN 16384
#define PDKIM_DNS_TXT_MAX_NAMELEN 1024
-#define PDKIM_DEFAULT_SIGN_HEADERS "From:Sender:Reply-To:Subject:Date:"\
- "Message-ID:To:Cc:MIME-Version:Content-Type:"\
- "Content-Transfer-Encoding:Content-ID:"\
- "Content-Description:Resent-Date:Resent-From:"\
- "Resent-Sender:Resent-To:Resent-Cc:"\
- "Resent-Message-ID:In-Reply-To:References:"\
- "List-Id:List-Help:List-Unsubscribe:"\
- "List-Subscribe:List-Post:List-Owner:List-Archive"
/* -------------------------------------------------------------------------- */
struct pdkim_stringlist {
diff --git a/src/src/pdkim/pdkim.h b/src/src/pdkim/pdkim.h
index a34999ad8..067c574f2 100644
--- a/src/src/pdkim/pdkim.h
+++ b/src/src/pdkim/pdkim.h
@@ -26,6 +26,15 @@
#include "../blob.h"
#include "../hash.h"
+#define PDKIM_DEFAULT_SIGN_HEADERS "From:Sender:Reply-To:Subject:Date:"\
+ "Message-ID:To:Cc:MIME-Version:Content-Type:"\
+ "Content-Transfer-Encoding:Content-ID:"\
+ "Content-Description:Resent-Date:Resent-From:"\
+ "Resent-Sender:Resent-To:Resent-Cc:"\
+ "Resent-Message-ID:In-Reply-To:References:"\
+ "List-Id:List-Help:List-Unsubscribe:"\
+ "List-Subscribe:List-Post:List-Owner:List-Archive"
+
/* -------------------------------------------------------------------------- */
/* Length of the preallocated buffer for the "answer" from the dns/txt
callback function. This should match the maximum RDLENGTH from DNS. */