Received headers¶
Each receiving MTA adds its own Received header. Remote headers are not automatically authentic.
Setup¶
Prepare your values and Debian packages. CLI tests use only your local test files and configuration.
Configure basic Postfix and run the DKIM SMTP test. Use the file actually delivered locally. Preserve existing remote Received headers when forwarding.
Test¶
set -euo pipefail
python3 - <<'PY'
from email.parser import BytesParser
from email.policy import default
from pathlib import Path
message = BytesParser(policy=default).parsebytes(Path("/root/mail-tests/dkim.eml").read_bytes())
hops = message.get_all("Received", [])
assert hops, "No message received by your Postfix server"
for hop in hops:
print(hop)
assert any("Postfix" in str(hop) for hop in hops)
print("PASS: your Postfix server added a Received header when receiving the message.")
PY
This CLI test confirms the local behavior described above. For production, send your own message using the actual client and MTA through the real sending route and verify it at a recipient you control.