<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.qmailtoaster.org:80/index.php?action=history&amp;feed=atom&amp;title=Spamassassin</id>
	<title>Spamassassin - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.qmailtoaster.org:80/index.php?action=history&amp;feed=atom&amp;title=Spamassassin"/>
	<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;action=history"/>
	<updated>2026-04-29T12:38:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;diff=1415&amp;oldid=prev</id>
		<title>Ebroch at 18:54, 19 October 2024</title>
		<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;diff=1415&amp;oldid=prev"/>
		<updated>2024-10-19T18:54:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:54, 19 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Configuration#&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spamassassin&lt;/del&gt;|Back]]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Configuration#&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Spamassassin&lt;/ins&gt;|Back]]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email system.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email system.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebroch</name></author>
	</entry>
	<entry>
		<id>http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;diff=1339&amp;oldid=prev</id>
		<title>Ebroch at 16:10, 19 October 2024</title>
		<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;diff=1339&amp;oldid=prev"/>
		<updated>2024-10-19T16:10:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:10, 19 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Configuration#spamassassin|Back]]&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email system.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email system.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebroch</name></author>
	</entry>
	<entry>
		<id>http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;diff=116&amp;oldid=prev</id>
		<title>Ebroch: Created page with &quot;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email syst...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Spamassassin&amp;diff=116&amp;oldid=prev"/>
		<updated>2024-03-16T16:10:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email syst...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam. These tests are applied to email headers and content to classify email using advanced statistical methods. In addition, SpamAssassin has a modular architecture that allows other technologies to be quickly wielded against spam and is designed for easy integration into virtually any email system.&lt;br /&gt;
