1

Topic: DKIM not working

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: debian 9.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? nope
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
root@mx:~# amavisd-new testkeys
TESTING#1 mail.example.com: dkim._domainkey.mail.example.com => invalid (public key: not available)
root@mx:~# dig -t txt dkim._domainkey.mail.example.com

; <<>> DiG 9.10.3-P4-Debian <<>> -t txt dkim._domainkey.mail.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 21802
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;dkim._domainkey.mail.example.com.  IN      TXT

;; AUTHORITY SECTION:
example.com.                299     IN      SOA     ns0.transip.net. hostmaster.transip.nl. 2018072603 14400 1800 2419200 300

;; Query time: 29 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Jul 25 19:53:11 EDT 2018
;; MSG SIZE  rcvd: 127

root@mx:~#
root@mx:~# nslookup -type=txt mail._domainkey.mail.example.com
Server:         8.8.8.8
Address:        8.8.8.8#53

** server can't find mail._domainkey.mail.iqfx.nl: NXDOMAIN
-----------------------------------------------------------------------------------
Hi there, so i have got a fresh install of the latest version of IRedMail and i followed the documentation accordingly.

The issue is that my DKIM record does not work as shown in the logs. Keep in mind that this is on an external DNS provider.
So i am NOT running a local dns server.

i think i have all the records in place so i am going to put them in order:
   A mail.example.com <external ip address>
   MX 0 mail.example.com.
   MX 10 mail.example.com.
   TXT v=DKIM1; p=(public key smile
   TXT v=spf1 a mx -all

all of the records have an @ name. (this might be an issue but even after changing it according to the documentation it still didn't work)

I have googled all the way up untill page 2 of google with no luck, thus here i am making this forum post.

I am fairly certain my records are the problem here, but if someone knows the correct way to go about this please let me know, all help is appreciated. I will try my best to supply with as much needed information as possible.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: DKIM not working

iqfx wrote:

root@mx:~# dig -t txt dkim._domainkey.mail.example.com

If your mail domain name is "@example.com" instead of "@mail.example.com", the DKIM DNS record should be: dkim._domainkey.example.com.

3

Re: DKIM not working

Hello, is there any python command that I can generate the DKIM and its keys alone? One last question: Is there a documentation that shows you how to create users through command line?

4

Re: DKIM not working

ZhangHuangbin wrote:
iqfx wrote:

root@mx:~# dig -t txt dkim._domainkey.mail.example.com

If your mail domain name is "@example.com" instead of "@mail.example.com", the DKIM DNS record should be: dkim._domainkey.example.com.

my mail domain is mail.example.com, i have no clue on what could be configured incorrectly.
if i had to guess i would still go for my DNS being setup incorrectly. if you need more details just let me know.
the check results are to this day the same.
my DKIM record goes as follows:

name                                                     TTL          Type
dkim._domainkey.mail.example.com     1 hour      TXT

value:
v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBA...

5

Re: DKIM not working

ZhangHuangbin wrote:
iqfx wrote:

root@mx:~# dig -t txt dkim._domainkey.mail.example.com

If your mail domain name is "@example.com" instead of "@mail.example.com", the DKIM DNS record should be: dkim._domainkey.example.com.

I managed to fix it.

The cause was my mis understanding of DNS records.

the name is supposed to be: dkim._domainkey.mail
and what i did was: dkim._domainkey.mail.example.com
'
anyone who reads is allowed to make fun of me haha tongue

But anyhow, thank you Zhan for the reply & help you provided smile