How to Install OpenSMTPD on Debian Latest

OpenSMTPD is an open-source and lightweight mail transfer agent that is easy to configure and use. In this tutorial, we will go through the steps to install OpenSMTPD on Debian latest.

Prerequisites

First, make sure that you have a Debian latest machine ready with sudo access.

Step 1: Update the Packages

Before installing any new packages, update the existing packages using the following command:

sudo apt-get update

Step 2: Install OpenSMTPD

The OpenSMTPD package is available in the official Debian repository. You can install it using the following command:

sudo apt-get install opensmtpd

The above command will install the latest version of OpenSMTPD and its dependencies.

Step 3: Configure OpenSMTPD

After the installation, the OpenSMTPD service is not automatically started. To start it, use the following command:

sudo systemctl start opensmtpd

To ensure that it starts automatically during boot time:

sudo systemctl enable opensmtpd

By default, OpenSMTPD listens on port 25 for incoming SMTP traffic. You can verify this by running the following command:

sudo ss -tulpn | grep opensmtpd

Step 4: Test OpenSMTPD

You can test OpenSMTPD by sending an email to a valid email address using the following command:

echo "This is a test email." | mail -s "Test Email" destination@example.com

Replace destination@example.com with the actual email address that you want to send the test email to.

Conclusion

In this tutorial, you learned how to install and configure OpenSMTPD on Debian latest. You can now use OpenSMTPD to send and receive emails on your Debian machine.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!