Bob Tanner writes:
> Anyway to script it?
>
> Gotta do tclug-[list|announce|jobs|devel] and tcwug-[announce|list]

To quote Dan Bernstein, ``This is Unix; stop acting so helpless.''

The mess822 package makes it very easy to parse messages.  Maildir format
makes it even easier, since each message is a separate file.  Combined with
standard Unix tools, this is all you need for the job.

The following line

cat message | 822field to | tr -d ' ' | tr ',' '\n' | \
    grep -E "tclug-(list|announce)@mn-linux\.org"

will return either of those addresses if the message contains it.  You'll
want to check for cc as well.  The 822fields program from the qtools package
lets you check for both at once.

The iftocc program, also from mess822, could be used here:

iftocc tclug-list at mn-linux.org < message
if [ $? = 0 ]; then mail ...; fi

Combine either of these with a for loop and you're good to go.  Simply
re-inject the message as-is.

One problem you might have is if the address contains a name.  The 822addr
program from qtools easily solves that problem:

cat message | 822addr from | tr '\000' '\n' | grep "^+" | cut -b2-

You would only need to worry about this if you wanted to re-inject the
message with the original envelope sender.  For your purposes, you don't.  A
null envelope sender is fine.

--
David Phillips <david at acz.org>
http://david.acz.org/


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list