All pastes #90193 Raw Edit

Mine

public shellscript v1 · immutable
#90193 ·published 2006-07-17 13:29 UTC
rendered paste body
#!/bin/bash# Declaring our variablesVPOPHOME=`echo ~vpopmail`SPAMDIR="Maildir/.Spam/new"LOCKFILE="/var/tmp/spamlearn.lock"# Check to see if this process is already running, if so we should exit.if [ -e $LOCKFILE ] then	echo "spamlearn is running, exiting now"	exitelse	# Write a lockfile, to show that the process is running.	touch $LOCKFILEfilearnspam() {	# We need our domain store directory.	VDOMAIN=`$VPOPHOME/bin/vdominfo -d $DOMAIN`        # Move spam older than 7 days to ISSPAM folder to be learned.        for i in $( find $VDOMAIN/$1/$SPAMDIR/ -mtime +7 ); do                if [ -f $i ]                then                        mv $i $VDOMAIN/$1/$ISSPAM                fi        done}spamdomain() {	DOMAIN=$1	# List the users of the domain.	for i in $( $VPOPHOME/bin/vuserinfo -nD $DOMAIN ); do		USER=$i		USERDIR=`$VPOPHOME/bin/vuserinfo -d $USER@$DOMAIN`		learnspam $USER	done}for i in $( $VPOPHOME/bin/vdominfo -n ); do	spamdomain $idone