Line 362: |
Line 362: |
| | | |
| #for compatibility with older versions without rpm, testing | | #for compatibility with older versions without rpm, testing |
− | if [ `/sbin/e-smith/db configuration getprop LearnAsSpam dir` ]; then
| + | [ `/sbin/e-smith/db configuration getprop LearnAsSpam dir` ] && |
− | LearnAsSpam=`/sbin/e-smith/db configuration getprop LearnAsSpam dir`; | + | LearnAsSpam=`/sbin/e-smith/db configuration getprop LearnAsSpam dir` || LearnAsSpam='LearnAsSpam'; |
− | else
| + | [ `/sbin/e-smith/db configuration getprop LearnAsHam dir` ] && |
− | LearnAsSpam='LearnAsSpam'; | + | LearnAsHam=`/sbin/e-smith/db configuration getprop LearnAsHam dir` || LearnAsHam='LearnAsSpam'; |
− | fi
| |
− | | |
− | if [ `/sbin/e-smith/db configuration getprop LearnAsHam dir` ]; then
| |
− | LearnAsHam=`/sbin/e-smith/db configuration getprop LearnAsHam dir`; | |
− | else
| |
− | LearnAsHam='LearnAsSpam'; | |
− | fi
| |
− | | |
| JunkMail='junkmail'; | | JunkMail='junkmail'; |
| | | |
Line 385: |
Line 377: |
| printf "%25s %10s %10s %10s %10s \n" "User" "LearnAsSpam" "LearnAsHam" "JunkMail" "NotSeen" | | printf "%25s %10s %10s %10s %10s \n" "User" "LearnAsSpam" "LearnAsHam" "JunkMail" "NotSeen" |
| pushd /home/e-smith/files/users/ >>/dev/nul | | pushd /home/e-smith/files/users/ >>/dev/nul |
− | for u in `ls | grep -v admin` | + | for u in `ls ` #| grep -v admin` |
| do | | do |
− | spam=`ls -1 $u/Maildir/.$LearnAsSpam/cur |wc -l` | + | [ "$u" = "admin" ] && mailpath="/home/e-smith/" || mailpath="/home/e-smith/files/users/$u" ; |
− | ham=`ls -1 $u/Maildir/.$LearnAsHam/cur |wc -l` | + | spam=`ls -1 $mailpath/Maildir/.$LearnAsSpam/cur |wc -l` |
− | left=`ls -1 $u/Maildir/.$JunkMail/cur |wc -l` | + | ham=`ls -1 $mailpath/Maildir/.$LearnAsHam/cur |wc -l` |
− | nseen=`ls -1 $u/Maildir/.$JunkMail/new |wc -l` | + | left=`ls -1 $mailpath/Maildir/.$JunkMail/cur |wc -l` |
| + | nseen=`ls -1 $mailpath/Maildir/.$JunkMail/new |wc -l` |
| if [[ $spam > 0 ]] || [[ $ham > 0 ]] || [[ $left > 0 ]] || [[ $nseen > 0 ]]; then | | if [[ $spam > 0 ]] || [[ $ham > 0 ]] || [[ $left > 0 ]] || [[ $nseen > 0 ]]; then |
| printf "%25s %10d %10d %10d %10d \n" $u $spam $ham $left $nseen | | printf "%25s %10d %10d %10d %10d \n" $u $spam $ham $left $nseen |
Line 399: |
Line 392: |
| tnseen=$tnseen+$nseen | | tnseen=$tnseen+$nseen |
| done | | done |
− | popd >>/dev/nul
| |
− | spam=`ls -1 /home/e-smith/Maildir/.$LearnAsSpam/cur |wc -l`
| |
− | ham=`ls -1 /home/e-smith/Maildir/.$LearnAsHam/cur |wc -l`
| |
− | left=`ls -1 /home/e-smith/Maildir/.$JunkMail/cur |wc -l`
| |
− | nseen=`ls -1 /home/e-smith/Maildir/.$JunkMail/new |wc -l`
| |
− | if [[ $spam > 0 ]] || [[ $ham > 0 ]] || [[ $left > 0 ]] || [[ $nseen > 0 ]]; then
| |
− | printf "%25s %10d %10d %10d %10d \n" "admin" $spam $ham $left $nseen
| |
− | fi
| |
− | tspam=$tspam+$spam
| |
− | tham=$tham+$ham
| |
− | tleft=$tleft+$left
| |
− | tnseen=$tnseen+$nseen
| |
| echo "----------------------------------------------------------------------" | | echo "----------------------------------------------------------------------" |
| printf "%25s %10d %10d %10d %10d \n" "Total:" $tspam $tham $tleft $tnseen | | printf "%25s %10d %10d %10d %10d \n" "Total:" $tspam $tham $tleft $tnseen |
| echo | | echo |
| + | popd >>/dev/nul |
| </pre> | | </pre> |
| | | |