Changes

From SME Server
Jump to navigationJump to search
736 bytes added ,  20:26, 23 January 2016
→‎LearnAsSpam / LearnAsHam (spam/ham training): add script to count e-mail in LearnAs[Spam|Ham] folders and summarize it.
Line 375: Line 375:  
<li>Instruct your users to move any SPAM they find from their Inbox to their LearnAsSpam folder, and to COPY any non-spam (ham) they find in their junkmail folder into their LearnAsHam folder.</li>
 
<li>Instruct your users to move any SPAM they find from their Inbox to their LearnAsSpam folder, and to COPY any non-spam (ham) they find in their junkmail folder into their LearnAsHam folder.</li>
 
</ol>
 
</ol>
 +
 +
This file counts how many e-mail are in LearnAsSpam and LearnAsHam directories (of all users). It's usefull to know if your users are using those folders.
 +
<pre>
 +
#  ContaLearn.sh
 +
 +
echo
 +
echo
 +
date
 +
declare -i tspam
 +
declare -i tham
 +
 +
pushd /home/e-smith/files/users/ >>/dev/nul
 +
for u in `ls | grep -v admin`
 +
do
 +
  spam=`ls -1 $u/Maildir/.LearnAsSpam/cur |wc -l`
 +
  ham=`ls -1 $u/Maildir/.LearnAsHam/cur |wc -l`
 +
  if  [[ $spam > 0 ]] || [[ $ham > 0 ]];  then
 +
    echo "User: $u  LearnAsSpam: $spam    LearnAsHam: $ham"
 +
  fi
 +
  tspam=$tspam+$spam
 +
  tham=$tham+$ham
 +
done
 +
echo "-----------------------------------------------------------------------------"
 +
echo "  Total:            Spam: $tspam Ham: $tham "
 +
popd >>/dev/nul
 +
echo
 +
</pre>
    
====Learn Contrib====
 
====Learn Contrib====
147

edits

Navigation menu