procmail
[Top] [All Lists]

Re: Looping problem

2002-02-26 07:49:11
Hello again.

[some stuff deleted for brevity]

I have a spam filter (right out of Stopping Spam - O'reilly) that bounces
mail back to the sender if they aren't recognized and/or authorized via a
key phrase.

I understand from other responses that this puts the responsibility
on the sender but I don't have time to keep aggresively updating my
filters. This is an implementation that many of my clients have
requested and is why I am persuing an answer. My apologies if it
offends anyone. This is not my intention.


Hopefully, you've pre-filtered this list, because I'm not about to jump 
through hoops so that you can accept an answer to your own question.  I 
doubt I am alone in this thinking.

Yes. I have procmail processing several email lists and it works great.


My problem is, what to do if both sender and receiver have
this filter?

Try adding an "X-Loop:" header (somewhere down in where you create the 
bounce message - probably in the same invocation which _likely_ used 
formail to generate an auto-reply header).  The basic syntax would be like:

:0f
| formail -A "X-Loop: myaddress"

I have added this and it gets tagged onto messages I return. I
haven't yet been able to get procmail to see this and accept the
message yet though. I'm obviously not writing the rule properly and
I hope someone can help me.

Here is the relevant portion of my rc file:

--------8<---------------------------------
:0
* ^Subject:\/.*
  {
    SUBJECT = $MATCH
  }

:0:
* ^From: MAILER-DAEMON.*
/dev/null

:0
* !^FROM_DAEMON
* !^FROM +$MYNAME
* !^X-Loop: peter(_at_)compclass(_dot_)com

{
  FROM=`formail -rx "To:"`

  :0
  * ? egrep $FROM $FRIEND_LIST
  $DEFAULT

  :0
  * $ Subject:.*$FILTER_PASSWD
  {

    :0c
    $DEFAULT
    :0
    | echo $FROM >> $FRIEND_LIST
  } 

  :0
  | (formail -rkA"Precedence: junk"  \
                -A"X-Loop: peter(_at_)compclass(_dot_)com" ; \
        [message deleted for brevity]
    ) | $SENDMAIL -t && echo "Rejected mail from $FROM Re: $SUBJECT : `date`" 
$HOME/procmail_log
}

------8<-----------------------------------------------------


(the above assumes that it'd be placed within a braced construct which is 
only executed when your autoreply is being triggered).

At the outter layer of your whole bounceback system, you'd add an INVERTED 
check for this X-Loop:

* ! ^X-Loop: myaddress

I have this as above but I fear it is not in the correct place. I
have experimented with putting it in different places but with no
succes. procmail still bounces the message unless the key word is
in the subject.

(i.e. execute the bounceback ONLY if there isn't an X-Loop header).


I am also curious if anyone knows how to specify the mbox format
that procmail should use. For example, I work with SCO Unix and it
writes messages into incoming mail files with the ^A^A^A^A message
seperator format. When I use procmail on that system, it writes the
messages with the standard Unix "From " seperator. I wind up with
weird results when the formats are mixed like this. For example elm
thinks all messages after that "From " are one message. I have a
feeling it is a compile time option but I know you folks will know
for sure if I can tweak the running version to get it to write the
^A format.

I appreciate the time you take to help rookies/novices such as
myself. If anyone chooses to reply to me directly, please include
"wordone" in the subject and my filter won't bounce your message. I
don't mean to waste any one's time.

--peter

_______________________________________________
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>