ResendingMailWithHeaders

Resending a mail message while preserving the headers

Here's how to redirect (or "bounce") a mail message to another recipient. This is important when training Bayes via mail (as described in ProcmailToForwardMail), for example. It's often critical to redirect the message, rather than forwarding. Forwarding loses all of the critical header information, which is much of what Bayes trains from. Here are directions for redirecting from different clients. Note that for all redirections, you'll want to clear away all To: and Cc: entries and then add [MAILTO] spam@example.com to the To:, in order to avoid resending the spam to another victim.

# /home/spam/.procmailrc

# GroupWise forwarded mail, subject starts Fwd:
#     Strip off the forwarding mail, leaving the attachment
#     Remove the leading blank line

VERBOSE=on
DEFAULT=$HOME/Maildir/
LOGFILE=$HOME/procmail.log

:0
* ^Subject: Fwd:
{
    :0fw: splitmsg.lck
    | sed -e '1,/message\/rfc822/d'

    :0fw: splitmsg.lck
    | sed -e '1d'
}

(JonGerdes & PsiCop)

ReSent-Date: Wed, 27 Oct 2004 10:50:57 -0500 (CDT)
ReSent-From: User Name <username@company.com>
ReSent-To: username+spam@company.com
ReSent-Subject: pain is killing your sister
ReSent-Message-ID: <Pine.LNX.4.58.0410271050570.29000@company.com>
^TO_.*spam@company.com 
* < 256000

   {
   :0fw: spamassassin.spamlock
   | sed -e '/^ReSent-/ d'

   :0c: spamassassin.spamlock
   | sa-learn --spam

   :0: spamassassin.filelock
   spam
   }

Contributors

Thanks to WilliamStearns for the original [WWW] redirection info used on this page.


CategoryBayes

last edited 2007-04-03 09:05:25 by KarstenDambekalns