opendkim-testmsg: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/sbin/opendkim-testmsg - from package: opendkim

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/opendkim-testmsg - from package: opendkim-tools

You may install the required package with command apt-get install {package}
Error in other languages:
opendkim-testmsg: bevel nie gevind nie
opendkim-testmsg: comandă negăsită
opendkim-testmsg: comando não encontrado
opendkim-testmsg: commande introuvable
opendkim-testmsg: command not found
opendkim-testmsg: käsku ei ole
opendkim-testmsg: không tìm thấy lệnh
opendkim-testmsg: komanda nerasta
opendkim-testmsg: Kommando nicht gefunden.
opendkim-testmsg: kommandot finns inte
opendkim-testmsg: komut yok
opendkim-testmsg: nie znaleziono polecenia
opendkim-testmsg: níor aimsíodh an t-ordú
opendkim-testmsg: no se encontró la orden
opendkim-testmsg: no s'ha trobat l'ordre
opendkim-testmsg: opdracht niet gevonden
opendkim-testmsg: parancs nem található
opendkim-testmsg: perintah tidak ditemukan
opendkim-testmsg: príkaz nenájdený
opendkim-testmsg: příkaz nenalezen
opendkim-testmsg: команда не найдена
opendkim-testmsg: командата не е открита
opendkim-testmsg: 命令找不到
opendkim-testmsg: コマンドが見つかりません