OpenDKIM Signing Table not matching wildcard email addresses despite correct Signing Table configuration

In this problem, I have configured OpenDKIM to use a signing table, which was saved at /etc/opendkim/signing.table. The signing table contains:

*@onlybmw.com default._domainkey.onlybmw.com

This is supposed to allow OpenDKIM to recognize any email addresses for domain onlybmw.com, however, OpenDKIM still fails to recognize [email protected], and thus, won’t sign in.

When I changed the content of the signing table to:

noreply@onlybmw.com default._domainkey.onlybmw.com

OpenDKIM signs the email [email protected] without any problem. So why is *@onlybmw.com not working? The wildcard means that OpenDKIM is supposed to sign any email coming from onlybmw.com.

Troubleshooting

The signing table is correct and using a wildcard is not the issue. It’s how OpenDKIM parses the SigningTable.

Wildcards require refile: in opendkim.conf

In /etc/opendkim.conf, if you have:

SigningTable /etc/opendkim/signing.table

  • OpenDKIM treats the lines literally, so *@onlybmw.com does not match [email protected].
  • Wildcards only work if you use the refile: prefix:

SigningTable refile:/etc/opendkim/signing.table

  • refile: tells OpenDKIM to treat the left-hand side as a regex or pattern, so *@onlybmw.com works.

Why your explicit email works

[email protected] default._domainkey.onlybmw.com

  • Exact match, so OpenDKIM finds the selector immediately.
  • No wildcard needed — that’s why it “passes.”

How to make wildcards work

  1. Edit /etc/opendkim.conf:

SigningTable refile:/etc/opendkim/signing.table

  1. Keep SigningTable with wildcards:

*@astralmeta.com default._domainkey.astralmeta.com
*@onlybmw.com default._domainkey.onlybmw.com

  1. Restart OpenDKIM:

sudo systemctl restart opendkim

  1. Test by sending from any address in that domain:

Summary

  • *@domain.com does not work with SigningTable /etc/opendkim/signing.table (literal match).
  • refile: is required for wildcards or regex.
  • Exact addresses always work.

Leave a Reply