updated english manual
[claws.git] / doc / manual / en / sylpheed-11.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5  <TITLE>: Filtering Messages</TITLE>
6 <link HREF="sylpheed-12.html" REL=next>
7 <link HREF="sylpheed-10.html" REL=previous>
8 <link HREF="sylpheed.html#toc11" REL=contents>
9 </HEAD>
10 <BODY>
11 <a HREF="sylpheed-12.html">Next</a>
12 <a HREF="sylpheed-10.html">Previous</a>
13 <a HREF="sylpheed.html#toc11">Contents</a>
14 <HR>
15 <H2><A NAME="s11">11. Filtering Messages</A></H2>
16
17 <P>Written by Nick Selby (sylpheed@nickselby.com)
18 <P>
19 <P>
20 <H2><A NAME="ss11.1">11.1 Filtering Messages</A>
21 </H2>
22
23 <P>Sylpheed provides powerful filters to allow users to automatically pre-sort incoming 
24 mail based on a set of rules that the user defines. As a most simple example, let's 
25 say you work at the Acme Grommet Company, and you want all e-mail from your co-workers 
26 to be placed in one mailbox. To accomplish this, you would set up a filter that would 
27 place all mail whose "From" header includes the phrase "acmegrommet.com" into a specific mailbox.
28 <P>Sylpheed allows you much more control than just that simple setup; you may create 
29 filters based on several variables, including an "If this AND that" or "If the message 
30 contains this OR does NOT contain that" etc. It's very cool.
31 <H3>Finding The Filter Setting Dialog</H3>
32
33 <P>The filter settings dialog is located in the Configuration menu, under the title 
34 "Filter Setting". You may also use establish a keyboard shortcut (see Keyboard Shortcuts). 
35 <P>
36 <H3>Setting Up Filters</H3>
37
38 <P>Operator(s) and Processing instructions combine to create a Filter Rule.
39 <P>* Operators
40 The dialog's first setting option establishes the Operator, the variable that will 
41 tell the filter what specific text to look for to trigger a filter. Each Filter Rule may have up to two operator sets.
42 <P>Each Operator variable contains three sections: Header, Keyword and Predicate.
43 <P>Header is a drop-down box which defines in which message header Sylpheed's filter will search. Choices range from Subject to X-Mailer. 
44 <P>Keyword is a a text box in which you may enter the text for which the filter will search. 
45 <P>Predicate allows you to choose to filter based on whether the operator 
46 contains, or does not contain, the text you enter in the Keyword field. 
47 <P>Example: Create an Operator in which the X-Mailer field of an incoming message contains the word 'Eudora'.
48 <UL>
49 <LI>Step 1. Under the Header drop-down box, select X-Mailer.</LI>
50 <LI>Step 2. In the Keyword text box, type 'eudora' (case insensitive)</LI>
51 <LI>Step 3. Determine appropriate Predicate setting. Default is "Contains".</LI>
52 </UL>
53
54 The second Operator setting, which is set identically to the first, also allows the 
55 user to select an AND/OR setting declaring the relationship between the two operators. 
56 <P>Example: Create an Operator set which will process mail with a "From" header of 
57 bob@acmegrommet.com AND a subject of "2001 Spring Grommet Collection"
58 <UL>
59 <LI>Step 1. Under the first Operator set's Header drop-down box, select "From".</LI>
60 <LI>Step 2. In the "Keyword" text box, type 'bob@acmegrommet.com' (case insensitive)</LI>
61 <LI>Step 3. Leave "Predicate" setting on default, "Contains"</LI>
62 <LI>Step 4. Leave "AND/OR" box on default setting, "AND"</LI>
63 <LI>Step 5.     Under the second Operator set's "Header" drop-down box, select "Subject".</LI>
64 <LI>Step 6. In the "Keyword" text box, type '2001 spring grommet collection' (case insensitive)</LI>
65 <LI>Step 7. Leave "Predicate" setting on default, "Contains"</LI>
66 </UL>
67 <H3>Message Processing</H3>
68
69 <P>Once you've established the Operator(s) that will define which messages will be 
70 processed, it's time to tell Sylpheed what to do with messages that match the 
71 operator(s). You may choose between two radio button-selected settings: "Destination" and "Don't Receive".
72 <P>Selecting "Destinations" will enable you to route the mail into   
73 a mailbox which you specify.
74 <P>Selecting "Don't Receive" will instruct Sylpheed to not download messages with that 
75 operator. Note that with "Don't Receive", Sylpheed merely leaves the message on your mailserver - it does not delete it. 
76 <P>To specify a mailbox to which you want the message transfered, click on the radio 
77 button to the left of the word "Destination" in the dialog. (Currently, in order to 
78 specify a mailbox you must have created that mailbox prior to activating the Filter 
79 Setting dialog.) Clicking the "Select" button will open a pop-up window containing all 
80 mail folders currently active in your copy of Sylpheed. Select the mailbox you wish by 
81 either (a) double clicking on the mail folder name or (b) clicking the mail folder name and then clicking "OK".         
82 <P>To specify that the message not be retrieved, and left on your mail server, click the 
83 radio button to the left of the words "Don't Receive".
84 <H3>Filter Registration</H3>
85
86 <P>Now that you have set the Operator and the Processing Rule, all that's left to do is 
87 tell Sylpheed to save the entire Filter Rule. If you skip this step, the filter won't work.
88 <P>The "Register Rules" configuration has three options: "Register", "Substitute" and "Delete". 
89 <UL>
90 <LI>"Register" saves the Filter Rule.</LI>
91 <LI>"Substitute" modifies an existing registered Filter Rule.</LI>
92 <LI>"Delete" will remove a previously registered Filter Rule. </LI>
93 </UL>
94
95 Example of Registering A Filter Rule: Create a Filter Rule that moves all mail with 
96 the subject of "Sylpheed Manual" into the (previously created) mail folder "Sylpheed Manual Mail".
97 <UL>
98 <LI>Step 1. Under the first Operator set's "Header" drop-down box, select "Subject".</LI>
99 <LI>Step 2. In the "Keyword" text box, type 'sylpheed manual' (case insensitive)</LI>
100 <LI>Step 3. Leave "Predicate" setting on default, "Contains". Leave second Operator set empty.</LI>
101 <LI>Step 4. Click "Destinations" radio button; select "Sylpheed Manual Mail" folder</LI>
102 <LI>Step 5. Click "Register"</LI>
103 <LI>Step 6. Click OK</LI>
104 </UL>
105  
106 Example of Substituting A Filter Rule: Modify a previously created Filter Rule that 
107 moves all mail with the subject of "Sylpheed Manual" to sort mail not to the 
108 mail folder "Sylpheed Manual Mail" but rather the mail folder "Sylpheed Questions"  
109 <UL>
110 <LI>Step 1. Under the first Operator set's Header drop-down box, select Subject.</LI>
111 <LI>Step 2. In the Keyword text box, type 'sylpheed manual' (case insensitive)</LI>
112 <LI>Step 3. Leave Predicate setting on default, "Contains". Leave second Operator set empty.</LI>
113 <LI>Step 4. Click "Destinations" radio button; select "Sylpheed Questions" folder</LI>
114 <LI>Step 5. Click "Substitute"</LI>
115 <LI>Step 6. Click OK</LI>
116 </UL>
117
118 Example of Deleting a Filter Rule: Remove the previously created Filter Rule which refers to Subject:Sylpheed Questions.
119 <UL>
120 <LI>Step 1. In the "Registered Rules" select box, highlight the filter entitled "Subject:Sylpheed Manual: :::Sylpheed Questions:1:1:m"</LI>
121 <LI>Step 2. Click the "Delete" Button</LI>
122 <LI>Step 3. Confirm the deletion by clicking "Yes" in the confirmation pop-up that asks, "Do you really want to delete this rule?"</LI>
123 <LI>Step 4. Click "OK"</LI>
124 </UL>
125 <H3>Registered Rule Order</H3>
126
127 <P>One caveat about all this: the order in which Filter Rules are created could adversely 
128 affect your intended message sorting, and one needs to consider this when creating or updating Filter Rules. 
129 <P>For example, a Filter Rule saying, "Move anything containing 'ABC' to Mailbox X" listed above another Filter Rule saying "Move anything containing 'ABCDEF' to Mailbox Y" will cause the latter of these filters not to process. 
130 <P>Think about the way Sylpheed goes down its list: first, it would say.."Hmm, any messages with ABC? Ah, there's one! Move it." Then it would think, "Okay, any messages with ABCDEF?" To which the answer would be "no" - that ABCDEF was already filtered because it contained "ABC".
131 <P>Bummer.
132 <P>In order to avoid this, you must ensure that the more complex Filter Rule is processed first, by placing it higher than a similar, conflicting Filter Rule. 
133 <P>To move a Registered Rule higher or lower within the Registered Rule box, select the rule you would like to move, and click on the "Up" or "Down" buttons. This will "move" the rule up or down, above or below a potentially conflicting Filter Rule.   
134 <H2><A NAME="ss11.2">11.2 How to Filter Messages</A>
135 </H2>
136
137 <P>Filtering messages can be done in several ways:
138 <UL>
139 <LI>Sylpheed automatically filters incoming mail from POP servers.</LI>
140 <LI>If you incorporate mail from a unix mailbox, then in the Common preferences (Configuration menu), you need to check the box called "Filter on incorporation". You find this box in the Receive tab in the space "Local spool".</LI>
141 <LI>You can also select the option "Filter messages" from the Summary menu.</LI>
142 </UL>
143
144 Please note that, at time of writing, Sylpheed does -NOT YET- has filtering of IMAP messages enabled.
145 <P>
146 <H2><A NAME="ss11.3">11.3 Filtering mail with Procmail</A>
147 </H2>
148
149 <P>If you feel that Sylpheed has not enough options to perform filtering for you, then you can look at Sylpheed Claws which has more options for filtering. You can find the Claws version (the cutting edge, experimental version of Sylpheed) sylpheed-claws.sourceforge.net.
150 <P>Another option, if you do not want to work with an experimental version of Sylpheed, is Procmail. Procmail is a powerful mail filtering program that is triggered from the Mail Transport Agent (i.e. Sendmail, Postfix, Qmail). Procmail is called by default from these programs after receiving e-mail.
151 <P>The trick to procmail is to tell it that mail has to be filtered into MH mail folders. This is not difficult though.
152 <P>Normally procmail moves mail into MBOX format, this is one large file containing all mails in a folder. MH uses separate files for each e-mail. All you need to do is point the destination of a procmail rule to &lt;destination folder&gt;/.  It is the "slash dot" that does the trick.
153 <HR>
154 <a HREF="sylpheed-12.html">Next</a>
155 <a HREF="sylpheed-10.html">Previous</a>
156 <a HREF="sylpheed.html#toc11">Contents</a>
157 </BODY>
158 </HTML>