Topic: DKIM invalid (public key: OpenSSL error: bad base64 decode)
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.1 PGSQL edition.
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Centos 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
I can't get DKIM to generate properly.
dig -t txt dkim._domainkey.prospectid.com
; <<>> DiG 9.11.26-RedHat-9.11.26-4.el8_4 <<>> -t txt dkim._domainkey.mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17862
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;dkim._domainkey.mydomain.com. IN TXT
;; ANSWER SECTION:
dkim._domainkey.mydomain.com. 600 IN TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCG26OM/bk0vNm/TM2DnOQjPZNLIWspF4xtIX12LGHHjfushjsaudfysuf+DUigzM6h2oJMEdNt1S/CWVXW0pUBqfU0fzdw90+jyqOduh4cCnEk0z0w1w1j4xOYy0FLHhKoeoZJwWQFtwrlhrjxD6jM+sGeeRnbn2rQIDAQAB"
;; Query time: 106 msec
;; SERVER: 50.116.62.5#53(50.116.62.5)
;; WHEN: Mon Sep 13 12:43:24 UTC 2021
;; MSG SIZE rcvd: 289
amavisd -c /etc/amavisd/amavisd.conf testkeys
TESTING#1 mydomain.com: dkim._domainkey.mydomain.com => invalid (public key: OpenSSL error: bad base64 decode)
openssl version
OpenSSL 1.1.1g FIPS 21 Apr 2020
amavisd genrsa /var/lib/dkim/mydomain.com.pem
Private RSA key successfully written to file "/var/lib/dkim/mydomain.com.pem" (1024 bits, PEM format)
amavisd -c /etc/amavisd/amavisd.conf showkeys
; key#1 1024 bits, s=dkim, d=mydomain.com, /var/lib/dkim/mydomain.com.pem
dkim._domainkey.mydomain.com. 3600 TXT (
"v=DKIM1; p="
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCleGTk61JYko700zqmuqrDvmfM"
"Rgy27PKwHcfX8ICDtrPWn2XA7jWLpMJHZWu/Jv4Sd7TCQ1fMaZl0sX61h9lCY03P"
"MFiYO58cozOVn2pBafyV3Qvet+vh9GjpSfufY9XEcEZKRankLk1nrgjC2chXPXj0"
"x6ljq1GHUXvBKBhI9wIDAQAB")
amavisd -c /etc/amavisd/amavisd.conf testkeys
TESTING#1 mydomain.com: dkim._domainkey.mydomain.com => invalid (public key: OpenSSL error: bad base64 decode)
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.