Hands-on Lab·LPIC-2
An MTA that accepts, and one that refuses
Objective 211.1 is running an MTA. This guide installs Postfix, sets the two parameters that decide who it serves, and then proves both halves of its policy from a second machine: mail addressed to this server is accepted and delivered to a real mailbox, and mail addressed through it to a stranger is refused at RCPT time.
202: E-Mail Services Guide 20 of 29 Intermediate
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- Block devicesone 50 GB disk
- TimeAbout 24 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC2-A01 | 192.168.0.78 | Ubuntu 26.04 LTS | Primary service host - BIND, Apache, Samba, Postfix. Topic 204 RAID runs on loop devices; this machine has no spare disk | 2 Core | 4 GB | 50 GB |
| LPIC2-C01 | 192.168.0.80 | Ubuntu 26.04 LTS | Client - resolves, mounts and connects, so every service is proven from a machine that is not running it | 2 Core | 4 GB | 50 GB |
This guide includes
Use this the first time you are handed a mail server, or the first time a monitoring box, a printer or an application cannot send its notifications. This matters because accepting mail FOR a domain and relaying mail THROUGH the server are different permissions, and confusing them is what creates an open relay.
- installing Postfix non-interactively and confirming it is listening on port 25
- setting
mydestination,mynetworksandsmtpd_recipient_restrictions, then reading the policy back withpostconf - sending real mail from a second machine with
swaksand following both sides of the SMTP dialogue - proving delivery three ways - an empty queue, an mbox on disk, and
relay=localin the maillog - watching a relay attempt refused at
RCPT TOwith454 4.7.1, and finding the matchingNOQUEUE: rejecton the server
Before you start
- what-stands-between-a-service-and-its-client
-
An MTA, and the two settings that decide who it serves
-
Reading the policy back before testing it
-
The banner, from a machine that is not the server
-
Mail FOR this server is accepted
-
Proving it arrived
-
Mail THROUGH this server is refused