1 |
lefcha |
1.9 |
########### |
2 |
|
|
# Options # |
3 |
|
|
########### |
4 |
|
|
# |
5 |
|
|
# Some program options, such as log file. |
6 |
|
|
# |
7 |
|
|
logfile = /home/user/.imapfilter_log |
8 |
|
|
|
9 |
|
|
|
10 |
lefcha |
1.7 |
########################## |
11 |
|
|
# Accounts and mailboxes # |
12 |
|
|
########################## |
13 |
lefcha |
1.8 |
# |
14 |
|
|
# Each account has a number of folders/mailboxes which are grouped under |
15 |
|
|
# an alias name. Folders belong to the last preceding account. A mailbox |
16 |
|
|
# can belong to many mailbox groups. |
17 |
|
|
# |
18 |
lefcha |
1.7 |
|
19 |
|
|
# |
20 |
|
|
# Connects to "imap1.mail.server" at port 143, as "user1" and |
21 |
|
|
# using password "secret1". |
22 |
|
|
# |
23 |
lefcha |
1.8 |
# Mailboxes that exist at "imap1.mail.server" include: "INBOX", "woody", |
24 |
|
|
# "linux-mailist", etc. and are grouped in various ways. |
25 |
|
|
# |
26 |
lefcha |
1.7 |
account user1:secret1@imap1.mail.server:143 |
27 |
lefcha |
1.8 |
folder inbox1 INBOX |
28 |
|
|
folder friends Woody,Buzz |
29 |
|
|
folder bsd bsd-mailist |
30 |
|
|
folder linux linux-mailist |
31 |
|
|
folder lists linux-mailist,bsd-mailist |
32 |
|
|
folder all INBOX,woody,buzz,linux-mailist,bsd-mailist |
33 |
lefcha |
1.7 |
|
34 |
|
|
# |
35 |
|
|
# Another account and it's folder settings. |
36 |
|
|
# |
37 |
lefcha |
1.11 |
# It connects to an IMAP mail server using the SSLv3 protocol. |
38 |
|
|
# |
39 |
|
|
account user2:secret2@imap2.mail.server ssl3 |
40 |
lefcha |
1.8 |
folder inbox2 INBOX |
41 |
|
|
folder games nethack,koules |
42 |
lefcha |
1.7 |
|
43 |
|
|
|
44 |
|
|
########### |
45 |
|
|
# Filters # |
46 |
|
|
########### |
47 |
|
|
# |
48 |
lefcha |
1.8 |
# Filters are completely independent from any account or folder settings. |
49 |
|
|
# The mask command may be ommited. If no masks are declared inside |
50 |
|
|
# a filter entry, then all messages are matched. |
51 |
lefcha |
1.7 |
# |
52 |
|
|
|
53 |
|
|
# |
54 |
|
|
# A possible anti-spam filter to get rid of unwanted messages. |
55 |
|
|
# |
56 |
|
|
# The "or" flag in the arguments of the filter command makes the |
57 |
|
|
# filter masks work like this (in pseudocode): |
58 |
|
|
# if (from ... ) |
59 |
|
|
# or if (from ...) |
60 |
|
|
# or if (subject ...) |
61 |
|
|
# then delete |
62 |
|
|
# |
63 |
|
|
filter spam or |
64 |
lefcha |
1.8 |
mask from marketing@company.junk |
65 |
|
|
mask from advertising@annoying.promotion |
66 |
lefcha |
1.9 |
mask subject "new great products" |
67 |
lefcha |
1.7 |
action delete |
68 |
|
|
|
69 |
|
|
# |
70 |
|
|
# Another filter useful for sorting of mail. |
71 |
|
|
# |
72 |
lefcha |
1.11 |
# This one moves messages with the specified "sender" header and |
73 |
|
|
# an internal date newer than 14 days to the mailbox bsd-mailist. |
74 |
lefcha |
1.7 |
# |
75 |
|
|
# When no "or" or "and" flag is specified for a filter the default |
76 |
|
|
# "and" is used. |
77 |
|
|
# |
78 |
lefcha |
1.11 |
filter bsdlist |
79 |
lefcha |
1.8 |
header sender bsd-mailist@mailist.bsd |
80 |
lefcha |
1.11 |
newer 14 |
81 |
lefcha |
1.7 |
action move bsd-mailist |
82 |
|
|
|
83 |
|
|
# |
84 |
|
|
# Messages can be copied to a folder, eg. for archive purposes. |
85 |
|
|
# |
86 |
|
|
# This filter copies all messages with the "[patch]" word in |
87 |
|
|
# the subject header and smaller that 50000 bytes, to a mailbox |
88 |
|
|
# named "patches" that may or may not exist (in the latter case |
89 |
lefcha |
1.9 |
# it will be automatically created). Also, displays their "From" and |
90 |
|
|
# "Subject" headers. |
91 |
lefcha |
1.7 |
# |
92 |
|
|
filter patch and |
93 |
lefcha |
1.8 |
subject [patch] |
94 |
|
|
smaller 50000 |
95 |
lefcha |
1.9 |
action copy patches from,subject |
96 |
lefcha |
1.7 |
|
97 |
|
|
# |
98 |
|
|
# One can also display some of the headers of messages that match |
99 |
|
|
# a filter. |
100 |
|
|
# |
101 |
lefcha |
1.9 |
# This filter displays and/or writes to logfile the "From", "Subject" |
102 |
|
|
# and "Date" headers of recent, unread messages, that come from |
103 |
|
|
# "tux@penguin.land" or "beastie@daemon.land" but not with a subject |
104 |
|
|
# containing the phrase "all work and no play". |
105 |
lefcha |
1.7 |
# |
106 |
|
|
# Note that the "recent and unseen" functionality can also be |
107 |
|
|
# accomplished with "new" or even "not old". |
108 |
|
|
# |
109 |
|
|
filter display |
110 |
lefcha |
1.8 |
recent |
111 |
|
|
unseen |
112 |
|
|
from tux@penguin.land |
113 |
|
|
or from beastie@daemon.land |
114 |
lefcha |
1.9 |
not subject "all work and no play" |
115 |
lefcha |
1.7 |
action list from,subject,date |
116 |
lefcha |
1.10 |
|
117 |
|
|
|
118 |
|
|
# |
119 |
|
|
# And here is a filter that matches all messages except those that have |
120 |
|
|
# an explicit "To" header, a really strict filter. |
121 |
|
|
# |
122 |
|
|
filter strict |
123 |
|
|
not to "name surname <email@address>" |
124 |
|
|
action delete |
125 |
lefcha |
1.7 |
|
126 |
|
|
|
127 |
|
|
######## |
128 |
|
|
# Jobs # |
129 |
|
|
######## |
130 |
|
|
# |
131 |
lefcha |
1.8 |
# Last, there is the definition of the jobs where user combines |
132 |
lefcha |
1.7 |
# folders and filters _already_ defined, and specifies which filters |
133 |
|
|
# should be applied to which folders. |
134 |
|
|
# |
135 |
lefcha |
1.8 |
|
136 |
lefcha |
1.7 |
job spam,display inbox1,inbox2 |
137 |
lefcha |
1.8 |
job patch lists |
138 |
lefcha |
1.7 |
job bsdlist inbox1 |