Skip to content

Instantly share code, notes, and snippets.

@jonavon
Forked from Caffe1neAdd1ct/trapmail
Created July 16, 2019 16:28

Revisions

  1. Kevin Andrews created this gist Feb 6, 2014.
    10 changes: 10 additions & 0 deletions trapmail
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash

    formail -R cc X-original-cc \
    -R to X-original-to \
    -R bcc X-original-bcc \
    -f -A"To: new@email.com" \
    | /usr/sbin/sendmail -t -i

    # pipe all to a log instead, comment out formail code
    #tee -a /tmp/trapmail.log > /dev/null