procmail
[Top] [All Lists]

Re: bouncing to a bunch of people . . .

2003-03-16 12:30:42
Louis has a new problem because of an old solution:

| The recipe is as folows:
|
| :0
| * FOLDER ?? ^^listfolder^^
| {
|   :0fhwc
|   * ? formail -x From: -x Sender: -x Reply-To: -x Return-Path: -x \
|       To: | grep -i -f /home/leblanc/.list
|   ! `cat .list`

You don't want `f' there; you don't want to replace the message (or, since
you're using `h' without `b,' the head) with the stdout of the command.

|   :0E
|   | formail -Y -f -A "X-Listproblem: Sender not in list"
| }

| Presumably, if the folder matches, the list is checked to see if the
| senders address is in it.  If so, it should forward the message to the
| whole list.
|
| I've goofed something up here.  The problem is that I'm not in the
| list, since I'm just allowing the original copy of the message to be
| delivered to the listfolder mailbox.
|
| Here comes a chicken and egg problem.  If I put my address in with the
| +listfolder extension, it will continually loop, filling up the
| mailbox of everyone in the list, but never getting to me.  If I simply
| put my address without the extension, I need to use the c flag on the
| recipe, but I'm closed out of the list and can't send to it.

| Any ideas how I can fix this?

First, create a second file, call it .senders or something, of members' other
addresses from which you'll accept posts, and add it as a second argument to
grep.

Second, detect a loop in the usual way, by looking for your X-Loop header,
diverting the message if it's there, and adding it if it isn't there yet:

 :0
 * FOLDER ?? ^^listfolder^^
 {
   :0:
   * ^X-Loop: listfolder(_at_)keyslapper\(_dot_)org
   beenherebefore

   :0hwc
   * ? formail -x From: -x Sender: -x Reply-To: -x Return-Path: -x \
       To: | grep -i -f /home/leblanc/.list
   | formail -YfA "X-Loop: listfolder(_at_)keyslapper(_dot_)org" | $SENDMAIL 
`cat .list`
   :0E
   | formail -Y -f -A "X-Listproblem: Sender not in list"
 }




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