Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Many Myths are based on truth -- Spock, "The Way to Eden", stardate 5832.3


computers / alt.usenet.offline-reader.forte-agent / Agent Filtering: Expression Examples

SubjectAuthor
o Agent Filtering: Expression Examplessam

1
Agent Filtering: Expression Examples

<s8bjthdf2adfcsigcr6m5k9an8d4gd6elt@4ax.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=4743&group=alt.usenet.offline-reader.forte-agent#4743

  copy link   Newsgroups: alt.usenet.offline-reader.forte-agent
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: sam@invalid.com
Newsgroups: alt.usenet.offline-reader.forte-agent
Subject: Agent Filtering: Expression Examples
Date: Tue, 31 Jan 2023 18:07:18 -0600
Organization: A noiseless patient Spider
Lines: 156
Message-ID: <s8bjthdf2adfcsigcr6m5k9an8d4gd6elt@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="0cf6625eb7ffccad434521ebb98a805c";
logging-data="43542"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nI9w3h+fx2vu/opk3Y+Bs"
Cancel-Lock: sha1:cgM2+9/23qVeEV1atQauNNQ1gP0=
X-Newsreader: Forte Agent 1.93/32.576 English (American)
X-No-Archive: yes
 by: sam@invalid.com - Wed, 1 Feb 2023 00:07 UTC

Expression Examples

People create filters for a variety of different reasons. What follows
is a sampling of different expressions you might want to refer to when
creating your own filters.
Note: To help you understand some of the examples that use the more
advanced regular expressions, the key parts of
the expression are indicated by a different color. Then below the
example, you can refer to the meaning of each part,
according to its color.

To prevent "spam" from cluttering your database:

"Spam", is the cyber-term for unwanted messages of all sorts, from
"get-rich-quick" schemes to offensive or sensitive
subjects. Spam infiltrates daily without your permission, cluttering
your database and posing a potential problem for
parents who don't want their children exposed to certain types of
material. Below are several examples of expressions
used to "kill" spam:

Example 1: To improve performance, you might want to combine a number
of types of spam you wish to eliminate in
one filter. As other key words that offend you pop up, you can always
add them to the expression. Note that in the
example below, the vertical bars are equivalent to the operator "or".

subject: ($ | $$ | $$$* | $money* | sex* | porn*| xxx*)

Example 2: To prevent Agent from retrieving message headers that start
with odd characters such as !, $, <, -, etc. (usually spam)

subject: ={^[^a-z"].*}
Note: Regular expressions in Agent are case-insensitive unless
preceded by the % operator. So, this will not filter out
subjects that start with upper case letters, or those that start with
lower case letters, or those that start with a quotation
mark. Also, this filter will match subjects such as "[Q] How do I
fix…" and "(fwd) Answers to…". So, you should use
it with caution.

Red part: This "^" character says, "Match if the string is at the
beginning of a line".

Blue part: This "^" character inside the brackets "[ ]" means "not
these characters". So the expression would read
"match any character that is *not* any upper or lower case letter or
quotation mark.

Example 3: Many times spam mail is not directly addressed to you, that
is, it does not have your actual address as the
value in the "To:" field. Here's an expression you can use in a kill
filter that will match any message that does NOT
contain your actual address, either at your work email address or home
email address. The example below shows the
address for Jane Doe at work and at home. The "any-recipient"
qualifier tells Agent to search for the addresses in the
To, Apparently-To, Cc, and Bcc fields.

not any-recipient: (janedoe@server1.com or jdoe@server2.com)
This will work for most spam. However, you may find that your own mail
system inserts an Apparently-To field to
messages that are missing a To: or Cc: field. The "any-recipient"
filter matches the Apparently-To field. If you'd prefer
to have a filter that does not match that either, try using the
following expression:

not any-recipient: (janedoe@abc.com or jdoe@xyz.com)

and not cc: (janedoe@abc.com or jdoe@xyz.com)

To filter on a particular word:
Example 1: To match anything ending in "teen", followed by a space or
the end of the field, you can use the following expression:
{teen( |$)}
This will match seventeen, or canteen, or just teen, but not teenager.
Example 2: To match teen anywhere in the subject, you can use the
following expression:
{teen}

This will match teenager or seventeen or just teen.

To eliminate "header-only" files with little or no body (especially
useful in binary groups):

[1,2]
Note that the lower range is 1, rather than 0. This is because some
news servers fail to add a line count to messages, causing all
messages to have a count of zero.

To prevent retrieving headers that use ALL CAPS:
Create a filter that matches subjects with all caps. Use the filter to
either delete all matching messages or place them in a "trash" folder.
subject: =%{[^a-z]+}

Note: Regular expressions in Agent are case-insensitive unless
preceded by the % operator. The % operator is needed
here so that the filter will exclude subjects that have upper case
letters but no lower case letters, as well as those with no
letters at all.

Red part: The equal sign "=" means "must match entire field". In other
words, the field must consist entirely of characters that are not
lower-case letters.
Blue part: This means "match any character that is *not* a lower case
letter."

Green part: This means "there must be one or more of the preceding
characters in the field."

To automatically file mail from people and mailing lists you know
about:
Example 1: You might use the following expression to automatically
file known mailing lists, company domains,
addressed specifically to you.
[>Inbox] To: jsmith AND Any-Sender: {@?.+\.no}

Everything else from the abroad or domestic not specifically addressed
to you remains in >Unfiltered, which might be the default Inbox.

Red part: This means "match if there is an @ (at symbol), or even if
there isn't one".
Blue part: This means "match one or more instances of any character".
Green part: This means "period". The backslash takes away the special
characteristics of the period, and the regular
expression will match only the period character ".".

Magenta part: The "no" is the domain. For example, if you lived in
Canada, you would have the domain extension ".ca",
and if you lived in the United Kingdom, it would be ".uk". Other
domains are .gov for government, edu for educational,
and com for commercial.

Example 2: if you are in the desktop publishing business and want all
mail regarding this subject to be routed to a Desktop
Publishing folder, you might use the following regular expression.

[>Desksystem] Subject: {desk.*sys}
This expression matches the string "desk" followed by any sequence of
other characters, followed by the string "sys".

To filter out multipart messages in non-binary newsgroups:
This means matching message headers that contain (n/m). Using the
following expression:
subject: {[[(][0-9]+/[0-9]+[])]}
matches subjects with (n/m) or [n/m] in the headers.

See Also:
How to Create Message Filters
Agent's Expression Language
Characters Used in Expressions
Regular Expressions Reference
How to Filter Out Spam

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor