I have run into a brick wall (in my mind) trying to simplify this procmail
recipe. The line below, where formail is called, needs to strip everything
in the From: field except the actual email address in <>'s. I can't seem
to come up with a way to do this with formail and figure sed would have to
be called. Sed is a bit beyond my comprehension. Any ideas?
FROM=`formail -ztxFrom:`
It may help if I gave you a few reasons for this. Below is a snippet of
the script. The submitter's address is grep'ed to a memberlist so that
only members can post and the posters on the no-cc list do not receive a
copy of their post. I have several people that send me stuff from other
lists and duplicates abound. I route them into another directory and sit
on them for a day or so. I weed out the duplicates and use pine bounce to
post to the list. By bouncing the post, the submitter shows up on the list
as the originator of the post. By extracting the From: field, the
submitter will not receive a copy of their post. I realize the -r flag is
probably redundant.
I want to simplify the file used so that only the email address is used
for comparison, rather the the name and email address in From: field,
i.e.: instead of Joe Blough <joe(_at_)domain(_dot_)com>, I want the bare addy
like
this=> joe(_at_)domain(_dot_)com
I'm also trying to come up with some ideas about adding rules to the no-cc
list. This is to prevent duplicates from other lists that have the same
source that I do. Right now, their are only two addresses that I don't
want cc's sent to if the other posts to the list, i.e.: when Joe Blough
posts to the list he's also posting to Nottso Bright and visa versa. Both
do not want copies of their posts or the other's. How do I go about adding
something like this?
--
LISTMAIL="$LIST_NAME.*$LIST_ADDRESS"
:0w
* ? test "$REQUIRE_LIST_NAME" = no -a "$LIST_ADDRESS" != "$OWNER_ADDRESS"
{
LNAME="not-required"
LISTMAIL="$LIST_ADDRESS"
}
:0w
* $^TO.*"$LISTMAIL"
* $!^X-Loop:.*"$LISTMAIL"
* ? test -n "$LIST_ADDRESS" -a -n "$OWNER_ADDRESS"
* ? test "$LNAME" = "not-required" -o -n "$LIST_NAME"
{
FROM=`formail -ztxFrom:`
WHOM=$FROM
SKIP=no
ERROR=no
:0w
* ? test "$RESTRICT_SENDERS" = no
{
WHOM="."
}
:0fw
* ? test -s "$MEMBER_FILE"
* ? fgrep -is "$WHOM" "$MEMBER_FILE"
| ( formail -z \
-i"Reply-To: $LIST_NAME <$LIST_ADDRESS>" \
-I"Errors-To: <$OWNER_ADDRESS>" \
-i"Sender: list-owner <$OWNER_ADDRESS>" \
-I"Precedence: list" \
-A"X-Loop: $LIST_NAME <$LIST_ADDRESS>" \
; cat -s $SIG_FILE )
:0aw
{
:0w
* ? test -x "$SENDMAIL"
* ? test "$TEST_MODE" = no
{
:0w
* ? test "$CC_SENDER" = no
! `fgrep -iv "$FROM" "$MEMBER_FILE"`
:0w
* ? test "$CC_SENDER" = maybe
* ? test -s "$NO_CC_FILE"
* ? egrep -is "$FROM" "$NO_CC_FILE"
! `fgrep -iv "$FROM" "$MEMBER_FILE"`
:0w
! `cat -s "$MEMBER_FILE"`
ERROR=yes
}
--
Regards,
Dave/Webmaster
Sick And Tired Of SPAM? | Enjoy Great Humor?
Join www.cauce.org | Join Joke-L
Hit SPAMMERS Where It Hurts | Listserv <listserv(_at_)ddave(_dot_)com>
"So many SPAMMERS; so few comets."