&lt;br /&gt;
This page is designed to give you an overview of how QmailToaster goes about configuring SpamAssassin.&lt;br /&gt;
&lt;br /&gt;
=== Configuration and Rules ===&lt;br /&gt;
&lt;br /&gt;
The SpamAssassin-Toaster uses the following configuration files:&lt;br /&gt;
&lt;br /&gt;
* /etc/mail/spamassassin/local.cf&lt;br /&gt;
* /etc/mail/spamassassin/v310.pre&lt;br /&gt;
* /etc/mail/spamassassin/v312.pre&lt;br /&gt;
* /usr/share/spamassassin/*.cf&lt;br /&gt;
&lt;br /&gt;
The local.cf file contains basic settings, like the score you must reach before a message is considered spam, what the subject line should be changed to if the score is reached (ie add ***SPAM*** to the subject) and whether Bayes Scoring should be used. The settings in here will apply to all users on your system.&lt;br /&gt;
&lt;br /&gt;
The two .pre files tell SpamAssassin what plugins to load for applying different tests. these are in the format&lt;br /&gt;
 loadplugin Mail::SpamAssassin::Plugin::MIMEHeader&lt;br /&gt;
&lt;br /&gt;
You can find a list of available plugins [http://search.cpan.org/~felicity/Mail-SpamAssassin-3.1.4/ on CPAN]. Installing a plugin using CPAN goes like this:&lt;br /&gt;
&lt;br /&gt;
    # cpan&lt;br /&gt;
    # install Mail::SpamAssassin::Plugin::URIDNSBL&lt;br /&gt;
    # quit&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s [http://cpan.org/misc/cpan-faq.html#How_installed_modules how to find out what perl modules you have]. If you are using the latest version of SpamAssassin-toaster then everything you need should already be installed.&lt;br /&gt;
&lt;br /&gt;
The /usr/share/spamassassin/*.cf files are custom rule sets designed for catching spam using your installed modules. How each of them will add (or subtract) points from the mail&amp;#039;s spam score is set by 50_scores.cf. If you are, for instance, a pharmaceutical retailer you probably want to lower the scores for the various drugs cf files.&lt;br /&gt;
&lt;br /&gt;
Some of the files will only be used if the appropriate module is loaded, for instance 25_uribl.cf will only run if you have added&lt;br /&gt;
  loadplugin Mail::SpamAssassin::Plugin::URIDNSBL&lt;br /&gt;
to one of your .pre files.&lt;br /&gt;
&lt;br /&gt;
You can find lots and lots of alternative rule sets at [http://www.rulesemporium.com Rules Emporium]and you might want to join a SpamAssassin [http://wiki.apache.org/spamassassin/MailingLists mailing list] to keep your self up to date on the fight against spam while you are at it.&lt;br /&gt;
&lt;br /&gt;
If you add rules (by creating a new .cf file in /usr/share/spamassassin) or add a module to a .pre file so new rules will be applied or basically make any changes to the SpamAssassin configuration files you &amp;#039;&amp;#039;must&amp;#039;&amp;#039; check that all the syntax is OK:&lt;br /&gt;
&lt;br /&gt;
   # spamassassin -D --lint&lt;br /&gt;
&lt;br /&gt;
If you see any errors, correct them before you restart the spamd service! The most likely thing you will see are missing perl modules. Add them using CPAN as you see above.&lt;br /&gt;
&lt;br /&gt;
After you make any changes you need to restart the SpamAssassin service. You can do this using Jake&amp;#039;s [http://v2gnu.com/qmail/spamd.html spamd script] or by doing:&lt;br /&gt;
&lt;br /&gt;
    # qmailctl stop&lt;br /&gt;
    # qmailctl start&lt;br /&gt;
&lt;br /&gt;
=== Bayesian Statistical Scoring ===&lt;br /&gt;
&lt;br /&gt;
SpamAssassin can score messages based on the words in a message because certain words are more probable to turn up in spam and others are more probable to show up in ham.&lt;br /&gt;
&lt;br /&gt;
In order for this to be effective you need to train Spam Assassin. You will need a collection of spam messages and a collection of ham messages. You can do this by setting up a couple of email accounts on your server called spam@yourqmailtoaster.com and notspam@yourqmailtoaster.com. Forward all your spam mail to one and non-spam mail to the other, alright you might not want to forward &amp;#039;&amp;#039;all&amp;#039;&amp;#039; of your real mail to it but the more ham Spam Assassin has for comparison, the better. You should encourage your users to forward spam to the spam address and any false positives to the not-spam address. You might want to implement [http://www.squirrelmail.org/plugin_view.php?id=242 Squirrelmail Spam Buttons] to make this easier.&lt;br /&gt;
&lt;br /&gt;
Now create a script that looks like this:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # Spam Assassin Bayes Training&lt;br /&gt;
&lt;br /&gt;
 # Learn spam!&lt;br /&gt;
 DOMAIN=yourdomain&lt;br /&gt;
 SPAM=your-spam-address&lt;br /&gt;
 HAM=your-ham-address&lt;br /&gt;
&lt;br /&gt;
 cd /home/vpopmail/domains/$DOMAIN/$SPAM/Maildir/cur&lt;br /&gt;
 /usr/bin/sa-learn --spam ./*&lt;br /&gt;
 rm -rf /home/vpopmail/domains/$DOMAIN/$SPAM/Maildir/cur/*&lt;br /&gt;
&lt;br /&gt;
 cd /home/vpopmail/domains/$DOMAIN/$SPAM/Maildir/new&lt;br /&gt;
 /usr/bin/sa-learn --spam ./*&lt;br /&gt;
 rm -rf /home/vpopmail/domains/$DOMAIN/$SPAM/Maildir/new/*&lt;br /&gt;
&lt;br /&gt;
 # Learn ham!&lt;br /&gt;
 cd /home/vpopmail/domains/$DOMAIN/$HAM/Maildir/cur&lt;br /&gt;
 /usr/bin/sa-learn --ham ./*&lt;br /&gt;
 rm -rf /home/vpopmail/domains/$DOMAIN/$HAM/Maildir/cur/*&lt;br /&gt;
 cd /home/vpopmail/domains/$DOMAIN/$HAM/Maildir/new&lt;br /&gt;
 /usr/bin/sa-learn --ham ./*&lt;br /&gt;
 rm -rf /home/vpopmail/domains/$DOMAIN/$HAM/Maildir/new/*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Test it and use cron to run the script daily.&lt;br /&gt;
&lt;br /&gt;
NOTE: just to belabor the point a bit more, this script deletes all the mail in the ham and spam directories.  Do not just run this on your own inbox!&lt;br /&gt;
&lt;br /&gt;
==== Use bounce a message to feed SA bayes ====&lt;br /&gt;
Jack Vickers&amp;#039; info per 2 Aug 2007:&lt;br /&gt;
&lt;br /&gt;
Having the users forward the messages to an account like that is &amp;quot;a bad thing to do&amp;quot; according to the guys on the spamassassin mailing list.  You need to bounce the messages to those address, not forward.  By forwarding, programs like Outlook rewrite the headers, so your Bayes thinks that the spam messages are being sent from the user that is sending them. &lt;br /&gt;
&lt;br /&gt;
How to bounce/redirect mail&lt;br /&gt;
[[How to redirect/bounce mail for sa-learn]]&lt;br /&gt;
&lt;br /&gt;
=== Further Info ===&lt;br /&gt;
&lt;br /&gt;
* SimScan is used by QMailToaster to run incoming mail through ClamAV and SpamAssassin. It is configured by the settings in /var/qmail/control/simcontrol. See [[Simscan]] for more details.&lt;br /&gt;
* The SpamAssassin daemon is started by the /var/qmail/supervise/spamd/run script. man spamd for other options you can set in here.&lt;br /&gt;
* SpamAssassin can be set up to check the body of messages against Spam URI Realtime Blocklists. See [[SURBL]] for more details.&lt;br /&gt;
* You can also check incoming mail against Realtime Black Lists before the mail even reaches SpamAssassin. See [[RBLs]] for more details.&lt;br /&gt;
&lt;br /&gt;
=== How to reset Spam Assassin Bayes Training ===&lt;br /&gt;
&lt;br /&gt;
You can do any of the following commands:&lt;br /&gt;
&lt;br /&gt;
 # su vpopmail -c &amp;#039;sa-learn --clear&amp;#039;&lt;br /&gt;
&lt;br /&gt;
if you don&amp;#039;t give user vpopmail a valid shell is:&lt;br /&gt;
&lt;br /&gt;
 # sudo -H -u vpopmail sa-learn --clear&lt;br /&gt;
&lt;br /&gt;
=== User Sumbitted Scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Multi-domain sa-learn ham/spam script ====&lt;br /&gt;
&lt;br /&gt;
Enhancement of the &amp;quot;Spam Assassin Bayes Training&amp;quot; script above.  But use at your own risk :)&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  ##&lt;br /&gt;
  ## Spam Assassin Bayes Training&lt;br /&gt;
  ##&lt;br /&gt;
  testrun=0 ## set to 1 to begin real-life use&lt;br /&gt;
  cd /home/vpopmail/domains/&lt;br /&gt;
  for i in *&lt;br /&gt;
    do&lt;br /&gt;
     echo -en &amp;quot;DOMAIN:\t$i\t&amp;quot;&lt;br /&gt;
     pre=$(echo $i | /bin/sed s/&amp;#039;\.&amp;#039;/&amp;#039;&amp;#039;/g)&lt;br /&gt;
     spampre=&amp;quot;$pre-spam&amp;quot; ## test.com ==&amp;gt; testcom-spam@test.com&lt;br /&gt;
     hampre=&amp;quot;$pre-ham&amp;quot;   ## test.com ==&amp;gt; testcom-ham@test.com&lt;br /&gt;
     ##&lt;br /&gt;
     ## Process SPAM for the current domain&lt;br /&gt;
     ##&lt;br /&gt;
     echo -en &amp;quot;\tS: &amp;quot;&lt;br /&gt;
     if [ -d $i/$spampre ]&lt;br /&gt;
       then&lt;br /&gt;
         spamcount=0;&lt;br /&gt;
         cd $i; cd $spampre; cd Maildir; cd cur&lt;br /&gt;
         for spam in $(/usr/bin/find ./ -type f)&lt;br /&gt;
           do&lt;br /&gt;
             let spamcount=$spamcount 1&lt;br /&gt;
             if [ $testrun -eq 0 ]&lt;br /&gt;
               then&lt;br /&gt;
                 /usr/bin/sudo -u vpopmail -H /usr/bin/sa-learn --spam $spam 1&amp;gt;/dev/null&lt;br /&gt;
                 rm -f $spam&lt;br /&gt;
             fi&lt;br /&gt;
         done&lt;br /&gt;
         cd ..&lt;br /&gt;
         cd new&lt;br /&gt;
         for spam in $(/usr/bin/find ./ -type f)&lt;br /&gt;
           do&lt;br /&gt;
             let spamcount=$spamcount 1&lt;br /&gt;
             if [ $testrun -eq 0 ]&lt;br /&gt;
               then&lt;br /&gt;
                 /usr/bin/sudo -u vpopmail -H /usr/bin/sa-learn --spam $spam 1&amp;gt;/dev/null&lt;br /&gt;
                 rm -f $spam&lt;br /&gt;
             fi&lt;br /&gt;
         done&lt;br /&gt;
         cd ..; cd ..; cd ..; cd ..&lt;br /&gt;
         echo -en $spamcount&lt;br /&gt;
       else&lt;br /&gt;
         echo -en &amp;quot;NA&amp;quot;&lt;br /&gt;
     fi&lt;br /&gt;
     ##&lt;br /&gt;
     ## Process HAM for the current domain&lt;br /&gt;
     ##&lt;br /&gt;
     echo -en &amp;quot;\tS: &amp;quot;&lt;br /&gt;
     if [ -d $i/$hampre ]&lt;br /&gt;
       then&lt;br /&gt;
         hamcount=0;&lt;br /&gt;
         cd $i; cd $hampre; cd Maildir; cd cur&lt;br /&gt;
         for ham in $(/usr/bin/find ./ -type f)&lt;br /&gt;
           do&lt;br /&gt;
             let hamcount=$hamcount 1&lt;br /&gt;
             if [ $testrun -eq 0 ]&lt;br /&gt;
               then&lt;br /&gt;
                 /usr/bin/sudo -u vpopmail -H /usr/bin/sa-learn --ham $ham 1&amp;gt;/dev/null&lt;br /&gt;
                 rm -f $ham&lt;br /&gt;
             fi&lt;br /&gt;
         done&lt;br /&gt;
         cd ..; cd new; for ham in $(/usr/bin/find ./ -type f)&lt;br /&gt;
           do&lt;br /&gt;
             let hamcount=$hamcount 1&lt;br /&gt;
             if [ $testrun -eq 0 ]&lt;br /&gt;
               then&lt;br /&gt;
                 /usr/bin/sudo -u vpopmail -H /usr/bin/sa-learn --ham $ham 1&amp;gt;/dev/null&lt;br /&gt;
                 rm -f $ham&lt;br /&gt;
             fi&lt;br /&gt;
         done&lt;br /&gt;
         cd ..; cd ..; cd ..; cd ..&lt;br /&gt;
         echo $hamcount&lt;br /&gt;
       else&lt;br /&gt;
         echo &amp;quot;NA&amp;quot;&lt;br /&gt;
     fi&lt;br /&gt;
  done&lt;br /&gt;
  ##&lt;br /&gt;
  ## Update the Bayes DB&lt;br /&gt;
  ##&lt;br /&gt;
  if [ $testrun -eq 0 ]&lt;br /&gt;
    then&lt;br /&gt;
      /usr/bin/sudo -u vpopmail -H /usr/bin/sa-learn --sync&lt;br /&gt;
      /usr/bin/sudo -u vpopmail -H /usr/bin/sa-learn -u vpopmail --force-expire 1&amp;gt;/dev/null&lt;br /&gt;
  fi&lt;/div&gt;</summary>
		<author><name>Ebroch</name></author>
	</entry>
</feed>