📦 Building a Mail Server on Linux #2: Essential Packages for Virtual User Environment

Hello, did you remember our last post where we talked about why Postfix and Dovecot are needed together?

To make it easy for beginners, I used the analogy of a post office and a mailman. Do you recall that? 😊

Postfix acts like the "post office" that sends the mail,

Dovecot functions like the "mailman" who delivers the user's mail.

If you haven't read the previous post, I recommend checking it out first.

📌 Building a Mail Server on Linux #1: Understanding the Concepts of Postfix and Dovecot

🎯 The Goal of This Post

In this post, we will explore the essential packages needed to set up Postfix and Dovecot in a virtual user environment.

That is, I will explain step by step which packages to install and what roles each one plays.

💡 Note:

This article is a guide for those who already have their own database (DB).

While a DB is required to build a mail server in a virtual user environment,

I will not cover the configuration methods for the DB itself.

(In other words, I will assume that you already have MySQL, PostgreSQL, SQLite, etc. running!)

📌 Essential Packages Required for Virtual User Environment

In a virtual user environment, system accounts (/etc/passwd) are not used,

and Postfix and Dovecot refer to the user information stored in the database (DB).

Let’s examine the packages that must be installed one by one.

1️⃣ Postfix (MTA, Mail Transfer Agent)

📦 Package to install:

postfix
postfix-pgsql  # for PostgreSQL integration (MySQL users should use postfix-mysql)

2️⃣ Dovecot (MDA, Mail Delivery Agent)

📦 Package to install:

dovecot-core
dovecot-imapd
dovecot-pop3d
dovecot-pgsql  # for PostgreSQL integration (MySQL users should use dovecot-mysql)

3️⃣ Dovecot LMTP (Communication Between Postfix and Dovecot)

📦 Package to install:

dovecot-lmtpd

4️⃣ TLS and Security Related Packages

📦 Package to install:

openssl
certbot  # Free SSL certificate issuance

✅ Final Summary: Essential & Optional Packages

📌 Essential Packages

PackageDescription
postfixSMTP Server
postfix-pgsqlPostgreSQL integration (MySQL users should use postfix-mysql)
dovecot-coreDovecot Mail Server
dovecot-imapdIMAP support
dovecot-pop3dPOP3 support
dovecot-pgsqlPostgreSQL integration (MySQL users should use dovecot-mysql)
dovecot-lmtpdLMTP support
opensslTLS encryption support
certbotFree SSL certificate issuance

🔹 Optional Packages

PackageDescription
postfixadminWeb-based mail account management
spamassassinSpam filtering
spamcSpamAssassin client
clamavVirus scanning
clamav-daemonReal-time virus detection
clamav-freshclamAutomatic updates of ClamAV virus database
roundcubeWebmail client

🚀 Next Steps

Now that we have organized the necessary packages, in the next post, we will proceed with the actual configuration of Postfix and Dovecot.

✔️ How Postfix and Dovecot interact with each other

✔️ The email delivery method using LMTP (Local Mail Transfer Protocol)

Stay tuned for the next post! 😊