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