sortmail: 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 Debian possible default full paths are:

/usr/bin/sortmail - from package: sortmail

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