Filtering e-mail by Pine

This instruction is for the Pine version 4.33 but it propably works without any major modifications to Pine versions from 4.20.

For advanced level users procmail software gives better possibilities for filtering messages. Using Procmail is, however, more complicated than using the filters in Pine.

We'll define an example filter that directs the messages from the mailing list of the Utilizing Information Networks course to an own folder.

  1. Start Pine
  2. For modifying the filtering properties select
  3. If there are no filtering rules the only possibility is to add a new one by seleting:
    Use Add to add a Filtering Rule
  4. Now you can start defining the filter on a display like this:
      PINE 4.33   ADD A FILTERING RULE                 Folder: INBOX  43 Messages
    	
    Nickname        = <No Value Set: using "Filter Rule">
    To pattern      = <No Value Set>
    From pattern    = <No Value Set>
    Sender pattern  = <No Value Set>
    Cc pattern      = <No Value Set>
    News pattern    = <No Value Set>
    Subject pattern = <No Value Set>
    Recip pattern   = <No Value Set>
    Partic pattern  = <No Value Set>
    AllText pattern = <No Value Set>
    Score interval  = <No Value Set>
    

    Help on all the issues is available by pessing ? on the line in question.

  5. First name the filtering rule by filling Nickname
    Nickname        = Utilizing Information Networks mailing list  
  6. The messages to the list are always sent to the address tietoverkot@majordomo.cc.jyu.fi. So it is enough for the filtering to direct all mail to this address to a seleted folder. Put the address of the list to Recip when it is enough that the address is either in the field TO or the field CC to direct it to the certain folder
    Recip pattern   = tietoverkot@majordomo.cc.jyu.fi  

    In a similar way it is possible to filter the messages for example according to the sender (From) or the subject.

  7. Then you have to tell in which folder you want the filtering to apply. INBOX is enough if you want to filter only the incoming mail and nothing between the folders.
    Current Folder Type =
                Set    Choose One
                ---  --------------------
                ( )  Any     
                ( )  News    
                ( )  Email   
                (*)  Specific
                     Folder List = INBOX        
    
  8. One could also define if the message should be Important, New, deleted or replied to meet the requirements of the filter. All those settings can now be left as they are.
    Message is Important? =
                Set    Choose One
                ---  --------------------
                (*)  Don't care, always matches
                ( )  Yes                       
                ( )  No                        
    
    Message is New? =
                Set    Choose One
                ---  --------------------
                (*)  Don't care, always matches
                ( )  Yes                       
                ( )  No          
    						
    Message is Deleted? =
                Set    Choose One
                ---  --------------------
                (*)  Don't care, always matches
                ( )  Yes                       
                ( )  No                        
    
    Message is Answered? =
                Set    Choose One
                ---  --------------------
                (*)  Don't care, always matches
                ( )  Yes                       
                ( )  No               
    
  9. Filter Action is the next important step. It tells what to do with the filtered mail. Options are either to delete the message or move it to another folder. It is recommended to use deletion very seldom as it is easy to lose your mail if there are any errors in the filtering rule. We'll move the messages from the list to the folder Networks:
    Filter Action   =
                Set    Choose One
                ---  --------------------
                ( )  Delete
                (*)  Move  
                     to Folder = Tietoverkot          
    
  10. You can skip the last step.
  11. The filtering rule is now ready and can be accepted by E (Exit Setup).
  12. Pine notifies that the folder Networks does not exist and asks wether to create it. Answer yes.
    Folder "Networks" in  doesn't exist. Create?                           
                 Y Yes                                                              
    ^C Cancel    N [No]      
    
  13. Make another filtering rule that moves the mail you send to yourself to a separate folder. It is easy to test the filter with this rule.
  14. Select A (Add) .
  15. Put the following properties to the rule:
  16. Accept changes E (Exit Setup)
  17. Create folder "Own".
  18. Go back to main menu E (Exit Setup) and accept changes.
  19. Test the filter by sending mail to yourself
    To      : tjlahton@cc.jyu.fi
    Cc      : 
    Attchmnt: 
    Subject : test
    ----- Message Text -----
    test
    
  20. and wait until the message arrives. You should then see the text:
     [Moving 1 filtered message to "Own" DONE]
    on the sreen

    If the message is shown in INBOX somethig is wrong with the filter.

  21. By selecting L (Folder List) you can browse the folders in Pine. Select the folder Own and the message you sent should be in there.
  22. As a default Pine can't read new messages from any other than INBOX folder. Change the settings so that new messages are also found from the folders Networks and Own.
  23. Go back to main menu by selecting M.
  24. Go to setup S (Setup)
  25. Select C (Config)
  26. Find [ Folder Preferences ] from SETUP CONFIGURATION and select enable-incoming-folders:
      [ Folder Preferences ]
                [ ]  combined-subdirectory-display              
                [ ]  combined-folder-display                    
                [ ]  enable-dot-folders                         
                [X]  enable-incoming-folders                    
                [ ]  enable-lame-list-mode                      
                [ ]  expanded-view-of-folders                   
                [ ]  quell-empty-directories                    
                [ ]  separate-folder-and-directory-entries      
                [ ]  single-column-folder-list                  
                [ ]  vertical-folder-list        
    
  27. Accept changes by E (Exit Setup)
  28. Now you have to shut and restart Pine to get the new settings into use
  29. Browse the folders by L (Folder List). The view now looks like this:
        Incoming-Folders
            Incoming Message Folders
    
        Mail
            Local folders in Mail/
    
  30. Select Incoming-Folders
                                Incoming Message Folders
    --------------------------------------------------------------------------------
    
    INBOX 
    
  31. Add the new folders Networks and Own to the view
  32. Now you have three folders where Pine can find new messages
                                Incoming Message Folders
    --------------------------------------------------------------------------------
    
    INBOX        Own         Networks  
    
  33. You can normally read your mail from INBOX. When you get to the end of INBOX you can jump to the next folder containing new mail by pressing the tabulator.

Deleting the filters

Deleting the filters is easy. Start adding a new filter but select an existing filter and press D (Delete) to delete the whole rule.

In a similar way you can also delete the folders you created from the INCOMING FOLDER display.

More information on filtering e-mail

http://appro.mit.jyu.fi/doc/email/pine-filter.html
© Tommi Lahtonen ()<URL: http://www.iki.fi/hazor/>
2001-09-30T16:54:19Z