procmail
[Top] [All Lists]

simulate Smartlist's accept file

1998-10-08 21:38:26
Hi-

A while back I asked about simulating Smartlist's accept list
because I could never get it to work properly for local mailing lists
due to Stephen's method of using multigram thresholds to match addresses.
Anyway, I finally came up with the following to solve this problem
for me.  It may not work perfectly in excluding all unwanted posts
but I think it will be good enough.  I didn't write any of this.
I just used ideas presented on this list to get it.

Any caveats or suggestions are *appreciated*.  I've tested this
quite a bit but have not yet implemented it.  Thanks.

Dave Robbins

--
DEFAULT=/var/mail/mylist
MAILDIR=/pathto/mylist/.procmail
LOCKFILE=$MAILDIR/.lockfile
LOGFILE=$MAILDIR/.log
VERBOSE=on
LOGABSTRACT=yes
EGREP=/usr/local/bin/egrep
ML=/usr/local/lib/aliases
ACCEPTLIST="$ML/mylist.accept $ML/everyone $ML/others"
FROM=`formail -rzxTo:`

:0
* ? echo "$FROM" | $EGREP -i -f $ACCEPTLIST
* ? test -r $ACCEPTLIST -a -s $ACCEPTLIST
{
        :0 HB:
        ! `cat $ML/mylist`
}
:0
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: mylist(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu
| (formail -rk \
   -A "X-Loop: mylist(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu" \
   -A "Precendence: junk"; \
echo "Your post to mylist(_at_)magic(_dot_)geol(_dot_)ucsb(_dot_)edu was not 
successful";\
echo "because the mailing list is restricted to submissions";\
echo "from only certain individuals and groups.  Sorry." ) \
| $SENDMAIL -t -oi

# Alternate else statement:
#{
#       EXITCODE = 77
#       :0h:
#       | gzip -fc >> $MAILDIR/.headers.gz
#}

<Prev in Thread] Current Thread [Next in Thread>