Question

-bash: sendmail: command not found

I installed sendmail:

$ sudo apt-get install sendmail
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  procmail sensible-mda
Suggested packages:
  sendmail-doc rmail
The following NEW packages will be installed:
  procmail sendmail sensible-mda
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 587 kB of archives.
After this operation, 805 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.digitalocean.com/debian/ wheezy/main procmail i386 3.22-20 [154 kB]
Get:2 http://mirrors.digitalocean.com/debian/ wheezy/main sensible-mda i386 8.14.4-4 [218 kB]
Get:3 http://mirrors.digitalocean.com/debian/ wheezy/main sendmail all 8.14.4-4 [215 kB]
Fetched 587 kB in 0s (779 kB/s)
Selecting previously unselected package procmail.
(Reading database ... 30414 files and directories currently installed.)
Unpacking procmail (from .../procmail_3.22-20_i386.deb) ...
Selecting previously unselected package sensible-mda.
Unpacking sensible-mda (from .../sensible-mda_8.14.4-4_i386.deb) ...
Selecting previously unselected package sendmail.
Unpacking sendmail (from .../sendmail_8.14.4-4_all.deb) ...
Processing triggers for man-db ...
Setting up procmail (3.22-20) ...
Setting up sensible-mda (8.14.4-4) ...
Setting up sendmail (8.14.4-4) ...

But when I type “sendmail” it says the command isn’t found. Did I install sendmail properly? If I did, why is it saying the command isn’t found?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Somewhat confusingly, the sendmail package doesn’t actually provide the /usr/sbin/sendmail command.

# apt-file search /usr/sbin/sendmail
citadel-mta: /usr/sbin/sendmail
courier-mta: /usr/sbin/sendmail
esmtp-run: /usr/sbin/sendmail
exim4-daemon-heavy: /usr/sbin/sendmail
exim4-daemon-light: /usr/sbin/sendmail
lsb-invalid-mta: /usr/sbin/sendmail
masqmail: /usr/sbin/sendmail
msmtp-mta: /usr/sbin/sendmail
nullmailer: /usr/sbin/sendmail
postfix: /usr/sbin/sendmail
qmail-run: /usr/sbin/sendmail
sendmail-base: /usr/sbin/sendmailconfig
ssmtp: /usr/sbin/sendmail
xmail: /usr/sbin/sendmail

That’s how I’ve installed it!

When I type the command which sendmail I get the following /usr/sbin/sendmail

What do you get if you write the command sudo find / -name "sendmail"