I'm trying to figure out how DKIM verification works.
My understanding so far has been that the domain inside DKIM-Signature
header must match the domain inside From
header in case for DKIM check to pass.
- I configured the opendkim
SigningTable
all e-mails fromlskdfjlsd.com
domain with domain key from different domain:
*@lskdfjlsd.com default._domainkey.unrelateddomain.com
- My
KeyTable
looks like this:
default._domainkey.unrelateddomain.com unrelateddomain.com:default:/etc/opendkim/keys/unrelateddomain.com/default
- I send out e-mails with this:
echo "Hello world" | mail -s "Hello" -r noreply@lskdfjlsd.com my-personal-mail@gmail.com
- When I check the e-mail inside my-personal-mail@gmail.com I can see the DKIM check passed for the domain
unrelateddomain.com
- the content of the DKIM header and From field is:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unrelateddomain.com; s=default
From: noreply@lskdfjlsd.com
And this is where my confusion stems from. The DKIM check says PASS for domain unrelateddomain.com
but the From
header clearly says it's originated from different domain. Based on this the https://mxtoolbox.com/dmarc/dkim/dkim-alignment I'd expect the DKIM check will fail.
I've tried to playing with domains and DKIM check always says PASS no mather if domains match or not.