amavisd-new brings a cron job (/etc/cron.d/amavisd-new), which runs /usr/sbin/amavisd-new-cronjob every 3 hours as user 'amavis'. Changing the sa-sync and sa-clean actions to invoke sa-learn with --spam and --ham options (e.g., "--spam /var/vmail/*/*/Maildir/.Junk/*/*", "--ham /var/vmail/*/*/Maildir/cur/*") is simple. However, /var/vmail is vmail:vmail 700. What is the best way to integrate: run amavisd-new-cronjob as vmail instead of amavis? run amavisd-new-cronjob as root instead of amavis? figure out how the make /var/vmail vmail:amavis 750 for all adds/changes done via ISPConfig?
What comes to mind is use a bind mount to remap the vmail userid to amavis, then run sa-learn as amavis. See 'Remapping users and groups' under http://unix.stackexchange.com/questions/198590/what-is-a-bind-mount
There is little surprise that most issues have already been discussed, as most have found out after tenacious searching. I am not sure the issue is fully resolved by a thread on this very forum [1]; however, I want to add the cross linking, since all of the forum is indexed by google. I starting to wonder if amavis is the best approach. Christian Roessler's article [2] seems like an approach more like gMail. Of course, none of our ISPConfig installations rivals gMail. Still, a population of users marking as Junk, and having SA learn in real time these classifications, seems better than the /usr/sbin/amavisd-new-cronjob approach. [1] sa-learn-seems-not-to-work.52421 [2] spamassassin-dovecot-postfix.html