<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal" align="center" style="text-align:center"><a name="_jsPrependBmk_"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">OFFICIAL</span></a><a name="_jsPrependBmkEnd_"></a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoPlainText">Ryan Lindsay via MIMEDefang wrote:<o:p></o:p></p>
<p class="MsoPlainText">> We run 4 mail servers with the same version of sendmail and mimedefang
<o:p></o:p></p>
<p class="MsoPlainText">> on them.<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> Running on RHEL 8.10<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> sendmail-milter-8.15.2-34.el8.x86_64<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> mimedefang-3.4.1-1.el8.x86_64<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> We basically use the servers to add the boilerplate water mark to our
<o:p></o:p></p>
<p class="MsoPlainText">> email.<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> On one of the servers, I?ve noticed this error re-occurs fairly
<o:p></o:p></p>
<p class="MsoPlainText">> regularly<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> Feb? 4 12:14:37 prod-vmail02.aipo.gov.au<o:p></o:p></p>
<p class="MsoPlainText">> mimedefang-multiplexor[1978037]: 5141ER2q1989140: Worker 0 stderr:
<o:p></o:p></p>
<p class="MsoPlainText">> bayes: cannot open bayes databases /var/spool/MD-Quarantine/.sp<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> Feb? 4 12:14:37 prod-vmail02.aipo.gov.au<o:p></o:p></p>
<p class="MsoPlainText">> mimedefang-multiplexor[1978037]: 5141ER2q1989140: Worker 0 stderr:
<o:p></o:p></p>
<p class="MsoPlainText">> amassassin/bayes_* R/W: lock failed: File exists<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> I?m a little stumped by this as I?m not sure what it?s telling me.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">It's been a while since I used file-based global/shared Bayes on any appreciable scale, but IIRC this is a "normal expected" error. It's not really anything do to with MIMEDefang, it comes from SpamAssassin's Bayes module.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">In the default setup with MIMEDefang, SpamAssassin locks and unlocks a global file-based Bayes DB on each request, but under load will trigger this error pretty regularly as each request updates various fields and records in the Bayes
DB. It will trigger more often if you have left it using autolearn or running auto-expiry of Bayes tokens as this will happen opportunistically whenever the DB crosses one of the relevant thresholds.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">It's only a "problem" if you expect to use autolearn, expect to rely on the default expiry handling for Bayes tokens, or absolutely can't have ignored errors in your logs.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">> [root@prod-vmail02 .spamassassin]# ls -lah<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> total 4.2G<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> drwx------. 2 defang defang?? 57 Feb? 4 12:25 .<o:p></o:p></p>
<p class="MsoPlainText">> drwxr-x---. 3 defang defang?? 26 May 16? 2023 ..<o:p></o:p></p>
<p class="MsoPlainText">> -rw-------. 1 defang defang?? 33 Feb? 4 12:25 bayes.lock -rw-------. 1
<o:p></o:p></p>
<p class="MsoPlainText">> defang defang 320M Feb? 4 10:39 bayes_seen -rw-rw-rw-. 1 defang defang
<o:p></o:p></p>
<p class="MsoPlainText">> 5.0G Feb? 4 12:25 bayes_toks<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Yikes. That's pretty huge for bayes_toks. For comparison, the SA filter cluster I maintain has settled in at just over 100M of MySQL table, after years of fine-tuning Bayes and starting with a token limit of IIRC ~~20x the default,
nudged down over time to ~10x the default.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">>> Okey. Good to know. <o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">What are your bayes_* settings in your SA configuration?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">>> They were pretty much non existent. I don’t know who set this up before. But everything is using whatever the defaults were<o:p></o:p></p>
<p class="MsoPlainText">>> So I have now got these set<o:p></o:p></p>
<p class="MsoPlainText">bayes_learn_to_journal 1<o:p></o:p></p>
<p class="MsoPlainText">bayes_auto_expire 1<o:p></o:p></p>
<p class="MsoPlainText">auto_learn 1<o:p></o:p></p>
<p class="MsoPlainText">bayes_journal_max_size 50000000<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Are you running sa-learn --force-expire from cron or similar, or just letting SA's default Bayes expiry handling do its thing?<o:p></o:p></p>
<p class="MsoPlainText">>> Looks like we weren’t doing either. <o:p></o:p></p>
<p class="MsoPlainText">>> But I’m happy to try and get auto expire to do it..<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">If you're not intentionally or knowingly using SpamAssassin for anything, you should either uninstall it (so MD doesn't detect and use<o:p></o:p></p>
<p class="MsoPlainText">it) or at least disable it in MD (since SA may be a dependency and rpm will complain if you try to remove it).<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">>> So SA I think was installed just to provide some API between mimedefang and sendmail. The actual SA process is disabled.
<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">If you want to keep SA, I'd advise moving your Bayes DB into at least SQL, or better, Redis. This will also allow you to share the Bayes DB between hosts.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">>> We probably don’t need to use Bayes at all. We are just using mimedefang to water mark our email. It is then relayed through another system that does spam/av scans<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-kgd<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>