Skip to content

Commit ff1dbaf

Browse files
authored
Merge pull request trusteddomainproject#374 from thegushi/feature/softwareheader-via-hostname
SoftwareHeader: include milter hostname when different from MTA hostname
2 parents 1da33bb + bbd7a9c commit ff1dbaf

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

opendmarc/opendmarc.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3777,10 +3777,21 @@ mlfi_eom(SMFICTX *ctx)
37773777

37783778
if (conf->conf_addswhdr)
37793779
{
3780-
snprintf(header, sizeof header, "%s v%s %s %s",
3781-
DMARCF_PRODUCT, DMARCF_VERSION, hostname,
3782-
dfc->mctx_jobid != NULL ? dfc->mctx_jobid
3783-
: JOBIDUNKNOWN);
3780+
if (strcasecmp(hostname, myhostname) == 0)
3781+
{
3782+
snprintf(header, sizeof header, "%s v%s %s %s",
3783+
DMARCF_PRODUCT, DMARCF_VERSION, hostname,
3784+
dfc->mctx_jobid != NULL ? dfc->mctx_jobid
3785+
: JOBIDUNKNOWN);
3786+
}
3787+
else
3788+
{
3789+
snprintf(header, sizeof header, "%s v%s %s via %s %s",
3790+
DMARCF_PRODUCT, DMARCF_VERSION, hostname,
3791+
myhostname,
3792+
dfc->mctx_jobid != NULL ? dfc->mctx_jobid
3793+
: JOBIDUNKNOWN);
3794+
}
37843795

37853796
if (dmarcf_insheader(ctx, 0, SWHEADERNAME,
37863797
header) == MI_FAILURE)

0 commit comments

Comments
 (0)