Skip to content

Implementing ARC signing on a forwarding mail relay

When you forward mail you break DKIM body hashes and SPF alignment. ARC carries the original auth verdict so the destination still trusts the message.

You run a corporate forwarder — aliases at alumni.example.org re-mail to whatever address the alum has today. After a Gmail policy change, those forwarded messages now end up in the recipient’s spam folder, with the headers showing dmarc=fail and arc=none. The forwarder is rewriting envelope sender (so SPF passes on the new path) but the original DKIM signature covers the original From: header and a body that the forwarder may have touched. The fix is ARC — Authenticated Received Chain — which preserves the original authentication verdict in cryptographically signed headers so the next hop can trust your assertion that the mail was authenticated when you received it.

What’s happening

A forwarding relay sits between sender and final destination. SPF aligns to whoever owns the connecting IP, so once the forwarder relays, SPF for the original Return-Path breaks. DKIM survives only if no header or body byte covered by the signature has changed — many mailing lists or footer-injecting forwarders break it. With both SPF and DKIM failing, DMARC fails, and a strict policy at the recipient sends the message to spam or rejects it. ARC fixes this by adding three headers at the forwarder: ARC-Authentication-Results (a snapshot of how the message authenticated when the forwarder received it), ARC-Message-Signature (a DKIM-style signature over the message as the forwarder saw it), and ARC-Seal (a signature chaining over the previous ARC headers). Each hop in the chain adds its own set with an incrementing instance i= value. Receivers that honour ARC — Gmail, Yahoo, Microsoft, Apple — will accept the forwarder’s verdict if the chain validates and the forwarder is on their trusted list.

ARC does not magically bypass DMARC. It documents that the forwarder did its job. The receiver still decides whether to trust the forwarder. Reputation of the forwarder’s domain matters.

How to verify

Inspect a forwarded message in the recipient inbox. View original headers, look for the ARC stack:

ARC-Seal: i=1; a=rsa-sha256; t=1747200000; cv=none;
        d=alumni.example.org; s=arc; b=...
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
        d=alumni.example.org; s=arc; t=1747200000;
        h=from:to:subject:date:message-id; bh=...; b=...
ARC-Authentication-Results: i=1; mx.alumni.example.org;
        dkim=pass header.d=acmecorp.com header.s=mail header.b=...;
        spf=pass smtp.mailfrom=alice@acmecorp.com;
        dmarc=pass header.from=acmecorp.com

Then check what the receiving MX recorded:

Authentication-Results: mx.google.com;
        arc=pass (i=1 spf=pass spfdomain=acmecorp.com
                  dkim=pass dkdomain=acmecorp.com dmarc=pass);
        dkim=fail; spf=fail; dmarc=fail

arc=pass is what saves the delivery. If you see arc=fail or arc=none after deploying, the chain isn’t being added or the signature is malformed.

Validate the signature locally with opendkim-testkey or rspamadm sign:

# Confirm the ARC selector resolves with the right public key
dig +short TXT arc._domainkey.alumni.example.org
# "v=DKIM1; k=rsa; p=MIIBIjANBgkqhki..."

For a live trace, feed a sample message through your forwarder with the Rspamd or OpenDKIM debug logs raised and confirm the ARC-* headers are being prepended.

The fix

Two viable implementations. Pick one — do not double-sign.

Rspamd 3.x has first-class ARC support and is what we standardize on for greenfield forwarders.

Generate a keypair and publish the selector:

mkdir -p /etc/rspamd/arc-keys
cd /etc/rspamd/arc-keys
rspamadm dkim_keygen -s arc -d alumni.example.org -k arc.key > arc.pub.dns
chown _rspamd:_rspamd arc.key
chmod 600 arc.key
cat arc.pub.dns
# arc._domainkey IN TXT ( "v=DKIM1; k=rsa; "
#   "p=MIIBIjANBgkqhki..." )

Publish that TXT record at arc._domainkey.alumni.example.org, wait for propagation, then enable the module:

# /etc/rspamd/local.d/arc.conf
selector = "arc";
domain {
  alumni.example.org {
    path = "/etc/rspamd/arc-keys/arc.key";
    selector = "arc";
  }
}
sign_local = true;
sign_authenticated = true;
sign_inbound = false;
allow_envfrom_empty = true;
allow_username_mismatch = true;

Restart Rspamd:

systemctl restart rspamd
journalctl -u rspamd -f | grep -i arc

Option B — OpenDKIM 2.10+ with ARC support

OpenDKIM ships an ARC mode for sites already running it for DKIM. Configure a separate signing selector for ARC; do not reuse the DKIM selector.

# /etc/opendkim.conf — relevant additions
Mode               sv

# ARC mode
EnableARC          yes
ARCSign            yes
ARCSignHeaders     From,Reply-To,Subject,Date,To,Cc,Resent-Date,Resent-From,Resent-To,Resent-Cc,In-Reply-To,References,List-Id,List-Help,List-Unsubscribe,List-Subscribe,List-Post,List-Owner,List-Archive

ARCSealKeyFile     /etc/opendkim/keys/arc.private
ARCSealSelector    arc
ARCSealDomain      alumni.example.org
ARCSealHeaders     From,Reply-To,Subject,Date,To,Cc

InternalHosts      /etc/opendkim/TrustedHosts
KeyTable           /etc/opendkim/KeyTable
SigningTable       refile:/etc/opendkim/SigningTable

Generate the keypair:

opendkim-genkey -b 2048 -d alumni.example.org -s arc \
  -D /etc/opendkim/keys/
mv /etc/opendkim/keys/arc.private /etc/opendkim/keys/arc.private
chown opendkim:opendkim /etc/opendkim/keys/arc.private
chmod 600 /etc/opendkim/keys/arc.private
cat /etc/opendkim/keys/arc.txt
# Publish the resulting TXT at arc._domainkey.alumni.example.org

Restart and watch:

systemctl restart opendkim
tail -f /var/log/maillog | grep -E 'ARC|arc='

Wire it into Postfix

Either implementation runs as a milter. Add it to main.cf:

# Rspamd
smtpd_milters         = inet:127.0.0.1:11332
non_smtpd_milters     = inet:127.0.0.1:11332

# Or OpenDKIM
smtpd_milters         = inet:127.0.0.1:8891
non_smtpd_milters     = inet:127.0.0.1:8891

milter_default_action = accept
milter_protocol       = 6

Reload:

postfix check && systemctl reload postfix

Operational follow-ups

  • Don’t rewrite headers ARC covers. If your forwarder strips Authentication-Results from the upstream MX before ARC signs, your ARC-Authentication-Results won’t include the upstream’s verdict. Let ARC capture it as it arrived.
  • Rotate the ARC key on the same cadence as DKIM — annually is reasonable, with a 30-day overlap window where both keys are published.
  • Watch DMARC reports for arc= lines. Google’s aggregate reports include ARC results. If your arc=pass rate is below ~98% on forwarded streams, something in the milter chain is mangling messages.
  • ARC is not licence to lower DMARC. Keep your DMARC posture on the sending domains — ARC helps forwarded mail land in inboxes that already trust your forwarder’s domain.

Stack Harbor stands up ARC-signing forwarders on dedicated mail relays as part of mail authentication work under environment management and runs them on cloud compute tier with monitoring tied into our support plane — book a working session if forwarded mail is hitting spam.