Need to view the mail queue on a plesk box running postfix?
mailq is a very simple command that will show the messages awaiting delivery.
Yet another helpful command to view more information on the emails in the queue.
From this command you will receive a random id before the mail information is given.
70BA7D281EC (7, D)
Return-path: Sender <firstname.lastname@example.org>
From: Sender <email@example.com>
To: Receiver <firstname.lastname@example.org>
Subject: The Email Subject
Date: Tue, 29 May 2012 11:24:48 -0400
Queue time: 1338305091
Envelope Recipients (D): email@example.com
You would use this id to view the email directly by going to:
# cat /var/spool/postfix/deferred/7/70BA7D281EC
Notice the /7/ folder. This will vary depending on the beginning number or letter of the id. By using the cat command, it will print the email on the screen in the terminal.
Furthermore, you can watch what emails are being sent and receiving by viewing the maillog.
# tail -f /usr/local/psa/var/log/maillog