cd QMAIL
cd queue
for dir in mess info local remote
do
  ( cd $dir; find . -type f -print ) | (
    cd $dir
    while read path
    do
      id=`basename "$path"`
      sub=`expr "$id" % SPLIT`
      mv "$path" "$sub"/"$id"
    done
  )
done


syntax highlighted by Code2HTML, v. 0.9.1