<div dir="ltr">I posted the following message on ServerFault several days ago, but since it has gotten very little attention, I thought I would ask on this mailing list.<div><br></div><div>I'm trying to figure out a few things:</div><div>1) If SpamAssassin is configured properly and I'm editing the proper config files</div><div>2) How I can get the Bayes filter's headers into my emails (even if the Bayes filter isn't used)</div><div>3) How many messages (100 vs. 200) that Bayes has to be trained on (with sa-learn) and if that's ultimately the issue I'm experiencing right now.</div><div><br></div><div>Here's the original post below:<br><div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">I run a Postfix mailserver on CentOS, and am trying to enable Spamassassin's bayes filter, but I seem to be missing something.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">We're running amavisd-new 2.9.1:</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">Name : amavisd-new
Arch : noarch
Version : 2.9.1
Release : 2.el6
Size : 3.0 M
Repo : installed
>From repo : epel
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">.... with Spamassassin 3.3.1:</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">Installed Packages
Name : spamassassin
Arch : x86_64
Version : 3.3.1
Release : 3.el6
Size : 3.1 M
Repo : installed
>From repo : updates
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">From what I can tell, my only spamassassin config files are located in /etc/mail/spamassassin.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">The <a href="http://local.cf">local.cf</a> file in this directory contains the following:</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"># These values can be overridden by editing ~/.spamassassin/<a href="http://user_prefs.cf">user_prefs.cf</a>
# (see spamassassin(1) for details)
# These should be safe assumptions and allow for simple visual sifting
# without risking lost emails.
required_hits 5
report_safe 0
rewrite_header Subject [SPAM]
use_bayes 1
bayes_auto_learn 1
bayes_auto_expire 0
bayes_path /var/amavis/var/.spamassassin/
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">amavisd.conf is located in /etc/amavisd/, and I <em style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">think</em> I've included all of the configurations I need to in order to turn spamassassin "on" but I'm not positive.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">Some websites I've read indicate that the bayesian filter needs to be trained on 100 messages (for both spam and non-spam messages) using <code style="margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:pre-wrap;background:rgb(238,238,238)">sa-learn</code>, but I've seen at least 1 website indicating the filter needs to be trained on 200 messages. That said, I can confirm I've trained the filter on at least 100 spam messages.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">So now, whenever I receive an email, after training the filter on these 100 spam messages, I'm still seeing no indication in the mail headers that the baysian filter is being used:</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">X-Virus-Scanned: amavisd-new at <a href="http://developcents.com">developcents.com</a>
X-Spam-Flag: NO
X-Spam-Score: -0.525
X-Spam-Level:
X-Spam-Status: No, score=-0.525 tagged_above=-999 required=4
tests=[HK_RANDOM_FROM=1, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-2.499,
SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001] autolearn=unavailable
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">Even if bayes isn't fully trained and ready to be "used" yet, shouldn't I be seeing a tag in the X-Spam-Status section that indicates whether or not it's using the Bayes filter?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">(For what its worth, the email for which I've posted the partial mail header above, was spam, and obviously didn't get marked as such)</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">Is there something I'm missing?</p><div><br></div>-- <br><div dir="ltr"><div><div style="font-family:arial;font-size:small">David White</div><div style="font-family:arial;font-size:small">Founder & CEO<br></div><div style="font-family:arial;font-size:small"><b><br></b></div><div style="font-family:arial;font-size:small"><div><b>Develop CENTS </b><br></div><div>Computing, Equipping, Networking, Training & Supporting </div><div>Nonprofit Organizations Worldwide</div><div><a href="http://developcents.com/" style="color:rgb(17,85,204)" target="_blank">http://developcents.com</a></div></div></div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div></div>
</div></div></div>