Apple’s Worldwide Developers Conference returns June 10, 2024

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

Server 5.4 SpamAssassin Bayesian files growing at enormous rate

Since updating from 10.12.6 / Server 5.3 to 10.13.2 / Server 5.4 (including conversion to APFS) the SpamAsassin files in /Library/Server/Mail/Data/scanner/amavis/.spamassassin are growing at an incredible rate. I have already experience 2 'disk full' situations due to files of the form bayes_toks.expire17447 occupying over 200 GB of disk space!


Does anyone have any idea what is going on and more importantly how to prevent this? I was not experiencing this under Server 5.3...


Apart from the OS and server updates, I have not changed any configuration parameters related to Mail.


For now I will have to disable Spam filtering and hope that stops this until I can find a real solution.

Mac mini, macOS Sierra (10.12.5), OS X Server 5.3

Posted on Dec 18, 2017 1:20 AM

Reply
Question marked as Best reply

Posted on Feb 1, 2018 6:45 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.

25 replies

Apr 1, 2018 5:13 AM in response to ChrisJenkins

I upgraded to macOS 10.13.4 and Server.app 5.6 to see if this issue has been fixed.


The binaries for spamassassin and newaliases haven't changed, which makes me skeptical.


Has anyone tested Server.app v5.6 to see if Apple fixed this problem with APFS and LMDB and/or Berkeley databases?


If Apple hasn't fixed this major bug in this version, I have concerns if it will ever be fixed, and leaving the last major Server.app version nonfunctional for major email and postfix features.


It's possible that the underlying libraries that break LMDB and APFS have been fixed, but I personally haven't checked yet, and still rely upon off-siting this bug to an HFS volume.

Apr 1, 2018 5:22 AM in response to essandess

I don't think those are the binaries that are doing it. I would test postmap or postalias. Copy your aliases or virtual_users files from /Library/Server/Mail/Config/postfix and run:


/Applications/Server.app/Contents/ServerRoot/usr/sbin/postmap virtual_users

or

/Applications/Server.app/Contents/ServerRoot/usr/sbin/postalias aliases


If it's quick, and the resulting virtual_users.db and aliases.db are close in size to their originals, it should be fixed.


Any chance /var/log/mail.log is fixed in 5.6?

Apr 1, 2018 8:27 AM in response to jaydisc

It's still broken under Server.app 5.6!


cp /Library/Server/Mail/Config/postfix/aliases /tmp

cd /tmp

newaliases -oA/tmp/aliases

ls -l /Library/Server/Mail/Config/postfix/aliases.db /tmp/aliases.db


-rw-r--r-- 1 root wheel 16384 Mar 14 15:23 /Library/Server/Mail/Config/postfix/aliases.db

-rw-r--r-- 1 username wheel 373293056 Apr 1 11:19 /tmp/aliases.db


It's a reasonable question if this bug will ever be fixed now.


It's also a reasonable question if macOS on APFS currently supports running an email server and other open source services.


Has anyone successfully compiled and run postfix tools on the latest macOS?


A decision must be made now about whether migration away from Server.app necessarily involves a migration from macOS.

Apr 1, 2018 3:22 PM in response to essandess

If you're using newaliases like that (without a full path), you're not definitely using the correct version that comes with macOS server. Use postalias, with the full path:


# /Applications/Server.app/Contents/ServerRoot/usr/sbin/postalias /tmp/aliases


I wonder how much Apple's commitment to APFS is what caused macOS Server's downfall. I guess they had/have a few choices:


1. Convince Postfix and other open source projects to support the new file system.

2. Update APFS to correctly handle this style of file system database.

3. Discontinue development of macOS Server.


Unfortunately, they chose 3. Maybe they pursued the others... who knows... who cares at this point.


I've updated my company to 5.5 with the belief that this gives me another 2-4 years before I have to decide where I'm shifting everything. The most likely thing I can guess right now, is that it won't be macOS. Getting dovecot/postfix/amavisd/clamav/spamassassin, and even OpenLDAP, running on Debian, isn't that hard. If I can't find a app cloud provider I trust (i.e. not Google), we'll likely continue to host, but move it to Debian. We could potentially virtualise that on top of macOS, but there's really no point in doing that.


> Has anyone successfully compiled and run postfix tools on the latest macOS?


Interestingly, the version that comes with the OS is newer than the one that comes with Server (at least 10.13.3/5.5):


# /Applications/Server.app/Contents/ServerRoot/usr/sbin/postconf -d | grep mail_version

mail_version = 3.1.1


# /usr/sbin/postconf -d | grep mail_version

mail_version = 3.2.2

Server 5.4 SpamAssassin Bayesian files growing at enormous rate

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