You can see the contents of the mail whose ID you get from the mailq command by using the postcat command. Here’s how you can do it:
Replace YOUR_MAIL_ID with the ID of the mail you got from the mailq command.
The system directory /var/spool/postfix is the master directory. Subdirectories of that which matter include active, deferred, bounce, etc. Queued files may be stored using the full file name (like A705238B4C) or with some level of hashing depth (like A/7/05238B4C)
Since Postfix version 2.7, you can also get readable output, by adding the -h and/or -b options:
b: Show body content.h: Show message header content.q: Search the Postfix queue for the named files instead of taking the names literally.
So this will show you the entire original message with headers and body:
Or to show the headers of all queued messages, you could do something like this:
Again, replace [YOUR_MAIL_ID](https://serverfault.com/questions/391995/how-can-i-see-the-contents-of-the-mail-whose-id-i-get-from-mailq-command) with the ID of the mail you got from the [mailq](https://serverfault.com/questions/391995/how-can-i-see-the-contents-of-the-mail-whose-id-i-get-from-mailq-command) command.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.