>I have this crazy idea that I can use REBOL to filter my mail
>to different files as I receive it.  Ok, starting with this:

I use a program called YARN (Follows Treads) for my email, it
does this kind of think along with some thing called message
scoring.

Can't help with the code at them moment, but here is some
documentation.  Always best to start with the
requirements/docs before coding. See
http://www.chipcenter.com/circuitcellar/march00/c0300r32.htm .

Maybe some of this will end up as part of Rebmail?

------------------------------
PC Yarn User Manual - version 0.91


              PC Yarn - offline news storage and reading system

     Copyright 1995 by Chin Huang

     Permission to copy and distribute this material for any purpose and
     without fee is hereby granted, provided that the above copyright notice
     and this permission notice appear in all copies.

[snips]

     -  A mail filter moves incoming mail to specific folders or deletes
        incoming mail based on user defined rules.

     -  Score files contain rules to score articles based on matching text
        found in the article.  The reader can be set up to not show articles
        having scores below a certain threshold.

     -  Multiple users are supported by storing separate configuration files
        for each user.

USING THE MAIL FILTER

     The mail filter looks at incoming mail messages and processes the
     messages based on a set of rules you define.  You can set up a rule that
     automatically moves messages you receive from a mailing list to a
     specific folder.  Or, you can automatically delete messages from a
     specific user so that you don't even see messages from that user.

     Run the filter program to set up the filter rules.  A list of filter
     rules appears.  To add a filter rule, press the [Ins] key.  The mail rule
     form appears.

     + Mail Rule ----------------------------------------------------------+
     |                                                                     |
     | Rule name: Yarn Mailing List                                        |
     |                                                                     |
     | Search in: ( ) From          Search for: yarn-list                  |
     |            (*) To            Match case: No                         |
     |            ( ) Subject                                              |
     |            ( ) Header                                               |
     |            ( ) Body                                                 |
     |            ( ) Header and body                                      |
     |                                                                     |
     |    Action: (*) Move to folder/newsgroup: list.yarn                  |
     |            ( ) Delete                                               |
     |                                                                     |
     +---------------------------------------------------------------------+

     Rule name
          Enter a name for the rule.  Filter rules are processed in sorted
          order by rule name.  Each rule is checked in turn until a match is
          found.  If no rules match, the message is moved to the INBOX folder.

     Search in
          Select where to search.  If you select "To", then the To: and Cc:
          headers are searched.

     Search for
          Enter the string to search for in the selected header.

     Match case
          Set the field to Yes if you want the search to be case sensitive.

     Action
          Select "Move to folder/newsgroup" if you want to move the message to
          a specific folder or newsgroup.  If the specified name is a
          newsgroup in the news base, the message is moved to the newsgroup,
          otherwise the message is moved to the named folder.  Select "Delete"
          if you want to automatically delete the message.

        [Note: Newsgroup in this context is an internal YARN
                data base, not USENET.]

     The mail filter allows you to automatically transfer messages from a
     mailing list into a newsgroup.  You can also set up Yarn to send any
     posts you make to that newsgroup back to the mailing list.  For example,
     suppose you want to filter messages from the Yarn mailing list into a
     newsgroup.  Run the command

          newgroup list.yarn 7 30 [EMAIL PROTECTED]

     to create a newsgroup named list.yarn.  Set up a mail filter rule to move
     messages from the mailing list into the newsgroup.  Now when you post a
     message to the list.yarn newsgroup, it is mailed to the list address
     [EMAIL PROTECTED]

USING SCORE FILES

     Score files contain rules used to automatically calculate a numeric rank,
     called a score, for news articles.  You can set up the reader so it
     doesn't show articles having scores less than a threshold score.  A
     global score file contains rules applied in all newsgroups.  Each
     newsgroup can have a separate score file containing rules that are also
     applied in that newsgroup.

        [I give messages comming from rebol.com a score of
         200, so I know to look at them first.]

     A rule in a score file has the format

          <points> <where> <string>

     where

     <points>
          is the number of points added or subtracted if the rule matches the
          article.  It is a positive or negative number.  An article's score
          is the total points of all matching rules in the global score file
          and the newsgroup score file.

     <where>
          names an article header to search, such as "From:", "Subject:" or
          "Message-ID:".  You can name any header that might appear in an
          article header.  You can also specify two special options.  The
          "Header" option searches the entire article header.  The "Body"
          option searches the article body.  Searching the "From:", "Subject:"
          and "Message-ID:" fields is significantly faster than the other
          search options.

     <string>
          is the string to search for.  All searches are case-insensitive.  If
          the optional keyword "pattern" appears between <points> and <where>,
          the string is interpreted as a regular expression.

     A score file entry in the form

          killthreshold <n>

     sets the kill threshold to <n> points.  The default kill threshold is 0.
     Articles having scores less that this threshold are marked as already
     read, and you normally will not see them.

     Blank lines and lines beginning with the # character are ignored.

     Here is an example score file that the author uses for the
     alt.usenet.offline-reader newsgroup.

          # I have little interest in Forte Agent.
          -1 Subject: Agent
          -1 Subject: Forte
          -1 pattern Subject: \bFA\b

          # But I am interested in Yarn and SOUP.
          10 Subject: Yarn
          5 Subject: SOUP

     Press [Shift-E] at the newsgroup selection level to edit the global score
     file.  This starts your configured editor program on the global score
     file.  Press [Shift-E] while inside a newsgroup to edit the score file
     specific to the newsgroup.

Reply via email to