procmail
[Top] [All Lists]

RE: Procmail Question

2002-11-14 12:02:19
On 14 Nov, Dave Cook wrote:
| Thank you for your help!
| 
| I understand why I should not send back a reply to spam.  While working on
| procmail rules I would like to strip out the original body of the spam
| message and stick my own text.  Is there a way to do this?
| 

The "right" answer is man procmailrc and man procmailex. Also, the
archives are replete with examples of different ways to do this. That
said...

  :0 fb
  | echo "Your replacement text here"

The flags say to f(ilter) the b(ody). 

That is the simplest variation.  If the message is longer than one line,
it might require something like:

  :0 fb
  | ( echo "Line 1 of your message"; \
      echo "Line 2 of your message"; \
      echo "Line 3 and so on" )

You can also keep the message in an external file:

  :0 fb
  | cat /path/to/your.message

I do one that does INCLUDERC where that rcfile assigns the message to a
variable, which contains other variables that are replaced dynamically
for each message.  Then my filter does 'echo -e "$MYMSG\n";'.

There are many ways to skin this cat.

One thing that is curious to me is I couldn't generate an "Error while
writing to" message while doing some simple tests.  I was expecting
that these filters should have an "i" flag.  I'm sure I've seen those
errors in my log files with similar recipes, which were cured with the
"i" flag.  Is it because I was testing from the command line and
something to do with std in/out on a terminal?

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>