-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.mailfilter
167 lines (135 loc) · 3.64 KB
/
.mailfilter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# -*- sh -*-
# This file should be saved as ~/.mailfilter
# It is a configfile for maildrop
logfile "$HOME/.Maildroplog"
VERBOSE=9
R='/home/han/Mail'
TRASHCAN='/dev/null'
# Mail from github.com
if (/^From: .*@github.com/)
to $R/github.com
# Mail from cronjobs
if (/^From: [email protected] \(Cron Daemon\)/)
{
to $R/cron
}
# Mail from root in a dir
if (/^From: root@/ || /^To: root/)
{
to $R/root
}
# No sane way to unsubscribe, nearly daily mails
if (/^From: tomtom@/)
{
to $R/zspam
}
if (/^From outgoing@sr\.ht/)
{
to $R/sourcehut
}
if (/^From: Airtribune <robot@airtribune\.com>/)
{
to $R/airtribune
}
# Can't unsubscribe without them wanting to know all my private data.
if (/^From:.*@litebit.eu/)
{
to $R/zspam
}
if (/^From: .*@paypal\./ || /[email protected]/)
{
to $R/paypal
}
if (/^From: .*@amazon\.(de|com)/)
{
to $R/amazon
}
# Sure, whatever
if (/^From: @interfax.net/)
{
to $R/zspam
}
# No unsubribe possible
if (/^From: @online.net/)
{
to $R/zspam
}
if (/^X-Spam-Flag: YES/)
to $R/zspam
if (/^From:.*strava.com/)
to $R/strava
# Mail from fics chess-server
if (/^From: FICS.*[email protected]/)
to $R/chess
# Mail from karriere.at
if (/^From: .*@.*karriere.at/)
to $R/karriere.at
# who cares? Do I look like I use windows?
if (/^From:.*[email protected]/)
{
log '====> Marketing.'
to $R/marketing
}
# who cares? Do I look like I use windows?
if (/^Subject:.*virus/ || /^From:.*virus/ )
{
log '====> Message contained the word "virus" in the subject or from.'
to $R/zspam
}
# who cares
if (/^From:.*(mailer[-]?daemon|postmaster)@/)
{
if (/\.ru/:hb)
to $TRASHCAN
log '====> Message to mailer-daemon/postmaster'
to $R/postmaster
}
# ugh. out of office/vacation autoreplies
if ( /^Subject:.*out.*of.*office/ ||\
/^Subject:.*vacation/ )
{
log '====> Out of office/vacation Message.'
to $R/zspam
}
# dump all kind of m$ crap (99.99% virusses)
if (/^Content-Type:.*multipart/ && \
/^Content-Type:.*(audio\/x-|application).*name=.*\.(ad[ep]|asd|ba[st]|chm|cmd|cpl|crt|dll|eml|exe|hlp|hta|in[fs]|isp|jse?|lnk|md[betw]|ms[cipt]|nws|ocx|ops|pcd|p[ir]f|reg|sc[frt]|sh[bsm]|swf|url|zip|vb[esx]?|vxd|ws[cfh])/:b)
{
log '====> Message contained typical M$ attachement.'
to $R/zspam
}
## Silently drop all asian language mail
# http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/bogofilter/bogofilter/doc/bogofilter-faq.html#asian-spam
UNREADABLE="(big5|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987)"
if ((/^Content-Type:.*charset="?$UNREADABLE/) ||\
(/^Content-Type:.*multipart/ &&\
/^Content-Type:.*charset="?$UNREADABLE/:b))
{
log '====> Message in unreadable encoding.'
to $R/zspam
}
# Drop all mails to bogus accounts.
if (/^To:.*@boetes.org/ && ! /^To:.*[email protected]/)
{
log '====> message to non-existing account'
to $R/postmaster
}
## remove spam.
if (/^From:.*@yahoo.com/)
{
# Filter the free spam
xfilter 'sed -e /Yahoo\!/,\$d'
}
# You don't want to miss you are CC-ed after all. You just don't
# want them in your maildir.
if ( /^(Cc|To).*(openbsd|misc|tech|bugs|gnats|source-changes)@/)
{
to $R/cc
}
# Check for duplicates, but only remove duplicates not addressed
# to me. CC's etc. are removed above.
`reformail -D 8192 $R/zarchive/duplicate.cache`
if ($RETURNCODE == 0)
to $R/duplicate
# This line is for all the mail that passed the filter
to $R/