Index: dv-opendmarc-0.2.2/opendmarc/opendmarc.c =================================================================== --- dv-opendmarc-0.2.2.orig/opendmarc/opendmarc.c 2012-09-16 21:47:43.000000000 +0200 +++ dv-opendmarc-0.2.2/opendmarc/opendmarc.c 2012-09-16 22:16:58.000000000 +0200 @@ -126,6 +126,7 @@ struct dmarcf_config { _Bool conf_afrf; + char * conf_bcconfail; _Bool conf_deliver; _Bool conf_dolog; _Bool conf_enablecores; @@ -1131,6 +1132,10 @@ sizeof conf->conf_dnstimeout); } + (void) config_get(data, "BccOnFail", + &conf->conf_bcconfail, + sizeof conf->conf_bcconfail); + (void) config_get(data, "EnableCoredumps", &conf->conf_enablecores, sizeof conf->conf_enablecores); @@ -2436,6 +2441,20 @@ ret = SMFIS_REJECT; result = DMARC_RESULT_REJECT; } + else if (conf->conf_bcconfail != NULL) + { + if (conf->conf_dolog) + { + syslog(LOG_INFO, "%s: dmarc=fail: adding bcc recipient %s", + dfc->mctx_jobid, conf->conf_bcconfail); + } + status = smfi_addrcpt(ctx, conf->conf_bcconfail); + if (status != MI_SUCCESS && conf->conf_dolog) + { + syslog(LOG_ERR, "%s: smfi_addrcpt() on dmarc=fail failed", + dfc->mctx_jobid); + } + } break; @@ -3755,7 +3774,7 @@ return EX_UNAVAILABLE; } - smfilter.xxfi_flags = SMFIF_ADDHDRS|SMFIF_QUARANTINE; + smfilter.xxfi_flags = SMFIF_ADDRCPT|SMFIF_ADDHDRS|SMFIF_QUARANTINE; #ifdef SMFIF_SETSYMLIST smfilter.xxfi_flags |= SMFIF_SETSYMLIST; #endif /* SMFIF_SETSYMLIST */ Index: dv-opendmarc-0.2.2/opendmarc/opendmarc.conf.5.in =================================================================== --- dv-opendmarc-0.2.2.orig/opendmarc/opendmarc.conf.5.in 2012-09-16 21:47:43.000000000 +0200 +++ dv-opendmarc-0.2.2/opendmarc/opendmarc.conf.5.in 2012-09-16 21:50:33.000000000 +0200 @@ -116,6 +116,13 @@ a specific location. .TP +.I BccOnFail (string) +Requests that any message failing the DMARC evaluation will be sent to the given +Recipient. +.I AlwaysDeliver +must be set. + +.TP .I ChangeRootDirectory (string) Requests that the operating system change the effective root directory of the process to the one specified here prior to beginning execution. Index: dv-opendmarc-0.2.2/opendmarc/opendmarc-config.h =================================================================== --- dv-opendmarc-0.2.2.orig/opendmarc/opendmarc-config.h 2012-09-16 21:47:43.000000000 +0200 +++ dv-opendmarc-0.2.2/opendmarc/opendmarc-config.h 2012-09-16 21:50:33.000000000 +0200 @@ -24,6 +24,7 @@ { "AutoRestartRate", CONFIG_TYPE_STRING, FALSE }, { "Background", CONFIG_TYPE_BOOLEAN, FALSE }, { "BaseDirectory", CONFIG_TYPE_STRING, FALSE }, + { "BccOnFail", CONFIG_TYPE_STRING, FALSE }, { "ChangeRootDirectory", CONFIG_TYPE_STRING, FALSE }, { "DNSTimeout", CONFIG_TYPE_INTEGER, FALSE }, { "EnableCoredumps", CONFIG_TYPE_BOOLEAN, FALSE },