Subject: Re: procmail needs templates

From: [email-masked] (Robert W. Kerns)
Date: Thu, 29 Sep 1994 13:56:49 +0800

Roman Czyborra writes:
 > > wc -l ~/.procmailrc
 > > 225 /usr/ecegrad/hardaker/.procmailrc
 > 
 > Darren requested them a month ago.  Back then the answer was to stick
 > to the do-one-thing-well philosophy and to resort to a macro processor
 > but this requires you update your .procmailrc everytime you edit the
 > source.

Perhaps procmail could take over this task.  Something like:

INCLUDE .procmail.list.proc (.procmail.list) makelist -o $SOURCE $TARGET

and compare the dates on .procmail.list and .procmail.list.proc, and
run makelist -o .procmail.list.proc .procmail.list.

$SOURCE and $TARGET are more readable than make's $@ and $?.

---

From: [email-masked] (Wes Hardaker)
Date: Thu, 29 Sep 1994 08:53:02 -0700

You know what I would love for procmail is templates.  Or foreach
loops, either one...

I'm on like 10 or 11 mailing lists.  This means that my procmail file
is now:

8:33am [37]: wc -l ~/.procmailrc
225 /usr/ecegrad/hardaker/.procmailrc

Scary.  (Someday I'll have to post what I'm doing in this thing...  It
would be a good learning exercise for lots of people to study...)

The problem is that many of these recipes are identical except for
the RegEx and the delivery place.  It would be nice to to either
create a template so I could reduce each of my mailing list entries
to one template line rather than 5 lines (again, you'd have to see
what I was doing), or to have a foreach type statement to use so I
could do 'foreach i ( $RegExList ) { stuff here }'

These are only long term goal ideas Stephen, I know you're thinking
"Oh no...  Not more to do".
                                                                _____
			        			       / ___ \
Wes Hardaker		             		       	      / /   \/
Department of Electrical and Computer Engineering            \--/     /\
University of California at Davis	 __________________   \/     /--\
Davis CA  95616                         /     Recycle      \    /\___/ /
([email-masked])             / It's not too late! \   \_____/

---

From: Samuel Tardieu <[email-masked]>
Date: Thu, 29 Sep 1994 17:11:25 +0100

>>>>> "Wes" == Wes Hardaker <[email-masked]> writes:

    Wes> You know what I would love for procmail is templates.  Or
    Wes> foreach loops, either one...

    Wes> I'm on like 10 or 11 mailing lists.  This means that my
    Wes> procmail file is now:

    Wes> 8:33am [37]: wc -l ~/.procmailrc 225
    Wes> /usr/ecegrad/hardaker/.procmailrc

    Wes> Scary.  (Someday I'll have to post what I'm doing in this
    Wes> thing...  It would be a good learning exercise for lots of
    Wes> people to study...)

    Wes> The problem is that many of these recipes are identical
    Wes> except for the RegEx and the delivery place.  It would be
    Wes> nice to to either create a template so I could reduce each of
    Wes> my mailing list entries to one template line rather than 5
    Wes> lines (again, you'd have to see what I was doing), or to have
    Wes> a foreach type statement to use so I could do 'foreach i (
    Wes> $RegExList ) { stuff here }'

I wonder if it's a good idea to let procmail have more and more
work. procmail is great because of a lot of things, but first (for me)
because it runs very fast.

Couldn't you write a script that will take the list of mailing-lists as
argument and will generate a .procmailrc.list which could be
included in your .procmailrc using the INCLUDE syntax ?

  Sam
-- 
"It is better to be silent and thought a fool than to open your
    mouth and leave no doubt."

---

From: Wes Hardaker <[email-masked]>
Date: Thu, 29 Sep 1994 09:50:06 -0700

|> I wonder if it's a good idea to let procmail have more and more
|> work. procmail is great because of a lot of things, but first (for me)
|> because it runs very fast.

I agree...  It is very fast.  Well, I'm sure its chugging a bit with
what I have doing it.  I don't think templates would slow it down
though...  Its kinda like inserting text and then parsing it...  Very
little over-head.

|> Couldn't you write a script that will take the list of mailing-lists as
|> argument and will generate a .procmailrc.list which could be
|> included in your .procmailrc using the INCLUDE syntax ?

I could do something like that, this is true...  Its note *ideally*
what I would want however.  (though nothing really is ;-)

Wes

---

From: Roman Czyborra <[email-masked]>
Date: Thu, 29 Sep 1994 20:33:45 +0100

> 225 /usr/ecegrad/hardaker/.procmailrc

I know.  As linebreaks are an essential element of procmailrc it's not
always possible to keep it as short as you'd want.

> You know what I would love for procmail is templates.

> the RegEx and the delivery place.

You might want to check out procmail v3.10p4's \/$MATCH facility:

	:2:
	^^From \/(list1|list2|list3)
	$!^TO$USER
	listmail/$MATCH

---

From: Wes Hardaker <[email-masked]>
Date: Thu, 29 Sep 1994 13:01:22 -0700

|> You might want to check out procmail v3.10p4's \/$MATCH facility:
|> 
|> 	:2:
|> 	^^From \/(list1|list2|list3)
|> 	$!^TO$USER
|> 	listmail/$MATCH

Trust me I've been dying to use that feature.  However, I'm not going
to start using it till it drops its 'pre' post-fix...  I install
procmail for system wide use here, not just my self.

Wes