CLI zmtrainsa: Difference between revisions

m (Adding categories)
(Updating content to ZCS 6.0)
Line 1: Line 1:
==<font size="4" color="#00007f" face="Arial"> ''' zmtrainsa ''' </font>==
For the most recent information on this CLI, including syntax and description, see [http://www.zimbra.com/docs/ne/latest/administration_guide/A_app-command-line.20.1.html ZCS Administrator's Guide Network Edition > Appendix A Command-Line Utilities].


<font size="3" color="#000000" face="Arial"> This command is used to train the anti-spam filter; it is run automatically every night (on the spam.random@domain.com & ham.random@domain.com accounts) to train the SpamAssasin filter from messages users mark as “junk” or “not junk” from their mailbox. See [[Zimbra_MTA#Anti-Spam_Training_Filters]] for a longer description</font>
=ZCS 6.0.x=
*[http://bugzilla.zimbra.com/show_bug.cgi?id=31510 Bug 31510] - New installs of ZCS will limit spam/ham cleanup to the first MTA installed.  '''zmlocalconfig -e zmtrainsa cleanup_host=TRUE''' can be set to allow additional hosts to run zmtrainsa --cleanup. At least one host should have this set to true.  


<font size="3" color="#000000" face="Arial">You need at least 200 spam & 200 not-spam to enable the bayes filter. </font>
==zmtrainsa==
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 [http://www.zimbra.com/docs/ne/latest/administration_guide/6_MTA.06.3.html#1076416 Anti-Spam Training Filters].


<font size="3" color="#000000" face="Arial">''You can use this command to manually send one account’s mail through the spam filter.'' </font>
The zmtrainsa command can be run manually to forward any folder from any mailbox to the spam training mailboxes. If you do not enter a folder name when you manually run zmtrainsa for an account, for spam, the default folder is Junk. For ham, the default folder is Inbox.  


===<font size="3" color="#00007f" face="Arial"> ''' Syntax ''' </font>===
===Syntax===
zmtrainsa <user> spam|ham [folder]


<font size="3" color="#000000" face=""Times New Roman""> '''zmtrainsa <server> <user> <spam|ham> [folder]''' </font>
=ZCS 5.0=
*[http://www.zimbra.com/docs/ne/5.0.19/administration_guide/A_app-command-line.18.40.html#1233228 ZCS Administrator's Guide Network Edition 5.0 > Appendix A Command-Line Utilities > zmtrainsa]


===<font size="3" color="#00007f" face="Arial"> ''' Description & Notes ''' </font>===
==5.0.2==
*zmtrainsa has no server argument in 5.0.2.


<font size="3" color="#000000" face="Arial">-Fetches the mail from <user> from <server> and trains the filter as either spam or ham <spam|ham>. </font>
=ZCS 4.5=
*[http://www.zimbra.com/docs/ne/4.5.10/administration_guide/A_app-command-line.14.24.html#1127260 ZCS Administrator's Guide Network Edition 4.5 > Appendix A Command-Line Utilities > zmtrainsa]


<font size="3" color="#000000" face="Arial">-If a folder is not defined, the contents of the Inbox is fetched.</font>
==4.5.6==
*As of 4.5.6 the user's password is no longer needed:


<font size="3" color="#000000" face="Arial">-Server name may be required if in a multi-server install.</font>
su zimbra
/opt/zimbra/bin/zmtrainsa user@domain.com spam|ham folderName


==Version Specific Notes==
(I do not remember if 4.5.5 actually got the no password required RFE before it was verified in 4.5.6 but it was relatively easy because zmspamextract (which used by zmtrainsa) already supported extracting messages from users' folders with admin auth credentials.)
===5.0.2===
zmtrainsa has no server argument in 5.0.2.
===4.5.6===
As of 4.5.6 the user's password is no longer needed:
  su zimbra
  /opt/zimbra/bin/zmtrainsa user@domain.com spam|ham folderName


(I do not remember if 4.5.5 actually got the no password required RFE before it was verified in 4.5.6 but it was relatively easy because zmspamextract (which used by zmtrainsa) already supported extracting messages from users' folders with admin auth credentials.
==Prior to 4.5.4==
Prior to 4.5.4: zmtrainsa <server> <user> <pass> <spam|ham>


===Prior to 4.5.4===
=Related Articles=
Prior to 4.5.4: zmtrainsa <server> <user> <pass> <spam|ham>
*[http://www.zimbra.com/docs/ne/latest/administration_guide/6_MTA.06.3.html#1076416 Anti-Spam Training Filters Anti-Spam Training Filters]
*[[Postfix_Policyd]]
*[[IP_Address_whitelisting]]
*[[Improving Anti-spam system]]
*[[IMAP and Outlook Spam training]]


{{Article_Footer|ZCS 4.5.x, 5.0.x|4/3/2006}}
{{Article_Footer|ZCS 4.5.x, 5.0.x|4/3/2006}}


[[Category:Anti-Spam]]
[[Category:Command Line Interface]]
[[Category:Command Line Interface]]
[[Category:ZCS 6.0]]
[[Category:ZCS 5.0]]
[[Category:ZCS 5.0]]
[[Category:ZCS 4.5]]
[[Category:ZCS 4.5]]

Revision as of 00:02, 6 January 2010

For the most recent information on this CLI, including syntax and description, see ZCS Administrator's Guide Network Edition > Appendix A Command-Line Utilities.

ZCS 6.0.x

  • Bug 31510 - New installs of ZCS will limit spam/ham cleanup to the first MTA installed. zmlocalconfig -e zmtrainsa cleanup_host=TRUE can be set to allow additional hosts to run zmtrainsa --cleanup. At least one host should have this set to true.

zmtrainsa

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 Anti-Spam Training Filters.

The zmtrainsa command can be run manually to forward any folder from any mailbox to the spam training mailboxes. If you do not enter a folder name when you manually run zmtrainsa for an account, for spam, the default folder is Junk. For ham, the default folder is Inbox.

Syntax

zmtrainsa <user> spam|ham [folder]

ZCS 5.0

5.0.2

  • zmtrainsa has no server argument in 5.0.2.

ZCS 4.5

4.5.6

  • As of 4.5.6 the user's password is no longer needed:
su zimbra
/opt/zimbra/bin/zmtrainsa user@domain.com spam|ham folderName

(I do not remember if 4.5.5 actually got the no password required RFE before it was verified in 4.5.6 but it was relatively easy because zmspamextract (which used by zmtrainsa) already supported extracting messages from users' folders with admin auth credentials.)

Prior to 4.5.4

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

Related Articles

Verified Against: ZCS 4.5.x, 5.0.x Date Created: 4/3/2006
Article ID: https://wiki.zimbra.com/index.php?title=CLI_zmtrainsa Date Modified: 2010-01-06



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search