"/usr/sbin/sendmail/" Not found

EmailUbuntu

Email Problem Overview


Locally a Rail app works well, but on a VPS server when I try to send an email with all the correct settings by the means of the Rails app, I get this error in the logs:

sh: 1: /usr/sbin/sendmail: not found

How to fix it?

Email Solutions


Solution 1 - Email

You need to install the sendmail package on your VPS as well as your local machine. Assuming you use some form of Debian linux, you want to run:

sudo apt-get install sendmail

on the VPS.

Solution 2 - Email

You need to install a Mail Transport Agent (MTA).

First, let's install postfix, which provides a /usr/bin/sendmail:

apt-get update
apt-get install postfix

A configuration screen will pop up, where you need to enter some configuration values. This really depends on your setup. The standard installation is "Internet site", where mail will be sent directly from your server. You can also configure it to relay mail through an external mailserver, which may be preferable if you don't want to deal with SPF, TLS, reverse DNS, etc. But the specifics of the configuration is outside the scope of this question (just Google it, or post a new question if you get stuck).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser266003View Question on Stackoverflow
Solution 1 - EmailTechnoguyficationView Answer on Stackoverflow
Solution 2 - EmailWillView Answer on Stackoverflow