_amavisd/perl5.18 eating up disk space

Clean installed os x 10.13 and Server 5.4 a week ago on a new 500 GB SSD - migrated data from previous 10.12.6 server. Everything worked great - smooth sailing. But this morning I spotted a problem: the SSD gets filled up at a rate at about 40 GB a day. Apparently a perl5.18 process started by user _amavisd is causing a lot of disk writing and when I turn off "Enable junk mail filtering" in mail settings, the disk writing stops.


Question: My first priority is regaining disk space. I have no idea what kind of files have been written by perl5.18 or where they might be located. I've looked in /cores; no files here. Where and what kind of files should I look for?


Thanks,

Peter

Mac mini, macOS High Sierra (10.13), Server 5.4

Posted on Oct 5, 2017 1:16 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 6, 2017 11:54 PM

Finally figured out what was going on: spamassassin had generated a lot of bayes_toks.expire files in /Library/Server/Mail/Data/scanner/amavis/.spamassassin/ like these:


-rw------- 1 _amavisd _amavisd 17918066688 5 Okt 20:05 bayes_toks.expire1256

-rw------- 1 _amavisd _amavisd 17226006528 5 Okt 20:12 bayes_toks.expire1257

-rw------- 1 _amavisd _amavisd 21760049152 4 Okt 16:06 bayes_toks.expire18755


Deleting these files fixed the disk space problem.

14 replies
Question marked as Top-ranking reply

Oct 6, 2017 11:54 PM in response to P_Reventlow

Finally figured out what was going on: spamassassin had generated a lot of bayes_toks.expire files in /Library/Server/Mail/Data/scanner/amavis/.spamassassin/ like these:


-rw------- 1 _amavisd _amavisd 17918066688 5 Okt 20:05 bayes_toks.expire1256

-rw------- 1 _amavisd _amavisd 17226006528 5 Okt 20:12 bayes_toks.expire1257

-rw------- 1 _amavisd _amavisd 21760049152 4 Okt 16:06 bayes_toks.expire18755


Deleting these files fixed the disk space problem.

Oct 28, 2017 4:40 AM in response to mmoeling

I might have found a solution, now time will tell if it is a final solution:


I stopped the Mail service and deleted all files from:


