/[imapfilter]/imapfilter/sample.imapfilterrc
ViewVC logotype

Diff of /imapfilter/sample.imapfilterrc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11.2.2 by lefcha, Mon Jan 21 15:45:42 2002 UTC revision 1.18 by lefcha, Sun Feb 8 22:16:02 2004 UTC
# Line 4  Line 4 
4  #  #
5  # Some program options, such as log file and non-response server timeout.  # Some program options, such as log file and non-response server timeout.
6  #  #
7  logfile = /home/user/.imapfilter_log  logfile = /home/user/.imapfilter.log
8  set timeout=120  set timeout = 120
9    expunge = no
10    subscribe = yes
11    
12    
13  ##########################  ##########################
14  # Accounts and mailboxes #  # Accounts and mailboxes #
15  ##########################  ##########################
16  #  #
17  # Each account has a number of folders/mailboxes which are grouped under  # Each account has a number of folders/mailboxes which are grouped under an
18  # an alias name. Folders belong to the last preceding account. A mailbox  # alias name. Folders belong to the last preceding account. A mailbox can
19  # can belong to many mailbox groups.  # belong to many mailbox groups.
20  #  #
21    
22  #  #
23  # Connects to "imap1.mail.server" at port 143, as "user1" and  # Connects to "imap1.mail.server" at port 143, as "user1" and using password
24  # using password "secret1".  # "secret1".
25  #  #
26  # Mailboxes that exist at "imap1.mail.server" include: "INBOX", "woody",  # Mailboxes that exist at "imap1.mail.server" include: "INBOX", "bsd-maillist",
27  # "linux-mailist", etc. and are grouped in various ways.  # "linux-maillist", etc. and are grouped in various ways.
28  #  #
29  account user1:secret1@imap1.mail.server:143  account account1 user1:secret1@imap1.mail.server:143
30    folder inbox1 INBOX    folder inbox1 INBOX
31    folder friends Woody,Buzz    folder bsd bsd-maillist
32    folder bsd bsd-mailist    folder linux linux-maillist
33    folder linux linux-mailist    folder lists linux-maillist,bsd-maillist
34    folder lists linux-mailist,bsd-mailist    folder all INBOX,linux-maillist,bsd-maillist
   folder all INBOX,woody,buzz,linux-mailist,bsd-mailist  
35    
36  #  #
37  # Another account and it's folder settings.  # Another account and it's folder settings.
38  #  #
39  # It connects to an IMAP mail server using the SSLv3 protocol.  # It connects to an IMAP mail server using the SSLv3 protocol.
40  #  #
41  account user2:secret2@imap2.mail.server ssl3  account account2 user2:secret2@imap2.mail.server ssl3
42    folder inbox2 INBOX    folder inbox2 INBOX
43    folder games nethack,koules,"clan bomber"    folder example "hello, world"
44    
45    #
46    # A third account which password is intentionally ommited, either because it
47    # will be supplied interactively or because it will be stored securely using
48    # the integrated password editor.
49    #
50    account account3 user3@imap3.mail.server
51      folder inbox3 INBOX
52    
53    
54  ###########  ###########
55  # Filters #  # Filters #
56  ###########  ###########
57  #  #
58  # Filters are completely independent from any account or folder settings.  # Filters are completely independent from any account or folder settings.  The
59  # The mask command may be ommited. If no masks are declared inside  # mask command may be ommited. If no masks are declared inside a filter entry,
60  # a filter entry, then all messages are matched.  # then all messages are matched.
61  #  #
62    
63  #  #
64  # A possible anti-spam filter to get rid of unwanted messages.  # A possible anti-spam filter to get rid of unwanted messages.
65  #  #
66  # The "or" flag in the arguments of the filter command makes the  # The "or" flag in the arguments of the filter command makes the filter masks
67  # filter masks work like this (in pseudocode):  # work like this (in pseudocode):
68  #   if (from ... )  #
69  #     or if (from ...)  #   if (from ...)
70  #     or if (subject ...)  #   or if (from ...)
71    #   or if (subject ...)
72  #   then delete  #   then delete
73  #  #
74  filter spam or  filter spam or
# Line 68  filter spam or Line 78  filter spam or
78  action delete  action delete
79    
80  #  #
81    # And here is a filter that matches all messages except those that have an
82    # explicit "To" or "Cc" header or come from a friend's specific mail address.
83    #
84    # The "and" flag in the arguments of the filter command makes the filter masks
85    # work like this (in pseudocode):
86    #
87    #   if (not to ...)
88    #   and (not cc ...)
89    #   and (not from ...)
90    #   then delete
91    #
92    filter strict and
93      mask not to "name surname <email@address>"
94      mask not cc "name surname <email@address>"
95      mask not from friend@address
96    action delete
97    
98    #
99  # Another filter useful for sorting of mail.  # Another filter useful for sorting of mail.
100  #  #
101  # This one moves messages with the specified "sender" header and  # This one moves messages with the specified "sender" header and an internal
102  # an internal date newer than 14 days to the mailbox bsd-mailist.  # date newer than 14 days to the mailbox bsd-maillist.
103  #  #
104  # When no "or" or "and" flag is specified for a filter the default  # When no "or" or "and" flag is specified for a filter the default "and" is
105  # "and" is used.  # used.
106  #  #
107  filter bsdlist  filter bsdlist
108    header sender bsd-mailist@mailist.bsd    header sender bsd-maillist@maillist.server
109    newer 14    newer 14
110  action move bsd-mailist  action move bsd-maillist
111    
112  #  #
113  # Messages can be copied to a folder, eg. for archive purposes.  # Messages can be copied to a folder, eg. for archive purposes.
114  #  #
115  # This filter copies all messages with the "[patch]" word in  # This filter copies all messages with the "[patch]" word in the subject header
116  # the subject header and smaller that 50000 bytes, to a mailbox  # and smaller that 50000 bytes, to a mailbox named "patches" that may or may
117  # named "patches" that may or may not exist (in the latter case  # not exist (in the latter case it will be automatically created). Also,
118  # it will be automatically created). Also, displays their "From" and  # displays their "From" and "Subject" headers.
 # "Subject" headers.  
