procmail
[Top] [All Lists]

Re: bouncing to a bunch of people . . .

2003-03-16 14:34:23
On 03/16/03 01:06 PM, David W. Tamkin sat at the `puter and typed:
Louis has a new problem because of an old solution:

I may have found a reasonable way around this . . .

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

Nice.  I shoulda thought of that one.

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"
 }

I tried this, but I must have botched something.

I set up the .listsenders file, and put leblanc(_at_)keyslapper(_dot_)org in it,
as well as all the names in .list.  This is formatted with just the
email addresses, one per line, with no trailing spaces or '\' (per the
grep manpage).

I then set up a different folder to recieve my own copy, and placed
the +newfolder address in the .list file but not the .listsenders
file.  .list is still formatted with one per line and a trailing
space and '\' except the last address.  I then set up the recipe as follows:

:0
* FOLDER ?? ^^list^^              # message to the list
* !^X-Loop: list(_at_)keyslapper\(_dot_)org  # make sure we don't have a loop
{
  :0hw                            # make sure they are authorized
  * ? formail -x From: -x Sender: -x Reply-To: -x Return-Path: | grep -i -f 
/home/leblanc/.listsenders
  {
    :0
    | formail -YfA "X-Loop: list(_at_)keyslapper(_dot_)org"  # add the loop

    :0A
    ! `cat .list`                   # send this to the list

  }
  :0E                             # if the sender isn't authorized,
  {
    :0                            # add the X-Listproblem header
    | formail -YfA "X-Listproblem: Sender not in list"

    :0A
    FOLDER=newfolder          # and drop the message into newfolder

  }
}
:0E
* FOLDER ?? ^^list^^    # if we have a looping message,
{ FOLDER=newfolder }    # drop it into newfolder



Doesn't this look right?  Why is it not working?

This is what procmail logs:

procmail: Match on "^^list^^"
procmail: Match on ! "^X-Loop: list(_at_)keyslapper\(_dot_)org"
procmail: Executing " formail -x From: -x Sender: -x Reply-To: -x Return-Path: 
| grep -i -f /home/leblanc/.listsenders"
procmail: [81124] Sun Mar 16 16:16:03 2003
procmail: Match on " formail -x From: -x Sender: -x Reply-To: -x Return-Path: | 
grep -i -f /home/leblanc/.listsenders"
procmail: Extraneous deliver-head flag ignored
procmail: Assigning "LASTFOLDER=formail -YfA X-Loop: 
list(_at_)keyslapper(_dot_)org"
procmail: Notified comsat: "leblanc@:/home/leblanc/formail -YfA X-Loop: 
list(_at_)keyslapper(_dot_)org"
 Subject: still testing
  Folder: formail -YfA X-Loop: list(_at_)keyslapper(_dot_)org        1247
procmail: Executing "formail,-YfA,X-Loop: list(_at_)keyslapper(_dot_)org"

I've been tweaking this little by little and this is the hurdle I
can't quite figure out.

What is the Extraneous deliver-head flag?  I suspect this might be
this section:
  {
    :0
    | formail -YfA "X-Loop: list(_at_)keyslapper(_dot_)org"  # add the loop

    :0A
    ! `cat .list`                   # send this to the list

  }

And the extraneous deliver-head flag is the second conditional.  If
so, how do I make sure this gets done correctly?  If not, what exactly
is the problem?

Thanks a lot for your help with this!

Lou
-- 
Louis LeBlanc               leblanc(_at_)keyslapper(_dot_)org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

management, n.:
  The art of getting other people to do all the work.

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