Index: opendmarc-1.3.0.beta0/opendmarc/opendmarc.c =================================================================== --- opendmarc-1.3.0.beta0.orig/opendmarc/opendmarc.c 2014-04-24 20:44:10.000000000 +0200 +++ opendmarc-1.3.0.beta0/opendmarc/opendmarc.c 2014-05-08 22:15:37.000000000 +0200 @@ -128,6 +128,7 @@ struct dmarcf_config { _Bool conf_reqhdrs; + _Bool conf_rejectreqhdrsfail; _Bool conf_afrf; _Bool conf_afrfnone; _Bool conf_rejectfail; @@ -1236,6 +1237,10 @@ &conf->conf_reqhdrs, sizeof conf->conf_reqhdrs); + (void) config_get(data, "RejectRequiredHeadersFailures", + &conf->conf_rejectreqhdrsfail, + sizeof conf->conf_rejectreqhdrsfail); + (void) config_get(data, "ForensicReports", &conf->conf_afrf, sizeof conf->conf_afrf); @@ -2079,7 +2084,14 @@ dfc->mctx_jobid, reqhdrs_error); } - return SMFIS_REJECT; + if (conf->conf_rejectreqhdrsfail) { + /* TODO: handle setreply failures */ + snprintf(replybuf, sizeof replybuf, + "RFC5322 header requirement error"); + dmarcf_setreply(ctx, DMARC_REJECT_SMTP, + DMARC_REJECT_ESC, replybuf); + return SMFIS_REJECT; + } } } @@ -2109,7 +2121,7 @@ dfc->mctx_jobid); } - if (conf->conf_reqhdrs) + if (conf->conf_rejectreqhdrsfail) return SMFIS_REJECT; else return SMFIS_ACCEPT; Index: opendmarc-1.3.0.beta0/opendmarc/opendmarc.conf.5.in =================================================================== --- opendmarc-1.3.0.beta0.orig/opendmarc/opendmarc.conf.5.in 2014-04-22 22:14:37.000000000 +0200 +++ opendmarc-1.3.0.beta0/opendmarc/opendmarc.conf.5.in 2014-05-08 22:15:37.000000000 +0200 @@ -225,8 +225,12 @@ .I RequiredHeaders (Boolean) If set, the filter will ensure the header of the message conforms to the basic header field count restrictions laid out in RFC5322, Section 3.6. Messages -failing this test are rejected without further processing. A From: -field from which no domain name could be extracted will also be rejected. +failing this test are logged. A From: +field from which no domain name could be extracted will also be logged. + +.TP +.I RejectRequiredHeadersFailures (Boolean) +Messages failing the above tests are rejected without further processing. .TP .I Socket (string) Index: opendmarc-1.3.0.beta0/opendmarc/opendmarc-config.h =================================================================== --- opendmarc-1.3.0.beta0.orig/opendmarc/opendmarc-config.h 2014-04-22 22:12:16.000000000 +0200 +++ opendmarc-1.3.0.beta0/opendmarc/opendmarc-config.h 2014-05-08 22:15:37.000000000 +0200 @@ -39,6 +39,7 @@ { "PublicSuffixList", CONFIG_TYPE_STRING, FALSE }, { "RecordAllMessages", CONFIG_TYPE_BOOLEAN, FALSE }, { "RequiredHeaders", CONFIG_TYPE_BOOLEAN, FALSE }, + { "RejectRequiredHeadersFailures", CONFIG_TYPE_BOOLEAN, FALSE }, { "RejectFailures", CONFIG_TYPE_BOOLEAN, FALSE }, { "ReportCommand", CONFIG_TYPE_STRING, FALSE }, { "Socket", CONFIG_TYPE_STRING, FALSE },