sortmail command not found

In this troubleshooting guide we learn how to fix sortmail command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

sortmail: command not found

or when using sudo you get the following error message

sudo: sortmail: command not found

Solutions to sortmail: command not found

How To Fix sortmail: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu sortmail is provided by sortmail package.

sortmail is:

Sortmail is a simple mail sorter you can use in your .forward to sort your mail into folders automatically, delete unwanted mail, etc.

Sortmail process incoming email, classify it, and process it accordingly. Sortmail can handle incoming email as it arrives, or download from a POP server. Sortmail is easier to configure than procmail, and can replace fetchmail. Sortmail uses config files which are similar to rn KILLfiles.

Full features list:

  • Process email delivered via SMPT, or downloaded via POP or IMAP.
  • Post-process an existing mail folder.
  • Select messages based on specific header lines, based on the entire header, or even the message body.
  • File messages to folders, send to inbox, forward to other email addresses, append to digest, pipe through shell command or just junk them.
  • Regular expression matching or IP address range matching.
  • Full boolean expressions of any complexity.
  • Basic mailing-list processing functionality.

To fix this problem, we can install more using the command below.

sudo apt-get -y install sortmail

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install sortmail.

sudo apt -y install sortmail

Or if you have aptitude installed you can use the following command.

sudo aptitude install sortmail

Summary

In this tutorial we learn how to fix sortmail command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.