14.Linux Postfix Mail Server

Published: (March 15, 2026 at 10:19 AM EDT)
2 min read
Source: Dev.to

Source: Dev.to

Lab Information

xFusionCorp Industries plans to set up a common email server in Stork DC. After several meetings and recommendations they have decided to use Postfix as their mail transfer agent and Dovecot as an IMAP/POP3 server. The tasks are:

  1. Install and configure Postfix on the Stork DC mail server.
  2. Create an email account anita@stratos.xfusioncorp.com with the password LQfKeWWxWD.
  3. Set its mail directory to /home/anita/Maildir.
  4. Install and configure Dovecot on the same server.

Lab Solutions

Part 1: Lab Step‑by‑Step Guidelines

Objective

On the mail server (stmail01):

  • Install Postfix
  • Create email user anita
  • Configure mailbox location
  • Install and configure Dovecot

Server Access

# 1️⃣ Login to Jump Host
ssh thor@jump_host.stratos.xfusioncorp.com
# Password: mjolnir123

# 2️⃣ Connect to Mail Server
ssh groot@stmail01
# Password: Gr00T123

# 3️⃣ Switch to root
sudo -i

Install Postfix

yum install -y postfix
systemctl start postfix
systemctl enable postfix

Create User anita

useradd anita
passwd anita
# Enter password: LQfKeWWxWD

Create Mail Directory

mkdir -p /home/anita/Maildir
chown -R anita:anita /home/anita/Maildir

Configure Postfix Mailbox Location

Edit /etc/postfix/main.cf and add the line:

home_mailbox = Maildir/

Save and exit, then restart Postfix:

systemctl restart postfix

Install Dovecot

yum install -y dovecot

Configure Dovecot Mail Location

Edit /etc/dovecot/conf.d/10-mail.conf and set:

mail_location = maildir:~/Maildir

Save and exit.

Start and Enable Dovecot

systemctl start dovecot
systemctl enable dovecot

Verify Services

systemctl status postfix
systemctl status dovecot

Both should show active (running).

Part 2: Simple Explanation (Beginner Friendly)

What this lab builds

You are setting up a basic Linux mail server with two main components:

ComponentPurpose
PostfixMail Transfer Agent (receives and delivers mail)
DovecotIMAP/POP3 server (allows users to read mail)

Mail Flow Example

User sends mail → Postfix delivers to mailbox → Dovecot provides access via IMAP/POP3.

Mail Storage Format

FormatDescription
MaildirPreferred because it is faster, safer, and better for concurrent access

The mailbox for user anita is located at:

/home/anita/Maildir

Postfix stores incoming mail in the Maildir/ folder (e.g., /home/anita/Maildir/new). Dovecot reads from this location to serve the user’s email.

0 views
Back to Blog

Related posts

Read more »

Travigo

Travel as fast as you speak with Gemini! Where live agents meet immersive storytelling & 3D navigation. This project was created for entering the Gemini Live Ag...

Micro games

Hey Gamers! 👾 As part of the Rapid Games Prototyping module, we are tasked with reviewing a peer's game. The challenge is to analyse a prototype built in just...