How To Install rsendmail on Debian 12

Learn how to install rsendmail on Debian 12 with this tutorial. rsendmail is email delivery over SSH and restricted sendmail

Introduction

In this tutorial we learn how to install rsendmail on Debian 12.

What is rsendmail

rsendmail is:

This command aims at replacing the builtin sendmail command which gives too much privileges to the caller. For example, Postfix’s sendmail(1) command can list the mail queue (-bp), rehash the alias database (-bi), start a daemon (-bl, -bd), or flush the queue (-q); all remnants of the old Sendmail binary, which probably is Turing-complete on its own.

Instead, rsendmail can easily queue mails on a system without giving any extra privileges to the client. In turn, this makes configuring a satellite system like a laptop or a workstation as simple as adding an SSH key to an authorized_keys file. That key can then send email, but only send email: no shell access or server management.

This can of course be accomplished by a regular SMTP client, but that requires passwords, and passwords are weak.

There are three methods to install rsendmail on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install rsendmail Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install rsendmail using apt-get by running the following command:

sudo apt-get -y install rsendmail

Install rsendmail Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install rsendmail using apt by running the following command:

sudo apt -y install rsendmail

Install rsendmail Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install rsendmail using aptitude by running the following command:

sudo aptitude -y install rsendmail

How To Uninstall rsendmail on Debian 12

To uninstall only the rsendmail package we can use the following command:

sudo apt-get remove rsendmail

Uninstall rsendmail And Its Dependencies

To uninstall rsendmail and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove rsendmail

Remove rsendmail Configurations and Data

To remove rsendmail configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge rsendmail

Remove rsendmail configuration, data, and all of its dependencies

We can use the following command to remove rsendmail configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge rsendmail

Dependencies

rsendmail have the following dependencies:

References

Summary

In this tutorial we learn how to install rsendmail package on Debian 12 using different package management tools: apt, apt-get and aptitude.