119  #  #
120  filter patch and  filter patch
121    subject [patch]    subject "[patch]"
122    smaller 50000    smaller 50000
123  action copy patches from,subject  action copy patches from,subject
124    
125  #  #
126  # One can also display some of the headers of messages that match  # One can also just display some of the headers of messages that match a
127  # a filter.  # filter.
128  #  #
129  # This filter displays and/or writes to logfile the "From", "Subject"  # This filter displays and/or writes to logfile the "From", "Subject" and
130  # and "Date" headers of recent, unread messages, that come from  # "Date" headers of recent, unread messages, that come from "tux@penguin.land"
131  # "tux@penguin.land" or "beastie@daemon.land" but not with a subject  # or "beastie@daemon.land" but not with a subject containing the phrase "all
132  # containing the phrase "all work and no play".  # work and no play".
133  #  #
134  # Note that the "recent and unseen" functionality can also be  # Note that the "recent and unseen" functionality can also be accomplished with
135  # accomplished with "new" or even "not old".  # "new" or even "not old".
136  #  #
137  filter display  filter display
138    recent    recent
# Line 115  filter display Line 142  filter display
142    not subject "all work and no play"    not subject "all work and no play"
143  action list from,subject,date  action list from,subject,date
144    
145    #
146    # Messages can be copied between two different accounts, ie. two different IMAP
147    # mail servers. It must be noted though, that this requires that the messages
148    # are downloaded from the source mail server and then uploaded to the target
149    # mail server.
150    #
151    # This filter copies matching messages to INBOX of "account3".
152    #
153    filter security or
154      from security@security.announcements
155      from security-announce@my.unix.os
156    action rcopy account3 INBOX subject,date
157    
158  #  #
159  # And here is a filter that matches all messages except those that have  # Likewise, messages can be moved between different accounts.
160  # an explicit "To" header, a really strict filter.  #
161    filter weekly-news
162      from "weekly-news@news.letter"
163    action rmove account3 news
164    
165    #
166    # One can set flags of messages.  This can be accomplished with the "flag"
167    # keyword. It is possible to add, remove or replace the flags of a message.
168    #
169    # The filter below, adds the "flagged" flag (which is used to mark a message
170    # important) to matching mail.
171    #
172    filter new-release
173      from announce@my.bsd.os
174      or from announce@my.linux.os
175      subject "new release"
176      or body "new release"
177    action flag add flagged
178    
179    #
180    # In some cases, such as when archiving messages, it is useful to make use of
181    # date conversion specifiers and/or the default variable, in the name of the
182    # destination mailbox of a filter.
183    #
184    # Date conversion specifiers are introduced with the at sign '@', for the date
185    # of the message, and the percent sign '%', for the system's current date.
186    #
187    # The default variable "$_" is replaced with the name of the mailbox that the
188    # filter is currently applied to.
189    #
190    # For example, this filter does a month based archiving of messages that are
191    # older than 60 days.  When applied to the bsd-maillist and linux-maillist
192    # mailboxes, messages would be moved to mailboxes named bsd-maillist-2003-07,
193    # bsd-maillist-2003-08, etc. and linux-maillist-2003-07,
194    # linux-maillist-2003-08, etc., respectively.
195    #
196    filter archive
197      older 60
198    action move $_-@Y-@m
199    
200    #
201    # And to clarify the combination of and/or flags in filter/mask commands here
202    # is something that might help:
203    #
204    #   if A and (B or C) and (D or E or F) and G then ...
205    #
206    # Can be accomplished with:
207    #
208    #   filter ... and
209    #     A
210    #     B
211    #     or C
212    #     D
213    #     or E
214    #     or F
215    #     G
216    #   action ...
217    #
218    # On the other hand:
219    #
220    #   if A or (B and C) or (D and E and F) or G then ...
221    #
222    # Can be accomplished with:
223    #
224    #   filter ... or
225    #     A
226    #     B
227    #     and C
228    #     D
229    #     and E
230    #     and F
231    #     G
232    #   action ...
233  #  #
 filter strict  
   not to "name surname <email@address>"  
 action delete  
234    
235    
236  ########  ########
237  # Jobs #  # Jobs #
238  ########  ########
239  #  #
240  # Last, there is the definition of the jobs where user combines  # Last, there is the definition of the jobs where user combines folders and
241  # folders and filters _already_ defined, and specifies which filters  # filters _already_ defined, and specifies which filters should be applied to
242  # should be applied to which folders.  # which folders.
243  #  #
244  job spam,display inbox1,inbox2  job spam,display inbox1,inbox2
245  job patch lists  job patch,archive lists
246  job bsdlist inbox1  job new-release,bsdlist inbox1

Legend:
Removed from v.1.11.2.2  
changed lines
  Added in v.1.18

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26