Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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)

Posted on Feb 1, 2018 6:21 AM

Reply
Question marked as Best reply

Posted on Feb 1, 2018 6:40 PM

I confirm other reports of this problem that amavisd and spamassassin are incompatible with APFS volumes.


Moving the .spamassassin file to an HDFS+ volume fixes the issue:


sudo rm -fr /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo mkdir -p /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo ln -s /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner/amavis/.spamassassin /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo chown -R _amavisd:_amavisd /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner

sudo chmod 770 /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner

sudo chown -h _amavisd:_amavisd /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo chmod -h 770 /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/spamassassin/sa_learn. pl

sudo ls -lH /Library/Server/Mail/Data/scanner/amavis/.spamassassin


total 2512

lrwxr-xr-x 1 _amavisd _amavisd 54 Feb 1 21:03 .spamassassin -> /Library/Server/Mail/Data/scanner/amavis/.spamassassin

-rw-------+ 1 root _amavisd 32768 Feb 1 21:26 bayes_seen

-rw-------+ 1 root _amavisd 1249280 Feb 1 21:26 bayes_toks


This also works with a spam/ham in the junkmail/notjunkmail folders.


Other mentions of this issue:


Please file bug reports.

Similar questions

1 reply
Question marked as Best reply

Feb 1, 2018 6:40 PM in response to essandess

I confirm other reports of this problem that amavisd and spamassassin are incompatible with APFS volumes.


Moving the .spamassassin file to an HDFS+ volume fixes the issue:


sudo rm -fr /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo mkdir -p /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo ln -s /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner/amavis/.spamassassin /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo chown -R _amavisd:_amavisd /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner

sudo chmod 770 /Volumes/Macintosh\ HD/Library/Server/Mail/Data/scanner

sudo chown -h _amavisd:_amavisd /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo chmod -h 770 /Library/Server/Mail/Data/scanner/amavis/.spamassassin

sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/spamassassin/sa_learn. pl

sudo ls -lH /Library/Server/Mail/Data/scanner/amavis/.spamassassin


total 2512

lrwxr-xr-x 1 _amavisd _amavisd 54 Feb 1 21:03 .spamassassin -> /Library/Server/Mail/Data/scanner/amavis/.spamassassin

-rw-------+ 1 root _amavisd 32768 Feb 1 21:26 bayes_seen

-rw-------+ 1 root _amavisd 1249280 Feb 1 21:26 bayes_toks


This also works with a spam/ham in the junkmail/notjunkmail folders.


Other mentions of this issue:


Please file bug reports.

Server.app v5.5 amavisd and spamassassin filling hard drive, crashing server every night

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.