🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.misc
Article #4324

40tude Dialog - Scoring/Actions Syntax

#4324
From: D
Date: Tue, 23 Jul 2024 16:28
266 lines
18231 bytes
40tude Dialog > Help [F1] > Index > Scoring syntax:
>Scoring/Actions Syntax
>Scoring and actions is one of Dialog's most powerful features. The syntax
>and actually most of the code is from Jurgen Haible's excellent local mail-
>and newsserver Hamster.
>What is Scoring?
>Scoring is the process of assigning a number between -9999 and +9999 to a
>message by applying scoring rules to the message. A scoring rule usually
>analyzes one header field of the message and if it this header field matches
>a certain text, a score value is assigned. For example, you can create a
>scoring rule that assign the highest score value +9999 to all messages that
>have your email address in the From header field, so that your messages
>always receive a score of +9999.
>The score value is shown in the header list in green for positive scores
>and in red for negative scores:
>Note that the list of headers can be sorted by score (with or without
>threading), so scoring can be used to visually organize and separate
>important from unimportant messages.
>A scoring rule looks like this:
> =+9999 From "Joe Average"
>This simple scoring rule assigns the score +9999 to all articles that have
>the term "Joe Average" in the From header field.
>What are Actions?
>Actions are an extension to scoring. While scoring rules simply assigns a
>score value based on a condition, an action rule does something with or on
>the message, e.g. there are actions to copy or move messages that meet a
>certain condition to another folder.
>While scoring rules start with =,- or +, action rules always start with !.
>An action rule looks like this:
> !copy(MyPosts) From "Joe Average"
>This rule copies all articles that have the term "Joe Average" in the From
>field header to the folder "MyPosts".
>Processing
>Usenet articles are scored twice in Dialog. When you get headers in a
>group the scoring rules are applied to the available, limited number of
>headers, however when you retrieve the complete body of the message, the
>message is scored again and this time all headers can be scored.
>The scoring and action rules are stored together in one file, the score
>file, which you can access by selecting Settings, Scoring and actions from
>Dialog's main menu.
>When you edited the score file the changed rules are applied to newly
>retrieved messages only. If you want to apply the new or changed rules to
>existing groups, select Group, Apply scoring and actions to selected
>groups from Dialog's main menu.
>Note that the score file is Unicode aware. You can match on terms with
>characters from the complete Unicode range.
>Syntax by samples
>The score file consists of separate sections, with each section having a
>series of rules. The rules in a section are only applied to groups with
>name matches the section identifier. The section identifier is written in
>brackets.
>Example:
> [*]
> =+9999 From "Joe Average"
> [news.software.readers]
> !copy(MyPosts) From "Joe Average"
>The first scoring rule in this example is applied to all newsgroups, since
>the section identifier is a wildcard, that matches all group names.
>The second action rule in this example is only applied to the
>news.software.readers group, but ignored for all other newsgroups.
>Sample section identifiers:
> [*]      rules below this identifier are applied to all newsgroups
> [**]     rules below this identifier are applied to all newsgroups
>          and to incoming email
> [email.*]  rules below this identifier are applied to all incoming
>            emails (but not to newsgroups)
> [email.private]  rules below this identifier are applied to incoming
>                  emails for the identity named "private"
> [group.name.one group.name.two]  rules below this identifier are
>                                  applied to group.name.one and
>                                  group.name.two only
> [* -newusers]  rules below this identifier are applied to all
>                newsgroups, except for groups that have the term
>                "newusers" in their name
>A scoring rule start with =,+ or -. When an article is scored, it starts
>with a score of 0 and a rule can either increase (+) or decrease (-) the
>score or it can assign a score and stop processing any further scoring
>rules (=).
>Example:
> [*]
> +9999 From "Joe Average"
> -1000 From "Joe Average" #Does this make sense?
> =+8000 From "Joe Average"
> =+7000 From "Joe Average"
>Let's say a message from Joe Average is scored with the preceding score
>file. What final score will the message receive? The message starts with a
>score of 0, then 9999 is added, then 1000 is decreased, so after the first
>two lines it has a score of +8999. The next line assigns a score +8000 to
>the message, ignoring the score the message had previously and terminates
>the processing of any further scoring rules, so the last line is ignored
>completely and the message has a final score of +8000.
>Note that all text after the character # is ignored in the score file.
>Until now, we only scored on the From field of messages. When retrieving
>article headers in an XOver operation you can score on the following
>headers:
> From         The From header field
> Subject      The Subject of the message
> Date         The Date of the message
> Message-ID   The Message-ID of the message
> References   The contents of the References header field
> Bytes        The number of bytes of the message
> Lines        The number of lines of the message
> XRef         The contents of the XRef header field
> XPost        A virtual, numerical field holding the number of groups this
>              message was posted to.
> Age          A virtual, numerical field holding the age of the article in
>              numbers of days.
> Score        The score of the message
>When scoring on fields that have numerical values you can compare if the
>number is equal, greater or smaller using the percentage sign and the
>following syntax:
> -1000 Age %=2
> -2000 Lines %>5000
> +100  Bytes %<2000
>The first rule above decreases the score by 1000 if the message is two
>days old (but not if its older or newer!).
>The second rule decreases the score by 2000 if the message has more than
>5000 lines.
>The third rule increases the score by 100 if the message is smaller than
>2000 bytes.
>When retrieving bodies for articles or when receiving emails all headers
>are available for scoring. You can then additionally score on "Header".
>The variable "Header" holds the complete list of header fields of the
>message, separated by CRLF pairs. To score on this you might need to use
>regular expressions.
>Example:
> =+9000 Header "X-MyUniqueXHeader:"
> =+9000 Header {^(X-MyUniqueXHeader:)}
>These two lines do basically the same. The first uses a plain string match
>on "X-MyUniqueXHeader:" somewhere in the list of headers, while the second
>uses a regular expression. The "^" in this regular expression makes sure
>that "X-MyUniqueXHeader" is actually the first term on a line.
>Regular expressions in the score file need to be written in braces as with
>the preceding example.
>Until now we only saw scoring rules, which assign or chang the score value
>of messages.
>Action rules do something with or on the article. Available action are:
> !watch                 Sets the watch flag on the message
> !ignore                Sets the ignore flag on the message
> !unsetwatchignore      Unsets any ignore or watch flag
> !retrieve              Immediately retrieved the message body
> !mark                  Marks the message for later retrieval
> !unmark                Removes any marked for retrieval flag
> !keep                  Sets the keep flag on the message
> !unkeep                Unsets the keep flag on the message
> !markread              Marks the message read
> !markunread            Marks the message unread
> !delete                Deletes the message
> !setcolor(foreground_color;background_color)   Sets the foreground and
>                        background color of the message in the header list
> !move(target_folder)   Moves the message to the target_folder
> !copy(target_folder)   Copies the message to the target_folder
>Note that multiple actions using the same condition can be separated by
>commas.
>Examples:
> !watch,retrieve,keep From "Joe Average"       # set the watch and keep flag
>                                                 and retrieve the article
> !ignore,markread Lines %>200                  # set the ignore flag and mark
>                                                 the article read
> !setcolor(navy;aqua) From "Joe Average"       # set the foreground color to
>                                                 navy blue and background
>                                                 color to aqua 
> !setcolor(default;$F39CB5) From "Joe Average" # Don't change the foreground
>                                                 color and change background
>                                                 color to light 
> !copy(MyPosts) From "Joe Average"             # Copy the message to the
>                                                 MyPosts folder
> !retrieve Score %>1000                        # Retrieve the article is the
>                                                 score is above 1000
>Copy and Move actions
>There is an extended syntax for copy and move action. Say you want to move
>all emails from a mailing list to a separate folder. You can use:
> [email.*]
> !move(%X-Mailing-List%) Header {^(X-Mailing-List:)}
>The section identifier here says that the following rule should be applied
>to emails only.
>The !move action itself looks for a X-Mailing-List: header in the message,
>but instead of copying the message to a folder with a fixed name, it is
>copied to a folder named after the value of the X-Mailing-List header
>field itself. Say, e.g. you receive a message which has a "X-Mailing-List:
>speedboats@yahoogroups.com" header, then this message is moved to the
>"speedboats@yahoogroups.com" folder. By now, you might have noticed that
>this is a very powerful rule for organizing mailing list into folders.
>A variation of this is:
> [email.*]
> !move(@%X-Mailing-List%) Header {^(X-Mailing-List:)}
>Notice the additional "@" in the target folder expression. If this @ is
>present, the value of the header field is simply searched for the
>character @ and only the text before the first found @ is used as the
>target folder. Again, for a message which has a "X-Mailing-List:
>speedboats@yahoogroups.com" header field, the message would be moved to the
>"speedboats" folder, instead of the "speedboats@yahoogroups.com" folder.
>Almost virtual groups
>There are no virtual groups in Dialog, however you can simply copy or move
>articles from one group to another manually or by using an action rule:
> [a.binary.group]
> !move(a.binary.group;NewsserverOne) bytes %>0
>All previous examples used a folder as the target of the copy/move
>operation. This rule uses a newsgroup as the target. Note that the name of
>the target group and the name of the newsserver where this group is from
>is separated by a semicolon.
>Say, you are using two newsservers named "NewsserverOne" and
>"NewsserverTwo". Both newsservers have the group "a.binary.group", but
>while most of the messages are the same in this group on the two servers,
>there are some that are not available on the other server.
>The first line in the preceding sample makes sure that the following rule
>is only applied to the "a.binary.group" newsgroup.
>The rule itself simply says to move all articles (since the condition
>"bytes %>0" is always met) to the group a.binary.group of NewsserverOne.
>If you retrieve message headers for this group from server NewsserverOne,
>the rule is ignored, since all articles go to the correct group anyway. If
>you retrieve message headers from NewsserverTwo for this group though,
>they will not show up in "a.binary.group (NewsserverTwo)", but in
>"a.binary.group (NewsserverOne)".
>The result is that you joined messages from the same group, but different
>newsservers into one group in Dialog. This is especially useful for binary
>groups to fill missing multipart postings.
>Some further examples with inline comments
> [*]                         # apply the following rules to all newsgroups
> =+9999 From "Your Name"     # "my" articles get highest score
> =+9999 Message-ID your.unique.fqdn
> =+5000 References your.unique.fqdn  # Load articles referencing one of
>                                       "my" articles:
> =+1000 Subject "40tude dialog"      # Certainly, we are very interested in
>                                       articles regarding 40tude dialog
> =-1000 Subject "MAKE 40tude dialog FAST!!!!"    # And certainly, we ignore
>                                                   really silly suggestions
> # (please notice, that this entry would never match, as subjects containing
> # "40tude dialog" would match the "="-entry above)
> # The examples below use group-specific score-entries by starting a new
> # section in the scorefile with a "[...]"-line.
> # Filter out "big" articles, that do not have "FAQ" in subject and are not
> # posted in an announce-group:
> [* -announce]
> -10 Lines %>200
> -10 Bytes %>10000
> +20 Subject FAQ
> -10 Xpost %>3              # Ignore articles posted to more than three groups
> [* -newusers -neubenutzer] # Ignore articles with subjects containing "!!!"
>                              in all groups except the newusers-groups:
> -1 Subject "!!!"
> # Some groups may be more readable, if you filter out all articles and
> # only load specific ones immediately, e.g.:
> [group.name.one group.name.two group.name.three]
> -1 Message-ID *
> +1 Subject "interest1" "interest2" "interest3" "interest4"
> +1 From "user1" "user2" "user3" "user4"
> #Action examples
> [*]                                    # apply the following rules to all
>                                          groups
> !watch,retrieve,keep From "Your Name"  # set the watch and keep flag and
>                                          retrieve the article
> !ignore,markread Lines %>200           # set the ignore flag and mark the
>                                          article read
> !setcolor(navy;aqua) From "Your Name"  # set the foreground color to navy
>                                          blue and background color to aqua 
> !setcolor(default;$F39CB5) From "Your Name"  # Don't change the the
>                                                foreground color and change
>                                                background color to light
>                                                purple
[end quoted plain text]

