Skip to content

Instantly share code, notes, and snippets.

@benlumley
Created March 4, 2012 08:37
Show Gist options
  • Save benlumley/1971393 to your computer and use it in GitHub Desktop.
Save benlumley/1971393 to your computer and use it in GitHub Desktop.
Retrieve an email from postfix queue
# first, find the email using mailq or postqueue -p
#
# Then, get the message id - its the random data string in left hand column of first line for each email.
#
# then, run:
#
postcat -q MESSAGEID | sed -n '/MESSAGE CONTENTS/,$p' | grep -v "MESSAGE CONTENTS" | sendmail you@domain.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment