Is it possible to read an email using its ID on Postfix?

user2182051 picture user2182051 · Sep 9, 2013 · Viewed 13.4k times · Source

I need to recover an email that another user on my network sent a few days ago. I got the email ID using the grep command on /var/log/mail.log, but I don't know what to do right now with this.

How can I use the ID to view the contents of an email?

Answer

Cam picture Cam · May 13, 2014

Have a look and see if its on the queue with

sudo postqueue -p

If it is, read it using

sudo postcat -q MESSAGE_ID

If you have large attachement, the message is at the top, so pipe it into head to have a look

sudo postcat -q MESSAGE_ID | head -n 100