I guess the problem is that you try to learn all mailboxes at once (wildcards on several directory levels. You can e.g. try to add loop in your shell script and then feed the maldirs one by one to sa-learn.

I guess the problem is that you try to learn all mailboxes at once (wildcards on several directory levels. You can e.g. try to add loop in your shell script and then feed the maldirs one by one to sa-learn.

I was having the same issue and the resolution is SO SIMPLE it evaded me for a while. I found your post while looking for an answer and figured that I would help out. The answer is just a matter of using quotes...

I also wanted to expand further on this as I have sub folders and my email client auto-sorts by rules to help my mail stay tidy. Here is my whole script and a string that will run the entire process and email you the results! I just have a small server with a few users so this may not work so well on a larger email system and you may not want to email the results as the ham learning echos results for each dir scanned though that may be changeable however I haven't put the time into it yet.