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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
|
--
-- Options
--
options.timeout = 120
options.subscribe = true
filter_local = IMAPFILTER_LOCAL
-- Accounts
if filter_local then
folder_sep = '.'
GMAIL = IMAP {
server = 'localhost',
username = 'ryan',
password = 'LOCAL_PASS',
}
else
folder_sep = '/'
GMAIL = IMAP {
server = 'imap.gmail.com',
port = 993,
username = 'ryanakca@gmail.com',
password = 'GMAIL_PASS',
ssl = 'auto'
}
end
--
-- Filters
-- For
-- GMAIL
--
-- Debian stuff
debiandevelann = GMAIL.INBOX:contain_field('List-ID', 'debian-devel-announce.lists.debian.org') *
GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. 'debian-devel-announce'], debiandevelann)
listsdebianorg = { 'debian-backports'
, 'debian-bsd'
, 'debian-dak'
, 'debian-devel'
, 'debian-devel-french'
, 'debian-haskell'
, 'debian-java'
, 'debian-mentors'
, 'debian-newmaint'
, 'debian-news'
, 'debian-private'
, 'debian-project'
, 'debian-python'
, 'debian-qa'
, 'debian-qt-kde'
}
for list = 1, #listsdebianorg do
listfilter = GMAIL.INBOX:contain_field('List-ID', listsdebianorg[list] .. '.lists.debian.org')
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. listsdebianorg[list]], listfilter)
end
tracker = { 'rumor'
, 'freetuxtv'
, 'slingshot'
, 'turses'
, 'frescobaldi'
, 'bzflag'
, 'xmonad'
, 'cmus' }
for list = 1, #tracker do
listfilter = GMAIL.INBOX:contain_field('List-ID', tracker[list] .. '.tracker.debian.org')
* GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. tracker[list]], listfilter)
end
alioth = { 'pkg-kde-commits'
, 'pkg-kde-extras'
, 'pkg-kde-talk'
, 'pkg-multimedia-commits'
, 'pkg-multimedia-maintainers'
, 'python-apps-team' }
for list = 1, #alioth do
listfilter = GMAIL.INBOX:contain_field('List-ID', alioth[list] .. '.lists.alioth.debian.org')
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. alioth[list]], listfilter)
end
salsa = { 'cmus' }
for proj = 1, #salsa do
listfilter = GMAIL.INBOX:contain_field('X-Gitlab-Project', salsa[proj])
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. salsa[proj]], listfilter)
end
dbugs = GMAIL.INBOX:match_from('.*@bugs.debian.org') *
GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. 'dBugs'], dbugs)
-- Ubuntu stuff
ubuntu = { 'kubuntu-devel'
, 'ubuntu-ca'
, 'ubuntu-classroom'
, 'ubuntu-devel-announce'
, 'ubuntu-doc'
, 'ubuntu-installer'
, 'ubuntu-irc'
--, 'kubuntu-bugs'
}
canonical = { 'ubuntu-website' }
for list = 1, #ubuntu do
listfilter = GMAIL.INBOX:contain_field('List-ID', ubuntu[list] .. '.lists.ubuntu.com')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. ubuntu[list]], listfilter)
end
for list = 1, #canonical do
listfilter = GMAIL.INBOX:contain_field('List-ID', canonical[list] .. '.lists.canonical.com')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. canonical[list]], listfilter)
end
launchpadUsers = GMAIL.INBOX:contain_field('List-ID', 'launchpad-users.lists.launchpad.net') +
GMAIL.INBOX:contain_field('List-ID', 'launchpad-users.lists.canonical.com') +
GMAIL.INBOX:match_to('launchpad-users@lists.launchpad.net') +
GMAIL.INBOX:match_cc('launchpad-users@lists.launchpad.net')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'launchpadUsers'], launchpadUsers)
-- kubuntuBugs = GMAIL.INBOX:contain_header('X-Launchpad-Message-Rationale: .*@kubuntu-bugs') +
-- GMAIL.INBOX:match_header('X-BeenThere: kubuntu-bugs@lists.ubuntu.com')
-- GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'kubuntu-bugs'], kubuntuBugs)
ubuntu = GMAIL.INBOX:contain_field('List-ID', '.*.lists.ubuntu.com')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu'], ubuntu)
ubuntuca = GMAIL.INBOX:contain_field('X-Launchpad-Message-For', 'ubuntu-ca')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'ubuntu-ca'], ubuntuca)
uWebBugs = GMAIL.INBOX:match_header('X-Launchpad-Bug.*product=ubuntu-website.*')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'ubuntu-website-bugs'], uWebBugs)
kuWebBugs = GMAIL.INBOX:match_header('X-Launchpad-Bug:.*product=kubuntu-website.*')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'kubuntu-website-bugs'], kuWebBugs)
ubugs = GMAIL.INBOX:match_header('X-Launchpad-Bug:.*distribution=ubuntu;.*') +
GMAIL.INBOX:contain_field('List-Id', 'ubuntu-bugcontrol.lists.launchpad.net')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'ubuntu-bugs'], ubugs)
kubuntuninjas = GMAIL.INBOX:contain_field('X-Launchpad-PPA', 'kubuntu-ninjas') +
GMAIL.INBOX:contain_field('X-Launchpad-PPA', 'kubuntu-ppa-staging') +
GMAIL.INBOX:contain_field('X-Launchpad-Message-For', 'kubuntu-packagers') +
GMAIL.INBOX:contain_field('List-ID', 'kubuntu-ppa.lists.launchpad.net')
GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'kubuntu-ninjas'], kubuntuninjas)
--answers = GMAIL.INBOX:match_header('X-Launchpad-Question: distribution=ubuntu.*')
--GMAIL.INBOX:mark_seen(answers)
--GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'uAnswers'], answers)
--kubuntuWebmaster = GMAIL.INBOX:contain_to('webmaster@kubuntu.org')
--GMAIL.INBOX:move_messages(GMAIL['Ubuntu' .. folder_sep .. 'kubuntu-webmaster'], kubuntuWebmaster)
-- KDE Stuff
kdefrancophone = GMAIL.INBOX:contain_field('List-ID', 'kde-francophone.kde.org')
GMAIL.INBOX:move_messages(GMAIL['KDE' .. folder_sep .. 'kde-francophone'], kdefrancophone)
-- OpenBSD Stuff
openbsd = { 'announce'
, 'misc'
, 'mirrors-discuss'
, 'tech' }
for list = 1, #openbsd do
listfilter = GMAIL.INBOX:contain_field('List-ID', openbsd[list] .. '.openbsd.org')
GMAIL.INBOX:move_messages(GMAIL['OpenBSD' .. folder_sep .. openbsd[list]], listfilter)
end
sshud = GMAIL.INBOX:contain_field('List-ID', 'openssh-unix-dev.mindrot.org')
GMAIL.INBOX:move_messages(GMAIL['OpenBSD' .. folder_sep .. 'ssh-unix-dev'], sshud)
-- Other computer stuff
--
slashdot = ( GMAIL.INBOX:is_seen() *
GMAIL.INBOX:match_from('slashdot@newsletters.slashdot.org') )
GMAIL.INBOX:move_messages(GMAIL['Slashdot'], slashdot)
--
lwn = ( GMAIL.INBOX:is_seen()
+ GMAIL.INBOX:is_older(7) )
* GMAIL.INBOX:match_from('lwn.*@lwn.net')
GMAIL.INBOX:move_messages(GMAIL['lwn'], lwn)
sbuild = GMAIL.INBOX:match_from('sbuild@.*.ryanak.ca') +
GMAIL.INBOX:match_from('sbuild@lambda')
GMAIL.INBOX:move_messages(GMAIL['sbuild'], sbuild)
frescobaldi = ( GMAIL.INBOX:is_seen()
+ GMAIL.INBOX:is_older(2) )
* GMAIL.INBOX:contain_field('List-ID', 'frescobaldi.googlegroups.com')
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. 'frescobaldi'], frescobaldi)
opensmtpd = ( GMAIL.INBOX:is_seen()
+ GMAIL.INBOX:is_older(2) ) *
GMAIL.INBOX:contain_field('List-ID', 'misc.opensmtpd.org')
GMAIL.INBOX:move_messages(GMAIL['Debian' .. folder_sep .. 'opensmtpd'], opensmtpd)
mbrainz = ( GMAIL.INBOX:match_from('noreply@musicbrainz.org')
* GMAIL.INBOX:match_subject('Edits for your subscriptions')
* ( GMAIL.INBOX:is_older(1)
+ GMAIL.INBOX:is_seen() ) )
GMAIL.INBOX:move_messages(GMAIL['MusicBrainz'], mbrainz)
-- O'ists
PiA = GMAIL.INBOX:match_from('.*@philosophyinaction.com') *
GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['PiA'], PiA)
epstein = ( GMAIL.INBOX:match_from('.*@industrialprogress.net')
+ GMAIL.INBOX:match_from('.*@alexepstein.com') )
* GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['Epstein'], epstein)
-- Queen's
qsocial = GMAIL.INBOX:match_to('social@.*cs.queensu.ca') +
GMAIL.INBOX:match_cc('social@.*cs.queensu.ca')
GMAIL.INBOX:move_messages(GMAIL['Queens' .. folder_sep .. 'social'], qsocial)
qsail = ( GMAIL.INBOX:match_to('sail.*@cs.queensu.ca') +
GMAIL.INBOX:match_cc('sail.*@cs.queensu.ca') ) *
GMAIL.INBOX:is_seen() +
GMAIL.INBOX:match_to('sail4schedule@gmail.com')
GMAIL.INBOX:move_messages(GMAIL['Queens' .. folder_sep .. 'SAIL'], qsail)
-- McGill
belcom = GMAIL.INBOX:contain_field('List-ID', 'beluga-commit.CS.McGill.CA')
GMAIL.INBOX:move_messages(GMAIL['Internship' .. folder_sep .. 'beluga-commit'], belcom)
beldev = GMAIL.INBOX:contain_field('List-ID', 'beluga-dev.CS.McGill.CA')
GMAIL.INBOX:move_messages(GMAIL['Internship' .. folder_sep .. 'beluga-dev'], beldev)
complogic = GMAIL.INBOX:contain_field('List-Id', 'complogic.CS.McGill.CA') *
( GMAIL.INBOX:is_older(1) + GMAIL.INBOX:is_seen() )
GMAIL.INBOX:move_messages(GMAIL['Internship' .. folder_sep .. 'complogic'], complogic)
-- MIT under GMAIL
mitplv = ( GMAIL.INBOX:contain_field('List-Id', 'plv.csail.mit.edu')
+ GMAIL.INBOX:contain_field('List-Id', 'plv.lists.csail.mit.edu')
+ GMAIL.INBOX:contain_field('List-Id', 'bedrock-group.lists.csail.mit.edu') ) *
( GMAIL.INBOX:is_older(1)
+ GMAIL.INBOX:is_seen() )
GMAIL.INBOX:move_messages(GMAIL['GMAIL' .. folder_sep .. 'MIT'], mitplv)
-- Academia
typesann = GMAIL.INBOX:contain_field('List-Id', 'types-announce.lists.seas.upenn.edu')
GMAIL.INBOX:move_messages(GMAIL['Academia' .. folder_sep .. 'types-announce'], typesann)
typeslist = GMAIL.INBOX:contain_field('List-Id', 'types-list.lists.seas.upenn.edu') *
GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['Academia' .. folder_sep .. 'types-list'], typeslist)
categories = GMAIL.INBOX:contain_field('List-Id', 'maths-categories-seminar.lists.cam.ac.uk')
* ( GMAIL.INBOX:is_seen()
+ GMAIL.INBOX:is_older(1) )
GMAIL.INBOX:move_messages(GMAIL['Academia'], categories)
fields = GMAIL.INBOX:match_from('.*@fields.utoronto.ca')
* ( GMAIL.INBOX:is_old()
+ GMAIL.INBOX:is_seen() )
fields = GMAIL.INBOX:move_messages(GMAIL['Academia'], fields)
-- People
bagpipes = GMAIL.INBOX:match_from('PM_EMAIL') +
GMAIL.INBOX:match_cc('PM_EMAIL')
GMAIL.INBOX:move_messages(GMAIL['Bagpipes'], bagpipes)
facebook = GMAIL.INBOX:match_from('.*@facebookmail.com') *
( GMAIL.INBOX:contain_subject('New messages from ') +
GMAIL.INBOX:contain_subject('New message from ') +
GMAIL.INBOX:contain_subject('sent a message') +
GMAIL.INBOX:contain_subject('sent you a message') ) *
( GMAIL.INBOX:is_old()
+ GMAIL.INBOX:is_seen() )
GMAIL.INBOX:move_messages(GMAIL['Friends'], facebook)
-- Misc
vfr = GMAIL.INBOX:match_from('vfr-no-reply@aynrand.org') *
GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['VfR'], vfr)
ari = GMAIL.INBOX:match_from('Impact@aynrand.org')
* GMAIL.INBOX:is_seen()
GMAIL.INBOX:move_messages(GMAIL['ARI'], ari)
epic = GMAIL.INBOX:contain_field('List-Id', 'Every Pub In Cambridge <epic.einval.com>')
GMAIL.INBOX:move_messages(GMAIL['Internship' .. folder_sep .. 'epic'], epic)
banks = ( GMAIL.INBOX:match_from('pncalerts@pnc.com')
+ GMAIL.INBOX:match_from('discover@service.discover.com') )
* ( GMAIL.INBOX:is_seen()
+ GMAIL.INBOX:is_older(7) )
GMAIL.INBOX:move_messages(GMAIL['banks'], banks)
splitwise = GMAIL.INBOX:match_from('hello@splitwise.com')
* ( GMAIL.INBOX:is_seen()
+ GMAIL.INBOX:is_older(1) )
GMAIL.INBOX:move_messages(GMAIL['receipts'], splitwise)
|