This would be more appropriate on the procmail list, but: On Tue, 30 Apr 2002, Jeff Shepherd wrote:
> I'm setting up an account on my mail server that will unassassinate > false-positive spam. I plan to have users that received mail tagged > as spam send the message to this account The first problem you may have with this is that not all MUAs allow the user to "resend" the message (pine calls it "bounce" the message) in its original form. Outlook, for example (or at least the version we have installed), will only let you forward it as part of the body of a new message -- and not even as a MIME attachment, as far as I know. If you're sure this is not a problem ... > and to send the message back to the sender the procmailex man page > says to use something like this > > :0hc > * !^FROM_DAEMON > * !^X-Loop: [EMAIL PROTECTED] > | (formail -r -I"Precedence: junk" \ > -A"X-Loop: [EMAIL PROTECTED]" ; \ > echo "Mail received.") | $SENDMAIL -t > > But this sends an e-mail that says "Mail Received" back. How do I > send the original message back? The "hc" flags say to only process the header and to process a copy of the message. You want to process the whole message, and unless you're archiving the false positives somewhere you don't want to use a copy. `formail -r` by default strips off the body of the message and outputs only the reply header, so you don't want that directly in the pipeline. You don't want to do anything else to the message, so use the standard procmail forwarding syntax to send the processed message back. > Also, I need to add something to the header that will make > SpamAssassin will recognize it as not spam. Any recommended way? You're already sticking an X-Loop header in there. Use that. :0 * !^FROM_DAEMON * !^X-Loop: [EMAIL PROTECTED] { SENDER=`formail -r -xTo:` :0fw | spamassassin -d | formail -A"X-Loop: [EMAIL PROTECTED]" :0 ! $SENDER } Have you considered what happens if a spammer sends mail to your unassassinate address? You might want to take some steps to ensure that only your own users can send there. Also, please test this *carefully* to be sure that `formail -r` doesn't set $SENDER to the *original* sender rather than to the person who wants the message un-assassinated. Try it with messages re-sent using several different MUAs if possible. It might be better to get the sender's address some other way -- such as by having sendmail provide it as a command-line argument to procmail, if you have sendmail and are using procmail as the LDA.