procmail
[Top] [All Lists]

Re: autobounce: I ALMOST got it

1997-06-12 15:32:00
W. Wesley Groleau is puzzledl

| # Stuff that gets past the other recipes, but is from a place that has
| # spammed me in the past.  
| :0
| * ? fgrep -i -f $SBDIR/maybespam.list
| * !^X-Loop: noloop(_at_)noloop(_dot_)nlp
| {
|   :0 c
|   $SPAMFOLDER

Unless $SPAMFOLDER is a directory, you need a local lockfile there.  A
place that has spammed you in the past could have another user who is
writing to you legitimately, or it could be sending a sincere apology for
the past spam.

|   :0 c
|   TEMP=|cat

Saving the entire text in a variable?  That can have $LINEBUF problems
later.

|   :0
|   | (formail -bkrt -IReceived: -A"X-Loop: noloop(_at_)noloop(_dot_)nlp";\
|     cat $SBDIR/maybespam.msg; echo "$TEMP") | $SENDMAIL -oi -t

The -k on formail keeps the body despite -r, so maybespam.msg is getting
appended after the body, and somehow you're not getting `echo "$TEMP"' to
work ($LINEBUF overflow?  shouldn't be with a shell ...).  formail -r
drops Received: headers by default, so you didn't need `-IReceived:'.

| }

| WHAT IT DOES:
| 
| Sends a reply containing (in order)
| 
| Reply header
| Original body
| contents of maybespam.msg

So somehow `echo "$TEMP"' isn't happening.

| WHAT I WANTED:
| 
| Send a reply containing (in order)
| 
| Reply header
| contents of maybespam.msg
| Original header
| Original body

Let's start over from the save:

  :0c:
  $SPAMFOLDER

  :0fhw # double the head; second head is now part of body
  | sed -e H -e '$ G'

  :0fhw # invert first head and slip in message after it (before second head)
  | formail -rtA"X-Loop: noloop(_at_)noloop(_dot_)nlp" ; cat 
$SBDIR/maybespam.msg

  :0 # send it all out
  ! -t

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