sudo rm /Library/Server/Mail/Data/scanner/amavis/.spamassassin/*


Then I started mail again and ran the following command:


sudo sa-learn --force-expire


read the explanation with:

man sa-learn


after letting it run for an hour:


-rw------- 1 _amavisd _amavisd 171966464 Oct 28 12:32 bayes_seen

-rw------- 1 root _amavisd 88080384 Oct 28 12:32 bayes_toks


Which seems hopefull, as --force-expire also includes a --sync (from the manual) this behaviour might be caused by a missing step in the update process of Server.App to Version 5.4 (17S1207).


Again I am not sure yet if this is the whole story, the feeling on this side is that if it is not the solution, it is close!

Nov 5, 2017 8:45 AM in response to P_Reventlow

I had this problem, it got so bad that it ended up causing the server to corrupt the OpenDirectory database!


The way I solved it was.


1. Go to Server and uncheck spam filtering, (no need to stop mail).

2. Delete spam databases sudo rm /Library/Server/Mail/Data/scanner/amavis/.spamassassin/*

3. sudo sa-learn --force-expire

4. Set permissions to allow group readwrite access for _amavisd to /Library/Server/Mail/Data/scanner and all files below.

5 Turn spam filtering back on in server.


I'm not sure if all the steps are necessary but this is why I did each step.


Turning spam filtering off and back on again means that the server app has to write to the config files, it is just possible that disabling and re-enabling causes a setting missing from the file from the previous version to be written to the file when re-enabling.


Deleting spam databases is obviously in case the database has become corrupted in some way or the format has changed between versions and the old format is not being read properly.


The default permissions were to allow only amavisd to read and write files. I'm not sure if there are any other system processes that perhaps need to access the files such as a rotation script, so allowing group access ensures any other process that is a member of the _amavisd group can access the files.


It has been working for me now without error for 3 days.

Oct 28, 2017 7:25 AM in response to mmoeling

My next move was to back-up and restore:



First become _amavisd user:


sudo bash

su _amavisd


Backup:


sa-learn -D --backup > bayes.bck


Restore:

sa-learn -D --restore bayes.bck


I got lots of messages:

Oct 28 15:39:05.399 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.412 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.424 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.437 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.452 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.540 [37985] dbg: bayes: unknown seen flag (5fa9e4a2d60d608e1aea94f1171448b5a4830880@sa_generated_) for line: s 5fa9e4a2d60d608e1aea94f1171448b5a4830880@sa_generated_, skipping

Oct 28 15:39:05.617 [37985] dbg: bayes: unknown seen flag (72f221a511e76354ad4c0b94d32a88312634bb4e@sa_generated_) for line: s 72f221a511e76354ad4c0b94d32a88312634bb4e@sa_generated_, skipping

Oct 28 15:39:05.694 [37985] dbg: bayes: unknown seen flag (20b1dc46e7e87fd013eac87e8813bdfab20abb32@sa_generated_) for line: s 20b1dc46e7e87fd013eac87e8813bdfab20abb32@sa_generated_, skipping

Oct 28 15:39:05.771 [37985] dbg: bayes: unknown seen flag (e0081db86fbe49cb18fc790a22dd7c4f21cf76d0@sa_generated_) for line: s e0081db86fbe49cb18fc790a22dd7c4f21cf76d0@sa_generated_, skipping


lets see if this helps..

Oct 28, 2017 6:58 AM in response to mmoeling

My next move was to back-up and restore:



First become _amavisd user:


sudo bash

su _amavisd


Backup:


sa-learn -D --backup > bayes.bck


Restore:

sa-learn -D --restore bayes.bck


I got lots of messages:

Oct 28 15:39:05.399 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.412 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.424 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.437 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.452 [37985] dbg: bayes: token has zero spam and ham count, skipping

Oct 28 15:39:05.540 [37985] dbg: bayes: unknown seen flag (5fa9e4a2d60d608e1aea94f1171448b5a4830880@sa_generated_) for line: s 5fa9e4a2d60d608e1aea94f1171448b5a4830880@sa_generated_, skipping

Oct 28 15:39:05.617 [37985] dbg: bayes: unknown seen flag (72f221a511e76354ad4c0b94d32a88312634bb4e@sa_generated_) for line: s 72f221a511e76354ad4c0b94d32a88312634bb4e@sa_generated_, skipping

Oct 28 15:39:05.694 [37985] dbg: bayes: unknown seen flag (20b1dc46e7e87fd013eac87e8813bdfab20abb32@sa_generated_) for line: s 20b1dc46e7e87fd013eac87e8813bdfab20abb32@sa_generated_, skipping

Oct 28 15:39:05.771 [37985] dbg: bayes: unknown seen flag (e0081db86fbe49cb18fc790a22dd7c4f21cf76d0@sa_generated_) for line: s e0081db86fbe49cb18fc790a22dd7c4f21cf76d0@sa_generated_, skipping


lets see if this helps..

Oct 26, 2017 2:57 PM in response to jjennings089

I have this problem too and have investigated this a bit.


You can do the following:


open Activity Monitor.app and go to the disk tab. Sort on the "bytes written" so that the large numbers are on top by blocking on the column header. there will be 1 (or 2 in my case) perl5.18 proccesses running as the _amavis user column. You might have to resize columns or scroll right a bit. Leave Activity monitor open and check the "Bytes Written" column from time to time. The sizes shown there seem to be the "lost" disk space in that time.


I have no clue in why amavis is growing my bayes_toks with ~ 60GB a day, but is really annoying to stop mail, delete the bases_toks file an start the Mail service again.


In the Process I have cleared all data/apps possible in a continuous struggle with a Disk (SSD) Filling op to 100% ever so quick as I could make space for a functioning computer. I should have probably used the safe mode to search for big files. I must admit that the first problem was a lot of large "expire" files I deleted.

I will post there.


For me this started after upgrading a server which started (2011 mini, 16GB RAM and 2,5" SSD) with "Lion + Server" and has been upgraded ever since without any reinstall, I have had my fair deal of "upgrade issues", never ever caused any by the changes i made in a lot of config files, which migrated perfectly over all those versions. Apple does a great job with Server.App but they always seem to hit me in the face with one annoying issue as a special gift on every upgrade 😟. To High Sierra and lates Server.App which comes with it.


I am capable of researching this, although I would need to dig into why amavis is acting up, I have other demanding jobs at the moment. Just for now I keep deleting bayes_toks. A search for "bayes_toks huge" shows that this might be a amavis originated bug. Maybe dig into that will be my next move.


One last thing is I have now 3 Perl5.18 by user _amavisd processes.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

_amavisd/perl5.18 eating up disk space

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