Scenario
Ops wants all root mail forwarded to two
addresses. There is also a queued message that needs
inspection to confirm what is being sent and why it is stuck.
Root mail often contains cron output, service alerts, and local security notices. If it is not forwarded correctly, incidents get missed. Queue inspection is a core workflow for diagnosing outbound mail failures.
Objective
-
Edit
/etc/aliasesto forwardrootto two recipients. -
Rebuild the aliases database with
newaliases. - Confirm Postfix is active.
-
Inspect the queue with
mailq(orpostqueue -p). -
View a queued message with
postcat -q. -
Confirm time zone state using
timedatectl. - Confirm the chrony config path exists.
-
Pull kernel messages from journald with
journalctl -k. - Verify the alias line exists after edits.
Concepts
-
Local alias rewriting with
/etc/aliasesand the compiled database used by Postfix. -
Service state triage with
systemctl is-activebefore queue work. -
Queue inspection and message IDs using
mailq/postqueue -p. -
Safe message inspection with
postcat -q(read-only view of queued content). -
Time and timezone evidence collection using
timedatectland configuration path confirmation. -
Kernel and service context via
journalctl -koutput.
Walkthrough
sudo vim /etc/aliases
Add or update the
root
alias so messages are forwarded to both recipients.
root: admin@example.com, webmaster@example.com
Editing the file alone does not apply the change. Postfix uses the compiled aliases database.
sudo newaliases
This compiles
/etc/aliases
into the database file Postfix actually reads.
/etc/aliases: 86 aliases, longest 52 bytes, 948 bytes total
systemctl is-active postfix
You want a clean
active
signal before spending time on queue analysis.
active
mailq
Identify stuck messages, note the queue ID, and capture sender and recipient fields for evidence.
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
A1B2C3D4E5* 1468 Sun Jan 25 07:10:41 root@lab141
admin@example.com
-- 2 Kbytes in 1 Request.
If you prefer the native Postfix view, use
postqueue -p. The queue ID is what matters for the next step.
sudo postcat -q A1B2C3D4E5
postcat -q
lets you inspect what is in the queue without attempting
delivery. This is useful for confirming headers, recipients,
and subject line during triage.
*** ENVELOPE RECORDS active ***
message_size: 1468
message_arrival_time: Sun Jan 25 07:10:41 2026
sender: root@lab141
recipient: admin@example.com
*** MESSAGE CONTENTS active ***
Subject: RHCSA-LAB141 queued test
This is a queued test message.
timedatectl
Capture the time zone and sync state as incident context, especially when mail timestamps and logs must correlate with external systems.
Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
NTP service: active
ls -l /etc/chrony.conf
Confirming the active config path is a standard evidence step before making changes or escalating to time sync issues.
-rw-r--r--. 1 root root 1247 Jan 25 06:58 /etc/chrony.conf
journalctl -k -n 5
Kernel messages can provide context such as link state, driver resets, and audit signals that explain service behavior.
Jan 25 06:58:31 lab141 kernel: e1000e 0000:00:03.0 eth0: Link is Up 1000 Mbps Full Duplex
Jan 25 07:12:03 lab141 kernel: audit: type=1100 audit(...): pid=1 uid=0 ... unit=postfix ...
grep '^root:' /etc/aliases
This is a quick confirmation that the correct alias line is present.
root: admin@example.com, webmaster@example.com
Common breakpoints
You edited
/etc/aliases
but did not run
newaliases. Rebuild the database and verify again.
That is not an error. It means there is nothing queued on this host at the moment.
The queue ID may be wrong, or the message was delivered or
removed. Re-run
mailq
and copy the exact ID.
Check the NTP sync state and confirm sources using chrony tooling if you need deeper evidence.
Cleanup checklist
Leave the system in a safe state. If you modified aliases for lab testing, revert the line and rebuild the aliases database.
sudo vim /etc/aliases
sudo newaliases
systemctl is-active postfix || systemctl status postfix --no-pager
Reference
-
/etc/aliases: Local alias map used for address rewriting. -
newaliases: Rebuilds the aliases database used by Postfix. -
systemctl is-active postfix: Returns a one-word service state for Postfix. -
mailq: Displays the Postfix mail queue. -
postqueue -p: Displays the Postfix mail queue (alternative view). -
postcat -q <queueid>: Displays a queued message by ID without attempting delivery.-
-q: Read a queue file by ID.
-
-
timedatectl: Shows time, timezone, and NTP synchronization state. -
ls -l /etc/chrony.conf: Confirms the chrony configuration file path exists.-
/etc/chrony.conf: Default chrony configuration file path.
-
-
journalctl -k -n <n>: Shows the lastnkernel messages from the system journal.-
-k: Limits output to kernel messages. -
-n <n>: Limits output to the lastnentries.
-
-
grep '^root:' /etc/aliases: Confirms therootalias line exists.-
^: Anchors the match to the start of the line.
-