I am trying to setup my second mail server from scratch and writing a howto based on the Debian howto by linuxbabe. I've managed to get everything working up the opendkim and I have even managed to get opendkim to sign the emails. It all works but opendkim-testkey still stays it's not secure. I used postfix and dovecot from ports but everything else from packages. I have tried both opendkim and opendkim-devel and and now on the devel version. I know it's not required to be secure but wondering why it isn't? I ran the exact same command on the Debian machine I put up for the test run and it says secure. Since I am writing a howto and probably will scrap the first install I am not trying to keep the server id secret. Tried fixing file permissions and dnssec with unbound. I am using unbound not local_unbound.
My write up so far is at ...
On FreeBSD /etc/rc.conf
For this section of the howto I have installed... though I am not sure why or how to use ca_root_nss, I read some post that said it was needed
The other cause mentioned is that the keys are not secure and only readable by opendkim
So the files are only readable by opendkim user.
As I mentioned milter-opendkim starts and appends the DKIM signature to outgoing mail, just wonder why the testkey shows not secure?
Any help is much appreciated.
My write up so far is at ...
Code:
VERSION="14.2-RELEASE"
@mx.okfigs.com:~# opendkim-testkey -d okbsd.com -s CRHdAnOqqitUaWRuNkHLdIpbgw76 -vvv
opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: checking key 'CRHdAnOqqitUaWRuNkHLdIpbgw76._domainkey.okbsd.com'
opendkim-testkey: key secure
opendkim-testkey: key OK
Code:
milteropendkim_enable="YES"
milteropendkim_cfgfile="/usr/local/etc/opendkim/opendkim.conf"
milteropendkim_uid="opendkim"
milteropendkim_gid="opendkim"
milteropendkim_socket="local:/var/spool/postfix/opendkim/opendkim.sock"
milteropendkim_socket_perms="0770"
Code:
@okbsd.com:/usr/local/etc/opendkim# opendkim-testkey -d okbsd.com -s CRHdAnOqqitUaWRuNkHLdIpbgw76 -vvv
opendkim-testkey: checking key 'CRHdAnOqqitUaWRuNkHLdIpbgw76._domainkey.okbsd.com'
opendkim-testkey: key not secure
opendkim-testkey: key OK
@okbsd.com:/usr/local/etc/unbound# dig @127.0.0.1 okbsd.com a +dnssec
; <<>> DiG 9.20.8 <<>> @127.0.0.1 okbsd.com a +dnssec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64347
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
;; QUESTION SECTION:
;okbsd.com. IN A
;; ANSWER SECTION:
okbsd.com. 600 IN A 147.135.65.97
okbsd.com. 600 IN RRSIG A 13 2 1799 20250522000000 20250501000000 4723 okbsd.com. wlDSZXSfAsshstsmxdC1+U8yZL4B3ie1I7e/C3JrHAkJGVs/buUsCZMk ia11WySoKsC4F1ShW4pz/LGrBMF+0g==
;; Query time: 201 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Wed May 14 14:47:41 PDT 2025
;; MSG SIZE rcvd: 159
Code:
pkg install py311-spf-engine
pkg install ca_root_nss
pkg install chrony
pkg install opendkim
Code:
grep opendkim /etc/passwd /etc/group
/etc/passwd opendkim:*:118:118:User &:/var/run/opendkim:/usr/sbin/nologin
/etc/group opendkim:*:118: postfix
@okbsd.com:/usr/local/etc# ls -ld opendkim
drwxr-xr-x 3 root wheel 11 May 13 16:37 opendkim/
@okbsd.com:/usr/local/etc/opendkim# ls -l
total 53
-rw-r--r-- 1 root wheel 3 May 13 15:07 bodylengthdb.cfg
drwx------ 3 opendkim opendkim 3 May 13 16:37 keys/
-rw-r--r-- 1 root wheel 165 May 13 16:48 keytable
-rw-r--r-- 1 root wheel 3329 May 13 15:10 opendkim.conf
-rw-r--r-- 1 root wheel 22671 May 13 12:26 opendkim.conf.bak
-rw-r--r-- 1 root wheel 22671 May 13 12:26 opendkim.conf.bak2
-rw-r--r-- 1 root wheel 21800 Apr 16 23:21 opendkim.conf.sample
-rw-r--r-- 1 root wheel 209 May 13 15:07 signingtable
-rw-r--r-- 1 root wheel 48 May 13 15:07 trustedhosts
@okbsd.com:/usr/local/etc/opendkim/keys# ls -l
total 1
drwx------ 2 opendkim opendkim 4 May 13 15:07 okbsd.com/
ls -l keys
-rw------- 1 opendkim opendkim 1704 May 13 15:07 CRHdAnOqqitUaWRuNkHLdIpbgw76.private
-rw------- 1 opendkim opendkim 537 May 13 15:07 CRHdAnOqqitUaWRuNkHLdIpbgw76.txt
As I mentioned milter-opendkim starts and appends the DKIM signature to outgoing mail, just wonder why the testkey shows not secure?
Any help is much appreciated.
Last edited by a moderator: