How to view the mail queue and its messages in postfix

Here you can see how you mange postfix in linux plesk server.

mailq is a very simple command that will show the messages awaiting delivery.
# mailq

# /usr/local/psa/admin/sbin/mailqueuemng
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.

Example:

4AC531488D76 (4, D)
  Return-path: lfklxmuy@domain.co.uk
  From: lfklxmuy@domain.co.uk
  To: willi.klippert@gmx.de
  Subject: =?utf-8?Q?Was_schnellt_in_die_H=C3=B6he=2C_wenn_Sie_dieses_Angebot_nutzen=3F?=
  Date: Thu, 24 Oct 2013 06:43:43 -0500 (CDT)
  Size: 1478
  Message-Id: <20131024114343.4AC531488D76@echo.netpivotal.com>
Timestamp: 1382615023
  Queue time: 1382615023
  Envelope Recipients (D):
4AC0C1480643 (4, D)
  Return-path: xujk@domain.co.uk
  From: xujk@babywishes.co.uk
  To: lars-paulsen@12move.de
  Subject: =?utf-8?Q?Was_schnellt_in_die_H=C3=B6he=2C_wenn_Sie_dieses_Angebot_nutzen=3F?=
  Date: Mon, 21 Oct 2013 04:09:58 -0500 (CDT)
  Size: 1332

You would use this id to view the email directly by going to:

# cat /var/spool/postfix/deferred/7/4AC531488D76
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

Comments

Popular Posts

Install and configure rsyslog Centralized logging server in CentOS

How to fix postfix/smtp Network is unreachable error

Could not join realm: Necessary packages are not installed: sssd-tools sssd libnss-sss libpam-sss adcli