You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2019/07/30 07:28:05 UTC

svn commit: r1863980 - in /spamassassin: branches/3.4/lib/Mail/SpamAssassin/Message/Metadata.pm branches/3.4/lib/Mail/SpamAssassin/Plugin/TextCat.pm trunk/lib/Mail/SpamAssassin/Message/Metadata.pm trunk/lib/Mail/SpamAssassin/Plugin/TextCat.pm

Author: hege
Date: Tue Jul 30 07:28:04 2019
New Revision: 1863980

URL: http://svn.apache.org/viewvc?rev=1863980&view=rev
Log:
Update TextCat documentation a bit

Modified:
    spamassassin/branches/3.4/lib/Mail/SpamAssassin/Message/Metadata.pm
    spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TextCat.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/TextCat.pm

Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/Message/Metadata.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Message/Metadata.pm?rev=1863980&r1=1863979&r2=1863980&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Message/Metadata.pm (original)
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Message/Metadata.pm Tue Jul 30 07:28:04 2019
@@ -28,7 +28,7 @@ supplemental data inferred from the mess
 It is held in two forms:
 
 1. as name-value pairs of strings, presented in mail header format.  For
-  example, "X-Language" => "en".  This is the general form for simple
+  example, "X-Languages" => "en".  This is the general form for simple
   metadata that's useful as Bayes tokens, can be added to marked-up
   messages using "add_header", etc., such as the trusted-relay inference
   and language detection.

Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TextCat.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TextCat.pm?rev=1863980&r1=1863979&r2=1863980&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TextCat.pm (original)
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/TextCat.pm Tue Jul 30 07:28:04 2019
@@ -29,9 +29,10 @@ This plugin will try to guess the langua
 
 You can use the "ok_languages" directive to set which languages are
 considered okay for incoming mail and if the guessed language is not okay,
-C<UNWANTED_LANGUAGE_BODY> is triggered.
+C<UNWANTED_LANGUAGE_BODY> is triggered. Alternatively you can use the
+X-Languages metadata header directly in rules.
 
-It will always add the results to a "X-Language" name-value pair in the
+It will always add the results to a "X-Languages" name-value pair in the
 message metadata data structure. This may be useful as Bayes tokens and
 can also be used in rules for scoring. The results can also be added to
 marked-up messages using "add_header", with the _LANGUAGES_ tag. See
@@ -43,6 +44,14 @@ In that case, no action is taken.
 You can use _TEXTCATRESULTS_ tag to view the internal ngram-scoring, it
 might help fine-tuning settings.
 
+Examples of using X-Languages header directly in rules:
+
+ header OK_LANGS X-Languages =~ /\ben\b/
+ score OK_LANGS -1
+
+ header BAD_LANGS X-Languages =~ /\b(?:ja|zh)\b/
+ score BAD_LANGS 1
+
 =cut
 
 package Mail::SpamAssassin::Plugin::TextCat;

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata.pm?rev=1863980&r1=1863979&r2=1863980&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata.pm Tue Jul 30 07:28:04 2019
@@ -28,7 +28,7 @@ supplemental data inferred from the mess
 It is held in two forms:
 
 1. as name-value pairs of strings, presented in mail header format.  For
-  example, "X-Language" => "en".  This is the general form for simple
+  example, "X-Languages" => "en".  This is the general form for simple
   metadata that's useful as Bayes tokens, can be added to marked-up
   messages using "add_header", etc., such as the trusted-relay inference
   and language detection.

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/TextCat.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/TextCat.pm?rev=1863980&r1=1863979&r2=1863980&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/TextCat.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/TextCat.pm Tue Jul 30 07:28:04 2019
@@ -29,9 +29,10 @@ This plugin will try to guess the langua
 
 You can use the "ok_languages" directive to set which languages are
 considered okay for incoming mail and if the guessed language is not okay,
-C<UNWANTED_LANGUAGE_BODY> is triggered.
+C<UNWANTED_LANGUAGE_BODY> is triggered. Alternatively you can use the
+X-Languages metadata header directly in rules.
 
-It will always add the results to a "X-Language" name-value pair in the
+It will always add the results to a "X-Languages" name-value pair in the
 message metadata data structure. This may be useful as Bayes tokens and
 can also be used in rules for scoring. The results can also be added to
 marked-up messages using "add_header", with the _LANGUAGES_ tag. See
@@ -43,6 +44,14 @@ In that case, no action is taken.
 You can use _TEXTCATRESULTS_ tag to view the internal ngram-scoring, it
 might help fine-tuning settings.
 
+Examples of using X-Languages header directly in rules:
+
+ header OK_LANGS X-Languages =~ /\ben\b/
+ score OK_LANGS -1
+
+ header BAD_LANGS X-Languages =~ /\b(?:ja|zh)\b/
+ score BAD_LANGS 1
+
 =cut
 
 package Mail::SpamAssassin::Plugin::TextCat;