40tude Dialog v2.0.15.1 (2005-2-7):
https://www.barghahn-online.de/4td_faq/download.php
https://www.barghahn-online.de/4td_faq/download/4d2b38.exe
Technical Details
Message-ID: <20240723.172810.21a63bf1@mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <20240723.172810.21a63bf1@mixmin.net>
Subject: 40tude Dialog - Scoring/Actions Syntax
Date: Tue, 23 Jul 2024 17:28:10 +0100
From: D <noreply@mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.misc
Content-Transfer-Encoding: 7bit
Comments: This message was transferred to Usenet via mail2news gateway at <mail2news@neodome.net>. Please send questions and concerns to <admin@neodome.net>. Report inappropriate use to <abuse@neodome.net>.
Injection-Date: Tue, 23 Jul 2024 16:30:01 +0000 (UTC)
Injection-Info: neodome.net; posting-account="mail2news"; key="Q12XjDrpWGn6JItSRIatmD14sbIRxN0vh9212hJ+e9e/eXXa4z8W/h+4SFPIwn6CHf5MEp yoJW5Rb8AqNGkfsR1fOy7ucenWax0PRaUj2eFLGIxA5b1vRV8Ralgd73/tvfRb7kWdmga5NoAKg Ww3HuCYTdd38DCgLUy9eQwj8UK7zhnzyoj5hNTKwPh6BJ6admkfpovfgQBQk3R9EAk+L6VgB7zZ rRyWrp/ZL3tKdor2q2X84P4x9i4gk2nhWImTODkMNYFCINLf0y7EFnVtpiyV71hQ7pMxgSWL5Dn uT7u2e3fdJT4t98Qc5bL0H046vaODwCm+Fnp2z3+Ya7kBzQ=="; data="U2FsdGVkX184ULvaLScJ/nxYMEZJU6eymDVqaIZld/8roCbXXTsC/5pSBabz/+bUrdG7B Z9J4i+dM92RHfM9R4072lyqDQN2c5zs89VCjRy90lXsMf3CTP2IFTqyXKXeQ4czcldxvMovnoLQ Enq+cF+UXcFr3LjwKqJSlhGLQ9wp39ZD24gCctfl/2vw3JCZoJbcPfqEr0S8DqrZLsnhxbKD6CE roM4gI1mluDYpKkrTSh3g9kDsWlrZrsz7iWXrOivOqNuugM/R7HPig5XBw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