CLI zmtrainsa

Revision as of 15:19, 10 October 2007 by Mmorse (talk | contribs)


This command is used to train the anti-spam filter. This command is run automatically every night to train the SpamAssasin filter from messages users mark as “junk” “not junk” from their mailbox. See Zimbra MTA, Anti-Spam Training Filters.

You need at least 200 spam & 200 not-spam to enable the bayes filter. You can use this command to manually send one account’s mail through the spam filter.


zmtrainsa <server> <user> <spam|ham> [folder ]


zmtrainsa fetches the mail from <user> from <server> and trains the filter as either spam or ham <spam|ham>. The folder is optional. If a folder is not defined, the contents of the Inbox is fetched. (You may also be fine with leaving off server in a single-server setup.)

in 4.5.6 the user's password is no longer needed:

Usage is : su zimbra /opt/zimbra/bin/zmtrainsa spam|ham folderName

No Password required. Server name required if in a multi-server install. For 'user' put email address.

That was

(I do not remember if 4.5.5 actually got that before it was verified in 4.5.6 - check the release dates.

Prior to 4.5.4: zmtrainsa <server> <user> <pass> <spam|ham>

Jump to: navigation, search