Sendmail – How to Install Sendmail Client Only Without MTA

email-serversendmailsmtp

Is there any way to install the sendmail client, only, without installing the sendmail MTA at all?

What I mean by this is the sendmail -t command that is frequently used by processes such as cron to submit outgoing email. Most such programs expect some kind of sendmail API compatible program called sendmail to which they can send their outgoing mail.

Currently on my mail server, I don't have any sendmail binary, and as such I see things like this in cron:

(CRON) info (No MTA installed, discarding output)

Actually, I do have an MTA installed – one that I wrote myself (so not Postfix, exim, etc.) – but I don't have any sendmail program written to interface to that. I'm wondering if it's possible to install and use the sendmail program in isolation to just receive anything given to it and then open an SMTP connection localhost:25 and feed that into the MTA using an SMTP transaction. This way, I don't need to write my own sendmail program that has the same interface to do that.

Is this possible? I would assume something like this already exists, so I don't want to reinvent the wheel. Default installation of sendmail also installs the sendmail MTA, which I don't want; I don't want to install any MTA package that would clobber or interfere with the real MTA already on the system.

In the research I've done, there seems to be very little separation between the two. All the tutorials seem to assume you're using one of the "standard" MTAs. If the answer is "no", then equivalently is there documentation on the full sendmail binary API that needs to be implemented for program compatibility?

Best Answer

Option 1: Install (simple) "sendmail look alike"
As I understand you can use ssmtp (or msmtp) program/package to get "sendmail look alike" capable to pass messages to SMTP server (e.g. localhost:25).

https://wiki.archlinux.org/title/SSMTP
https://packages.debian.org/source/stable/ssmtp

Option 2: Use sendmail without starting sendmail daemon
Install sendmail package but block starting sendmail daemon. Modern sendmail installations by default pass messages submitted by sendmail command via SMTP to localhost:25.
[It has been introduced to avoid security risks of installing sendmail as set root uid]

Related Topic