How To Install opensmtpd on CentOS 8

opensmtpd is Free implementation of the server-side SMTP protocol as defined by RFC 5321

Introduction

In this tutorial we learn how to install opensmtpd on CentOS 8.

What is opensmtpd

OpenSMTPD is a FREE implementation of the server-side SMTP protocol as defined by RFC 5321, with some additional standard extensions. It allows ordinary machines to exchange e-mails with other systems speaking the SMTP protocol. Started out of dissatisfaction with other implementations, OpenSMTPD nowadays is a fairly complete SMTP implementation. OpenSMTPD is primarily developed by Gilles Chehade, Eric Faurot and Charles Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is part of the OpenBSD Project. The software is freely usable and re-usable by everyone under an ISC license. This package uses standard “alternatives” mechanism, you may call “/usr/sbin/alternatives –set mta /usr/sbin/sendmail.opensmtpd” if you want to switch to OpenSMTPD MTA immediately after install, and “/usr/sbin/alternatives –set mta /usr/sbin/sendmail.sendmail” to revert back to Sendmail as a default mail daemon.

We can use yum or dnf to install opensmtpd on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install opensmtpd.

Install opensmtpd on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install opensmtpd using dnf by running the following command:

sudo dnf -y install opensmtpd

Install opensmtpd on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install opensmtpd using yum by running the following command:

sudo yum -y install opensmtpd

How To Uninstall opensmtpd on CentOS 8

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

sudo dnf remove opensmtpd

opensmtpd Package Contents on CentOS 8

/etc/opensmtpd
/etc/opensmtpd/smtpd.conf
/etc/pam.d/smtp
/etc/pam.d/smtp.opensmtpd
/usr/bin/mailq
/usr/bin/mailq.opensmtpd
/usr/bin/newaliases
/usr/bin/newaliases.opensmtpd
/usr/bin/smtp
/usr/lib/.build-id
/usr/lib/.build-id/2d
/usr/lib/.build-id/2d/52a5688a0148f560b25ea582f6835665c46871
/usr/lib/.build-id/39
/usr/lib/.build-id/39/c376751ec8de8a644b0a91267430f21db128bb
/usr/lib/.build-id/59
/usr/lib/.build-id/59/9c7b62655308be3142a2808ad550cbdc133695
/usr/lib/.build-id/95
/usr/lib/.build-id/95/718d7fa3872c0c40ccb0c2d0036736aa3ac06f
/usr/lib/.build-id/a7
/usr/lib/.build-id/a7/58b58b657f9e0754b7a03f072ad4c73fdeb037
/usr/lib/.build-id/ae
/usr/lib/.build-id/ae/f4828c163dd059477a0e8b8a3810aee78aa3eb
/usr/lib/.build-id/af
/usr/lib/.build-id/af/b083da036eadde02720be703d8bcc7276a9579
/usr/lib/.build-id/be
/usr/lib/.build-id/be/9db6b253a4b9dbfa8219c2416b2f7c26960e08
/usr/lib/.build-id/d3
/usr/lib/.build-id/d3/196898655efab93c6fedc34b1b8f86e1524d03
/usr/lib/.build-id/da
/usr/lib/.build-id/da/46ebf9583eebc3bdd1749f451d13e4a9a8b8fe
/usr/lib/sendmail
/usr/lib/systemd/system/opensmtpd.service
/usr/libexec/opensmtpd
/usr/libexec/opensmtpd/encrypt
/usr/libexec/opensmtpd/lockspool
/usr/libexec/opensmtpd/mail.lmtp
/usr/libexec/opensmtpd/mail.local
/usr/libexec/opensmtpd/mail.maildir
/usr/libexec/opensmtpd/mail.mboxfile
/usr/libexec/opensmtpd/mail.mda
/usr/sbin/makemap
/usr/sbin/makemap.opensmtpd
/usr/sbin/sendmail
/usr/sbin/sendmail.opensmtpd
/usr/sbin/smtpctl
/usr/sbin/smtpd
/usr/share/doc/opensmtpd
/usr/share/doc/opensmtpd/CHANGES.md
/usr/share/doc/opensmtpd/README.md
/usr/share/licenses/opensmtpd
/usr/share/licenses/opensmtpd/LICENSE
/usr/share/man/man1/mailq.1.gz
/usr/share/man/man1/mailq.opensmtpd.1.gz
/usr/share/man/man1/newaliases.1.gz
/usr/share/man/man1/smtp.opensmtpd.1.gz
/usr/share/man/man5/aliases.5.gz
/usr/share/man/man5/aliases.opensmtpd.5.gz
/usr/share/man/man5/forward.5.gz
/usr/share/man/man5/smtpd.conf.5.gz
/usr/share/man/man5/table.5.gz
/usr/share/man/man8/makemap.8.gz
/usr/share/man/man8/makemap.opensmtpd.8.gz
/usr/share/man/man8/newaliases.opensmtpd.8.gz
/usr/share/man/man8/sendmail.8.gz
/usr/share/man/man8/sendmail.opensmtpd.8.gz
/usr/share/man/man8/smtp.8.gz
/usr/share/man/man8/smtp.opensmtpd.8.gz
/usr/share/man/man8/smtpctl.8.gz
/usr/share/man/man8/smtpd.8.gz
/usr/share/man/man8/smtpd.opensmtpd.8.gz
/var/empty/smtpd

References

Summary

In this tutorial we learn how to install opensmtpd on CentOS 8 using yum and dnf.