On Wed, Jul 28, 2004 at 08:17:39PM -0600, Justin Gombos wrote:
* Dallman Ross <dman(_at_)nomotek(_dot_)com> [2004-07-28 15:38]:
For such long lists of friends, etc., you should use some method
other than var assignment in your algorithm. Either grep against a
file or files, or (what I do) use filenames themselves for hashes
kept in a special area. (I described that once within the last
year; search the archives -- suggested words "hash" and "filename"
-- if you have interest.)
My $FROM_ conditional is defined this way:
FROM_="(From${SPC}|(Old-|X-)?(Resent-)?\
(From|Reply-To|Sender):)(.*\<)?"
so greping could be a problem, because it assumes a one-to-many match,
when I really have to do a many-to-many match. Even if I only checked
the From: field, isn't it possible for this field to have multiple
addresses?
Offhand, I see no inherent problem using egrep against a file to do what
you describe. The grep solutions do get a little messy sometimes in
order to resolve quoting issues with odd chars you'll pick up in
the seeding string.
I also checked the archives for your hashing method. Maybe I didn't
find the correct post, but it seems you are also stuffing a large list
of addresses into a procmail variable as well. ie:
"$HASH" is where I have filename hashes. If $KEYCHECK matches,
the includerc is run. One might look like this inside:
COPY_ME = c # set to `c' if I'm on list
LIST_DELIVERY="
john(_at_)q(_dot_)public(_dot_)com
paula(_at_)example(_dot_)com
"
I'm a little confused though, because you are not using "\" at the end
of each line to continue your variable definition.
Well, first of all, that's not the archived post I was thinking of.
This is (my query was "hash dallman"):
http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-11/msg00207.html
http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-12/msg00086.html
But second of all, the above that you found (which doesn't solve your
buffer overflow problem anyway) doesn't need continuation slashes, no,
because it is not going to be used for finding anything, as in regexes
or grepping. But let's forget about that for the moment. (Also,
in May I rolled my own list software from procmail, which I am using
for the vsnag list and the automatic subscribe/unsubscribe capability;
and I took the above thing that I had been using for a few very tiny
private distro lists, and turned it into the filehash thing I discuss
in the links just above this paragraph -- so I won't run into FILEBUF
problems regardless of how big the vsnag list gets.)
We may actually be doing effectively the same thing. All my scripts
span a library of files that get included, and one of the files purely
sets variables for different groups of people. You wouldn't know it
from my sample posts, because I merge them into a single stream to
make it easier to test them.
I'm suggesting you ditch the assignment of a few thousand bytes of
strings to variables, because you run the risk of bumping up against
the overrun issue pretty much at any time, depending on how existing
or new code in your rc gets expanded, etc.
In my list management rc, I now also have this:
:0 D # 040430 () normalize case of Return-Path
* RP ?? [A-Z]
{ rp = `echo "$RP" | tr '[:upper:]' '[:lower:]'` }
That's of course because filenames are case-sensitive, and there's no '-i'
flag to the "test" command. :-)
You could probably take these ideas and run with them and create a
nicely rigorous, clean matching system. You could have compartmentalized
sections segregated by directory. I haven't thought this through much
yet -- I'm just throwing out ideas.
--
dman
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail