<html><head>
<style id="css_styles" type="text/css"><!--blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: right;'] { list-style-position: inside;}
body { font-family: Tahoma; font-size: 12pt; }--></style></head><body class="plain"><div>Hi,</div><div><br /></div><div>Thanks again for the work put in here, i have been looking at your reply :-</div><div><br /></div><div>1. I would recommend removing the /var/spool/postfix/.spamassassin/user_prefs file and maybe even the entire .spamassassin dir to avoid any confusion. The MailScanner service script should be starting as user root to read all of it's configs then lowering it's privs by switching to the postfix user.</div>
<div><br /></div><div>i did this, and the folder was just recreated when i ran the command. I tried copying the user files from the root/.spamassassin folder that is mentioned in the good scan, but this had no effect</div><div><br /></div><div>2. In the bad run, something is trying to open /etc/mail/spamassassin/MailScanner.cf. Does that exist with an uppercase "M"? It's supposed to be "mailscanner.cf" in /etc/mail/spamassassin all lowercase.</div><div><br /></div><div>i checked the file, and it did exist with the capitalisation, interestingly i renamed it and the result log changed as well, but this had no effect on the result, so i changed it back again.</div><div><br /></div><div>3. You need to track down what is pointing to the MailScanner.cf with a "grep -rl MailScanner.cf *" from / or something.</div><div> These are two very different files but I think something is crossed up in your configs:</div><div>/etc/mail/spamassassin/mailscanner.cf</div><div>/etc/MailScanner/MailScanner.conf</div><div><br /></div><div>i have no idea how to do the grep thing, i'm a noob to linux, so i did nothing about this, i have a colleague who may help with this if needs be.</div><div><br /></div><div>So i was still no further forwards. i started comparing the results again, and noticed a difference in some lines above the user_prefs you mentioned.</div><div><br /></div><div><bad results></div><div><b>Jun 9 01:03:34.495 [27253] dbg: config: using "/etc/MailScanner/spamassassin.conf" for sys rules pre files</b></div><div><b>Jun 9 01:03:34.496 [27253] dbg: config: read file /etc/MailScanner/spamassassin.conf</b></div><div><b>Jun 9 01:03:34.496 [27253] dbg: config: using "/etc/MailScanner/spamassassin.conf" for default rules dir</b></div><div><b>Jun 9 01:03:34.497 [27253] dbg: config: read file /etc/MailScanner/spamassassin.conf</b></div><div>Jun 9 01:03:34.498 [27253] dbg: config: using "/etc/mail/spamassassin" for site rules dir</div><div>Jun 9 01:03:34.499 [27253] dbg: config: read file /etc/mail/spamassassin/MailScanner.cf</div><div>Jun 9 01:03:34.500 [27253] dbg: config: read file /etc/mail/spamassassin/local.cf</div><div>Jun 9 01:03:34.500 [27253] dbg: config: using "/var/spool/postfix/.spamassassin" for user state dir</div><div>Jun 9 01:03:34.501 [27253] dbg: config: using "/var/spool/postfix/.spamassassin/user_prefs" for user prefs file</div><div>Jun 9 01:03:34.502 [27253] dbg: config: read file /var/spool/postfix/.spamassassin/user_prefs</div><div><br /></div><div><Good results></div><div> <b>dbg: config: using "/var/lib/spamassassin/3.004001" for sys rules pre files</b></div><div><b> dbg: config: using "/var/lib/spamassassin/3.004001" for default rules dir</b></div><div><b> dbg: config: read file /var/lib/spamassassin/3.004001/updates_spamassassin_org.cf</b></div><div> dbg: config: using "/etc/mail/spamassassin" for site rules dir</div><div> dbg: config: read file /etc/mail/spamassassin/MailScanner.cf</div><div> dbg: config: read file /etc/mail/spamassassin/local.cf</div><div> dbg: config: using "/root/.spamassassin" for user state dir</div><div> dbg: config: using "/root/.spamassassin/user_prefs" for user prefs file</div><div> dbg: config: read file /root/.spamassassin/user_prefs</div><div><br /></div><div>This got me thinking and i found a load of NN_xxxxxxx.cf files in a folder beneath 3.004.001. i ended up copying these to the /etc/mail/Spamassassin folder. and now i have it working.</div><div><br /></div><div>i don't think this is the correct solution, but it will hopefully point to the correct solution.</div><div><br /></div><div>in the meantime thanks again for the help</div><div><br /></div><div><br /></div><div><br /></div>
<div>------ Original Message ------</div>
<div>From: "David Jones via MailScanner" <mailscanner@lists.mailscanner.info></div>
<div>To: mailscanner@lists.mailscanner.info</div>
<div>Cc: "David Jones" <djones@ena.com></div>
<div>Sent: 08/06/2018 22:32:48</div>
<div>Subject: Re: Mailscanner - Spamassassin Issue</div><div><br /></div>
<div id="xf48c4abba81f41d"><blockquote type="cite" class="cite2">
<div>On 06/08/2018 03:25 PM, Toby wrote:</div>
<blockquote type="cite" class="cite">
<div>Apologies, all public now</div>
<div> </div>
<div>------ Original Message ------</div>
<div>From: "David Jones via MailScanner" <mailscanner@lists.mailscanner.info></div>
<div>To: mailscanner@lists.mailscanner.info</div>
<div>Cc: "David Jones" <djones@ena.com></div>
<div>Sent: 08/06/2018 20:45:20</div>
<div>Subject: Re: Mailscanner - Spamassassin Issue</div>
<div> </div>
<blockquote type="cite" class="cite2">
<div>On 06/08/2018 02:21 PM, Toby wrote:</div>
<blockquote type="cite" class="cite">
<div>Hi,</div>
<div> </div>
<div>Thanks for the replies, and the efforts so far.</div>
<div> </div>
<div>I checked the MailScanner.Conf, and it using postfix as the user and group.</div>
<div> </div>
<div>i have created several pastebins:-</div>
<div> </div>
<div>1: https://pastebin.com/07HcxD72 - Mailscanner --Version</div>
<div> </div>
<div>2: https://pastebin.com/eh3XmfWb - MailScanner --lint</div>
<div> </div>
<div>3: https://pastebin.com/J6d8GBB4 - MailScanner.conf</div>
<div> </div>
<div>4: https://pastebin.com/XAjrPftG - Spamassassin.conf</div>
<div> </div>
<div>5: https://pastebin.com/BmTnp5SL - Best scan results acheived with "sudo -u root -p -c spamassassin -D -t Testy.eml" - Score 9</div>
<div> </div>
<div>6: https://pastebin.com/dLi6QKjU - Successfull scan as described previously "sudo -u postfix -p -c spamassassin -D -t Testy.eml" - score 7.4</div>
<div> </div>
<div>7: https://pastebin.com/yhwrbb2G - Failed results as previously described "sudo -u postfix -p -c spamassassin -D -t -C /etc/MailScanner/spamassassin.conf Testy.eml" - score 0</div>
<div> </div>
<div>8: https://pastebin.com/PtC30M5U - Defaults file from MailScanner</div>
<div> </div>
<div> </div>
<div>Hope this is enough to go forwards. As you can see i get different results for the same user, depending on whether i declare the mailscanner/spamassassin.conf file</div>
<div> </div>
</blockquote>
</blockquote>
</blockquote>
<div> </div>
<div>If you search for "user_prefs" in those 2 "spamassassin -D" runs you will see that it's using 2 different preferences file. That is the difference. Near the bottom of those runs you see that one is hitting BAYES_* while the lower score is not. That's the difference in the good scores.</div>
<div> </div>
<div>I would recommend removing the /var/spool/postfix/.spamassassin/user_prefs file and maybe even the entire .spamassassin dir to avoid any confusion. The MailScanner service script should be starting as user root to read all of it's configs then lowering it's privs by switching to the postfix user.</div>
<div> </div>
<div>In the bad run, something is trying to open /etc/mail/spamassassin/MailScanner.cf. Does that exist with an uppercase "M"? It's supposed to be "mailscanner.cf" in /etc/mail/spamassassin all lowercase.</div>
<div> </div>
<div>You need to track down what is pointing to the MailScanner.cf with a "grep -rl MailScanner.cf *" from / or something.</div>
<div> </div>
<div>These are two very different files but I think something is crossed up in your configs:</div>
<div>/etc/mail/spamassassin/mailscanner.cf</div>
<div>/etc/MailScanner/MailScanner.conf</div>
<div> </div>
<div>-- David Jones</div>
<div> </div>
<div> </div>
<div>-- MailScanner mailing list</div>
<div>mailscanner@lists.mailscanner.info</div>
<div>http://lists.mailscanner.info/mailman/listinfo/mailscanner</div>
<div> </div>
</blockquote></div>
</body></html>