Bug#1014945: exim4: Failed to build exim4-daemon-custom with DMARC support, due to OpenDMARC's api change on opendmarc_policy_store_dkim.

leafee98 leafee98 at hotmail.com
Fri Jul 15 08:19:40 BST 2022

Package: exim4
Version: 4.94.2-7
Severity: serious
Tags: d-i ftbfs patch
Justification: fails to build from source

Dear Maintainer,

When building the exim4-daemon-custom with the source package of exim4, 
after enable the DMARC support by uncomment some line in 
EDITME.exim4-xxxx. I finally got the following error:

dmarc.c:448:20: error: too few arguments to function 
   448 |     libdm_status = opendmarc_policy_store_dkim(dmarc_pctx, US 
       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from dmarc.h:14,
                  from exim.h:548,
                  from dmarc.c:14:
/usr/include/opendmarc/dmarc.h:122:20: note: declared here
   122 | OPENDMARC_STATUS_T opendmarc_policy_store_dkim(DMARC_POLICY_T 
*pctx, u_char *domain, u_char *selector, int result, u_char *human_result);
       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

I found it's a old build bug of exim4 because of the OpenDMARC's API 
change between 1.3 and 1.4 that add an additional parameter "selector" 
to the function `opendmarc_policy_store_dkim`. See also at related bugs 
1 and 2.

The related bugs 1 provided a short patch, and I paste it at follow. 
After patch it, I succeed to build exim4-daemon-custom with SPF and 
DMARC support.

--- exim4-4.94.2.orig/src/dmarc.c
+++ exim4-4.94.2/src/dmarc.c
@@ -446,7 +446,7 @@ if (!dmarc_abort && !sender_host_authent
                   vs == PDKIM_VERIFY_INVALID ? 
      libdm_status = opendmarc_policy_store_dkim(dmarc_pctx, US sig->domain,
-                                              dkim_result, US"");
+                                              sig->selector, 
dkim_result, US"");
        debug_printf("DMARC adding DKIM sender domain = %s\n", sig->domain);
      if (libdm_status != DMARC_PARSE_OKAY)

-- System Information:
Debian Release: 11.4
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-16-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE 
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages exim4 depends on:
ii  debconf [debconf-2.0]  1.5.77
ii  exim4-base             4.94.2-7
ii  exim4-daemon-custom    4.94.2-7

exim4 recommends no packages.

exim4 suggests no packages.

More information about the Pkg-exim4-maintainers mailing list