Skip to content

Commit

Permalink
Enforce SMFIF_ADDRCPT, SMFIF_DELRCPT, SMFIF_CHGHDRS and SMFIF_QUARANT…
Browse files Browse the repository at this point in the history
…INE if FinalPolicyScript is set so that odkim.add_rcpt, odkim.del_rcpt, odkim.del_header and odkim.quarantine work predictably regardless of other configuration parameters
  • Loading branch information
branciar committed Apr 2, 2024
1 parent 551ab38 commit 436070b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions opendkim/opendkim.c
Original file line number Diff line number Diff line change
Expand Up @@ -11005,15 +11005,26 @@ mlfi_negotiate(SMFICTX *ctx,
# ifdef _FFR_VBR
conf->conf_vbr_purge ||
# endif /* _FFR_VBR */
# ifdef USE_LUA
conf->conf_finalscript != NULL ||
# endif /* USE_LUA */
conf->conf_remsigs)
reqactions |= SMFIF_CHGHDRS;

# ifdef SMFIF_QUARANTINE
# ifdef USE_LUA
if (conf->conf_capture || conf->conf_finalscript != NULL)
# else /* USE_LUA */
if (conf->conf_capture)
# endif /* USE_LUA */
reqactions |= SMFIF_QUARANTINE;
# endif /* SMFIF_QUARANTINE */

# ifdef USE_LUA
if (conf->conf_redirect != NULL || conf->conf_finalscript != NULL)
# else /* USE_LUA */
if (conf->conf_redirect != NULL)
# endif /* USE_LUA */
{
reqactions |= SMFIF_ADDRCPT;
reqactions |= SMFIF_DELRCPT;
Expand Down Expand Up @@ -16900,7 +16911,11 @@ main(int argc, char **argv)

smfilter.xxfi_flags = SMFIF_ADDHDRS;

#ifdef USE_LUA
if (curconf->conf_redirect != NULL || curconf->conf_finalscript != NULL)
#else /* USE_LUA */
if (curconf->conf_redirect != NULL)
#endif /* USE_LUA */
{
smfilter.xxfi_flags |= SMFIF_ADDRCPT;
smfilter.xxfi_flags |= SMFIF_DELRCPT;
Expand All @@ -16918,10 +16933,17 @@ main(int argc, char **argv)
#ifdef _FFR_VBR
curconf->conf_vbr_purge ||
#endif /* _FFR_VBR */
#ifdef USE_LUA
curconf->conf_finalscript != NULL ||
#endif /* USE_LUA */
curconf->conf_remsigs)
smfilter.xxfi_flags |= SMFIF_CHGHDRS;
#ifdef SMFIF_QUARANTINE
#ifdef USE_LUA
if (curconf->conf_capture || curconf->conf_finalscript != NULL)
#else /* USE_LUA */
if (curconf->conf_capture)
#endif /* USE_LUA */
smfilter.xxfi_flags |= SMFIF_QUARANTINE;
#endif /* SMFIF_QUARANTINE */

Expand Down

0 comments on commit 436070b

Please sign in to comment.