Question

-bash: sendmail: command not found

Posted July 30, 2014 23.6k views

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?

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.

2 answers

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
  • Oh ok. Those other commands don’t work for me either though (including apt-file).

    But PHP’s mail function seems to be working now so I guess sendmail is installed and working properly.

    Thanks!

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"

  • When I entered which sendmail it returned /usr/sbin/sendmail for me as well.

    And when I entered sudo find / -name "sendmail":

    # sudo find / -name "sendmail"
    /usr/share/doc/sendmail
    /usr/share/sendmail
    /usr/share/sendmail/examples/resolvconf/update-libc.d/sendmail
    /usr/share/sendmail/examples/dhcp/dhclient-exit-hooks.d/sendmail
    /usr/share/sendmail/examples/logcheck/ignore.d.server/sendmail
    /usr/share/sendmail/examples/logcheck/ignore.d.paranoid/sendmail
    /usr/share/sendmail/examples/logcheck/ignore.d.workstation/sendmail
    /usr/share/sendmail/examples/ppp/ip-down.d/sendmail
    /usr/share/sendmail/examples/ppp/ip-up.d/sendmail
    /usr/share/sendmail/examples/network/if-post-down.d/sendmail
    /usr/share/sendmail/examples/network/if-down.d/sendmail
    /usr/share/sendmail/examples/network/if-up.d/sendmail
    /usr/share/sendmail/sendmail
    /usr/share/bug/sendmail
    /usr/sbin/sendmail
    /usr/lib/sm.bin/sendmail
    /usr/lib/sendmail
    /run/sendmail
    /var/lib/sendmail
    /etc/resolvconf/update-libc.d/sendmail
    /etc/cron.daily/sendmail
    /etc/init.d/sendmail
    /etc/dhcp/dhclient-exit-hooks.d/sendmail
    /etc/logcheck/ignore.d.server/sendmail
    /etc/logcheck/ignore.d.paranoid/sendmail
    /etc/logcheck/ignore.d.workstation/sendmail
    /etc/alternatives/sendmail
    /etc/ppp/ip-down.d/sendmail
    /etc/ppp/ip-up.d/sendmail
    /etc/cron.d/sendmail
    /etc/network/if-post-down.d/sendmail
    /etc/network/if-down.d/sendmail
    /etc/network/if-up.d/sendmail
    

    PHP’s mail function seems to be working now so I guess sendmail is installed and working properly.

    Thanks!

Submit an Answer