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

Annotation of /imapfilter/sample.imapfilterrc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (hide annotations)
Fri Aug 1 12:28:47 2003 UTC (20 years, 8 months ago) by lefcha
Branch: MAIN
CVS Tags: release-0_9
Branch point for: release-0_9-patches
Changes since 1.16: +48 -26 lines
Added example of date conversion specifiers and default variable.

1 lefcha 1.9 ###########
2     # Options #
3     ###########
4     #
5 lefcha 1.12 # Some program options, such as log file and non-response server timeout.
6 lefcha 1.9 #
7 lefcha 1.14 logfile = /home/user/.imapfilter.log
8 lefcha 1.12 set timeout = 120
9 lefcha 1.14 expunge = no
10     subscribe = yes
11 lefcha 1.9
12    
13 lefcha 1.7 ##########################
14     # Accounts and mailboxes #
15     ##########################
16 lefcha 1.8 #
17 lefcha 1.17 # Each account has a number of folders/mailboxes which are grouped under an
18     # alias name. Folders belong to the last preceding account. A mailbox can
19     # belong to many mailbox groups.
20 lefcha 1.8 #
21 lefcha 1.7
22     #
23 lefcha 1.17 # Connects to "imap1.mail.server" at port 143, as "user1" and using password
24     # "secret1".
25 lefcha 1.7 #
26 lefcha 1.17 # Mailboxes that exist at "imap1.mail.server" include: "INBOX", "bsd-maillist",
27     # "linux-maillist", etc. and are grouped in various ways.
28 lefcha 1.8 #
29 lefcha 1.14 account account1 user1:secret1@imap1.mail.server:143
30 lefcha 1.8 folder inbox1 INBOX
31 lefcha 1.14 folder bsd bsd-maillist
32     folder linux linux-maillist
33     folder lists linux-maillist,bsd-maillist
34     folder all INBOX,linux-maillist,bsd-maillist
35 lefcha 1.7
36     #
37     # Another account and it's folder settings.
38     #
39 lefcha 1.11 # It connects to an IMAP mail server using the SSLv3 protocol.
40     #
41 lefcha 1.14 account account2 user2:secret2@imap2.mail.server ssl3
42 lefcha 1.8 folder inbox2 INBOX
43 lefcha 1.17 folder example "hello, world"
44    
45 lefcha 1.14 #
46 lefcha 1.17 # 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 lefcha 1.14 #
50     account account3 user3@imap3.mail.server
51     folder inbox3 INBOX
52 lefcha 1.7
53    
54     ###########
55     # Filters #
56     ###########
57     #
58 lefcha 1.17 # Filters are completely independent from any account or folder settings. The
59     # mask command may be ommited. If no masks are declared inside a filter entry,
60     # then all messages are matched.
61 lefcha 1.7 #
62    
63     #
64     # A possible anti-spam filter to get rid of unwanted messages.
65     #
66 lefcha 1.17 # The "or" flag in the arguments of the filter command makes the filter masks
67     # work like this (in pseudocode):
68     # if (from ...)
69     # or if (from ...)
70     # or if (subject ...)
71 lefcha 1.7 # then delete
72     #
73     filter spam or
74 lefcha 1.8 mask from marketing@company.junk
75     mask from advertising@annoying.promotion
76 lefcha 1.9 mask subject "new great products"
77 lefcha 1.7 action delete
78    
79     #
80 lefcha 1.17 # And here is a filter that matches all messages except those that have an
81     # explicit "To" header, a really strict filter.
82 lefcha 1.14 #
83     filter strict
84     not to "name surname <email@address>"
85     action delete
86    
87     #
88 lefcha 1.7 # Another filter useful for sorting of mail.
89     #
90 lefcha 1.17 # This one moves messages with the specified "sender" header and an internal
91     # date newer than 14 days to the mailbox bsd-maillist.
92 lefcha 1.7 #
93 lefcha 1.17 # When no "or" or "and" flag is specified for a filter the default "and" is
94     # used.
95 lefcha 1.7 #
96 lefcha 1.11 filter bsdlist
97 lefcha 1.14 header sender bsd-maillist@maillist.server
98 lefcha 1.11 newer 14
99 lefcha 1.14 action move bsd-maillist
100 lefcha 1.7
101     #
102     # Messages can be copied to a folder, eg. for archive purposes.
103     #
104     # This filter copies all messages with the "[patch]" word in
105     # the subject header and smaller that 50000 bytes, to a mailbox
106     # named "patches" that may or may not exist (in the latter case
107 lefcha 1.9 # it will be automatically created). Also, displays their "From" and
108     # "Subject" headers.
109 lefcha 1.7 #
110     filter patch and
111 lefcha 1.14 subject "[patch]"
112 lefcha 1.8 smaller 50000
113 lefcha 1.9 action copy patches from,subject
114 lefcha 1.7
115     #
116 lefcha 1.14 # One can also just display some of the headers of messages that match
117 lefcha 1.7 # a filter.
118     #
119 lefcha 1.9 # This filter displays and/or writes to logfile the "From", "Subject"
120     # and "Date" headers of recent, unread messages, that come from
121     # "tux@penguin.land" or "beastie@daemon.land" but not with a subject
122     # containing the phrase "all work and no play".
123 lefcha 1.7 #
124     # Note that the "recent and unseen" functionality can also be
125     # accomplished with "new" or even "not old".
126     #
127     filter display
128 lefcha 1.8 recent
129     unseen
130     from tux@penguin.land
131     or from beastie@daemon.land
132 lefcha 1.9 not subject "all work and no play"
133 lefcha 1.7 action list from,subject,date
134 lefcha 1.10
135 lefcha 1.14 #
136     # Messages can be copied between two different accounts, ie. two
137 lefcha 1.16 # different IMAP mail servers. It must be noted though, that this
138     # requires that the messages are downloaded from the source mail
139     # server and then uploaded to the target mail server.
140 lefcha 1.14 #
141     # This filter copies matching messages to INBOX of "account3".
142     #
143     filter security or
144     from security@security.announcements
145     from security-announce@my.unix.os
146     action rcopy account3 INBOX subject,date
147    
148     #
149     # Likewise, messages can be moved between different accounts.
150     #
151     filter weekly-news
152     from "weekly-news@news.letter"
153     action rmove account3 news
154 lefcha 1.10
155     #
156 lefcha 1.14 # One can set flags of messages. This can be accomplished with the "flag"
157     # keyword. It is possible to add, remove or replace the flags of a message.
158     #
159     # The filter below, adds the "flagged" flag (which is used to mark a message
160     # important) to matching mail.
161 lefcha 1.10 #
162 lefcha 1.14 filter new-release
163     from announce@my.bsd.os
164     or from announce@my.linux.os
165     subject "new release"
166     or body "new release"
167     action flag add flagged
168 lefcha 1.7
169 lefcha 1.17 #
170     # In some cases, such as when archiving messages, it is useful to make use of
171     # date conversion specifiers and/or the default variable, in the name of the
172     # destination mailbox of a filter.
173     #
174     # Date conversion specifiers are introduced with the at sign '@', for the date
175     # of the message, and the percent sign '%', for the system's current date.
176     #
177     # The default variable "$_" is replaced with the name of the mailbox that the
178     # filter is currently applied to.
179     #
180     # For example, this filter does a month based archiving of messages that are
181     # older than 60 days. When applied to the bsd-maillist and linux-maillist
182     # mailboxes, messages would be moved to mailboxes named bsd-maillist-2003-07,
183     # bsd-maillist-2003-08, etc. and linux-maillist-2003-07,
184     # linux-maillist-2003-08, etc., respectively.
185     #
186     filter archive
187     older 60
188     action move $_-@Y-@m
189    
190 lefcha 1.7
191     ########
192     # Jobs #
193     ########
194     #
195 lefcha 1.8 # Last, there is the definition of the jobs where user combines
196 lefcha 1.7 # folders and filters _already_ defined, and specifies which filters
197     # should be applied to which folders.
198     #
199     job spam,display inbox1,inbox2
200 lefcha 1.17 job patch,archive lists
201 lefcha 1.15 job new-release,bsdlist inbox1

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26