View Single Post
  #14  
Old 8th April 2008, 00:13
deathshadow deathshadow is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Thanks: 4
Thanked 3 Times in 1 Post
Default

Addendum

In walking a buddy through setting this up on his server (I pointed him here, he got lost), we had real issues getting the purge script to run despite being (I thought) the same setup (Debian Etch perfect with ISPConfig as per this site) as my own server.

The script was throwing couldn't find directory errors and wouldn't work until I filled out the directory values the whole way.

So for debian etch, that should read (this is set to 3 days, the admin account for my buddies server sees 1500 spam a day):

Code:
#!/bin/sh

hours=$((24*3))

for domain in /var/www/*
do
  if [ -d "$domain"/user ]
  then
    for user in *
    do
      if [ -d "$domain/user/$user/Maildir/.Junk" ]
      then
        # change tmpreaper to tmpwatch for some distros
        tmpreaper -m $hours $domain/user/$user/Maildir/.Junk/{cur,new}
      fi
    done
  fi
done
Oh, and a little 'tip' for nubes that isn't mentioned here (came up while instructing my buddy, who's greener than moldy cheese) - chmod 775 this purge.junk file or cron won't execute it. With *nix heads this is one of those 'assumed' things that really should be mentioned so people new to bash and *nix have a clue.

I switched my own server to this file to verify it worked there too. No difference either way between my previous and this one - though I'm going with this one since it seems to work better across multiple distros (and doesn't burn time executing chdir)
Reply With Quote