Hey guys, I've recently implemented a new Zimbra server at my workplace, and its been a mostly delightful experience. Its only now, a few weeks later which I've found a problem which I can't solve by scouring these forums or the wiki.

We have about 30 users, all running Outlook 2003 or Outlook 2007 through IMAP. No one uses the web mail interface (yet). I'm interested in getting SpamAssassin all trained up as soon as possible. I thought the best way to do this would be to run a crontab job and zmtrainsa across each account during the night.

Admittedly, I'm no scripting magician, and I'm having trouble getting a script to work for this purpose. The draft script I wrote is as follows:
for account in zmprov gaa -v domain.com
  zmtrainsa $account spam Junk
  zmtrainsa $account spam "Junk E-Mails"
The reason I want it to train on "Junk E-Mails" is that each account has that as an IMAP folder (from when I used the .pst importer), and Outlook still seems to dump the junk into that folder when a user right clicks on an email and says it is junk. This script obviously has problems (zmtrainsa needing to be run from the zimbra user being one).

I was wondering if anyone would be kind enough to give me some pointers? (I imagine a chmod on zmtrainsa would be a good place to start).

Kind Regards,