Server.app v5.5 amavisd and spamassassin filling hard drive, crashing server every night
The latest Server.app v5.5 (and prior v5.4) crash my server every night because amavisd/spamassassin junk mail filtering fills the hard drive with an enormous spamassassin bayes_toks file
/Library/Server/Mail/Data/scanner/amavis/.spamassassin/bayes_toks
This solution may help, but it's not working for me, at least when the network accounts "junkmail" and "notjunkmail" exists and have mailboxes.
Does anyone have a solution to this problem? Adding a few small spam/ham examples to junkmail/notjunkmail (or even if these inboxes are empty) creates a bayes_tokes file of hundreds of Gigabytes.
FWIW, here's what I've tried:
1. (following Re: _amavisd/perl5.18 eating up disk space)
- Server.app>Mail> turn off junk mail filtering
- sudo bash -c 'rm /Library/Server/Mail/Data/scanner/amavis/.spamassassin/*'
- sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/sa-learn --force-expire
- sudo chgrp -R _amavisd /Library/Server/Mail/Data/scanner
- sudo find /Library/Server/Mail/Data/scanner -type d -exec sudo chmod g+rwx {} ';'
- sudo find /Library/Server/Mail/Data/scanner -type f -exec sudo chmod g+rw {} ';'
- Server.app>Mail> turn on junk mail filtering
- Add some junk, not junk to junkmail/notjunkmail
- Following the launchd plist /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.a pple.salearn.plist,
- sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/spamassassin/sa_learn. pl
$ sudo ls -l /Library/Server/Mail/Data/scanner/amavis/.spamassassin/
total 66306944
-rw------- 1 root _amavisd 30 Feb 1 08:56 bayes.lock
-rw------- 1 root _amavisd 108212 Feb 1 08:56 bayes_journal.old
-rw-rw---- 1 _amavisd _amavisd 75497472 Feb 1 09:14 bayes_seen
-rw-rw---- 1 _amavisd _amavisd 33894170624 Feb 1 09:15 bayes_toks
bayes_toks will grow without stopping until the server crashes. And the launch daemon com.apple.salearn.plist ensures that this command will run every few hours. It can be unloaded, but some other Server.app service just loads it back again.
These attempts also all fail:
These attempts to fix the problem all fail:
sudo launchctl unload /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.a pple.salearn.plist
[Launch daemon is automatically relaunched]
sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/sa-learn --clear
[bayes.lock prevents file removal, server never recovers from full disk.]
Delete and Recreate Network Accounts "junkmail" and "notjunkmail"
[Problem persists.]
sudo serveradmin set mail:imap:junk_mail_userid = "junkmail-thishasabug"
sudo serveradmin set mail:imap:not_junk_mail_userid = "notjunkmail-thishasabug"
[These settings are not kept by serveradmin.]
Server.app>Users> Disable Mail access to junkmail and notjunkmail accounts.
[Problem persists.]
Mac mini, macOS High Sierra (10.13.3)