spamlearn, part two
After much reworking, I have updated my spamlearn script yet again.
NEW
You no longer need to specify a list of ham directories. It will automatically scan your $MAILDIR and seek out all folders. All you need to do is tell it which folder(s) to use as Junk, and optionally any folder(s) you don’t want imported as ham. I exclude Trash and the Apple Mail To Do folder, for example.
More complex and repetitive tasks have been moved into functions, and generally the code just looks a lot cleaner and is easier to read.
I’ve moved the 5 variables that most people would need to worry about to the top, with lesser altered variables below that. For a default amavis/spamassassin install, just changing the top 5 will make it work most of the time.
More code has been moved into tight routines, and unnecessary bits have been removed. Some options have been combined, for example, unsetting MAILTO, LOGFILE, or QUARANTINE will disable those features entirely. The verbose mode isn’t quite so verbose anymore since it has been migrated from it’s debugger origins. The log and mail report are now prettier, and adjustable timestamps have been added to all log entries.
All you absolutely need to change are the top 2 variables, but have a look at them all for your own adjustments.
