I'm running dk-filter using domain wildcards, which results in erronic behaviour.
In mlfi_eoh() the domain is extracted in the following manner:
/* extract the sender's domain */
sm_strlcpy(addr, from->hdr_val, sizeof addr);
status = rfc2822_mailbox_split(addr, &p, &dfc->mctx_domain);
if (status != 0 || p == NULL || dfc->mctx_domain == NULL)
Here, addr is an array on the local stackframe, and mctx_domain will contain a pointer to frame local data after rfc2822_mailbox_split().
When wildcards aren't used, this pointer is later reassigned to domains[n], and this is not a problem, however, when wildcard expansion is used, mctx_domain will still refer to stack local data after the function finishes.
Afterwards, dfc->mctx_domain is referred to in mlfi_eom() when the actual signature header is added to the mail, including d=[stack garbage] instead of what one would like to see.
The obvious solution is to strdup() mctx_domain and free it up later, but I thought it best to leave the details of such a patch to you.
With kind regards,
-- Ronald Huizer