Ensure 100% email inbox delivery to Gmail, Outlook, and Yahoo with cryptographic DKIM and SPF authentication
By following this guide, you will configure Postfix as an authoritative mail transfer agent on Ubuntu. You will generate 2048-bit OpenDKIM cryptographic keys, publish SPF TXT records, and enforce strict DMARC alignment to avoid spam folders.
Spin up an Ubuntu 24.04 instance with instant activation to test this tutorial:
Deploy IndSoft VPSA Linux VPS with clean reverse DNS (PTR) set on its dedicated IP address. Recommended: IndSoft Dedicated IP VPS.
Install Postfix MTA and OpenDKIM signing utilities.
sudo DEBIAN_FRONTEND=noninteractive apt install postfix postfix-pcre opendkim opendkim-tools -yCreate RSA keys and configure OpenDKIM key tables.
sudo mkdir -p /etc/opendkim/keys/example.com
sudo opendkim-genkey -b 2048 -d example.com -D /etc/opendkim/keys/example.com -s mail -v
sudo chown -R opendkim:opendkim /etc/opendkimPublish the generated public key in your DNS zone along with SPF and DMARC policies.
# DNS TXT for SPF: v=spf1 ip4:YOUR_SERVER_IP ~all
# DNS TXT for mail._domainkey.example.com: v=DKIM1; k=rsa; p=MIIBIj...
# DNS TXT for _dmarc.example.com: v=DMARC1; p=quarantine; rua=mailto:dmarc@example.comRun this quick verification check to confirm your installation is responding properly:
opendkim-testkey -d example.com -s mail -vvvQuick resolutions for frequent setup pitfalls and configuration issues.
dig -x YOUR_IP +short. Contact IndSoft support to set your custom PTR record.
mail) matches between OpenDKIM KeyTable and your DNS record name.