-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
86 lines (75 loc) · 3.03 KB
/
config.lua
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
-- do not dumbly copy and paste :-)
local accountBL = IMAP {
server = 'XXXXX',
username = 'XXXXX',
password = 'XXXXX',
ssl = 'ssl3',
}
-- Get the status of a mailbox
accountBL.INBOX:check_status()
-- Get all the messages in the mailbox.
results = accountBL.INBOX:select_all()
--------------------------
---------- filters -------
--------------------------
-- team + staff
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_from('@staff.blueline.mg')
)
results:move_messages(accountBL['8-staff-blueline'])
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_from('@gulfsat.mg') -
accountBL.INBOX:contain_subject('[Panne-system #')
)
results:move_messages(accountBL['team'])
-- tasks
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_subject('[DS #') +
accountBL.INBOX:contain_subject('[Panne-system #')
)
results:move_messages(accountBL['3-tasks'])
-- NDR
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_subject('Undelivered Mail Returned to Sender') +
accountBL.INBOX:contain_subject('Mail delivery failed: returning message to sender')
)
results:move_messages(accountBL['NDR'])
-- cron and noisy e-mails
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_subject('Cron <root@bw') +
accountBL.INBOX:contain_subject('Cron <root@rtr') +
accountBL.INBOX:contain_subject('Cron <root@dektec') +
accountBL.INBOX:contain_subject('Cron <root@lte-') +
accountBL.INBOX:contain_subject('Cron <root@wimax-') +
accountBL.INBOX:contain_subject('Cron <root@blpr') +
accountBL.INBOX:contain_subject('Cron <root@bldv') +
accountBL.INBOX:contain_subject('/usr/sbin/apticron') +
accountBL.INBOX:contain_subject('Cron <root@srv-graphe-mrtg> /usr/local/bin/noplan') +
accountBL.INBOX:contain_subject('[Root-sysadmin] Cron <root@srv-capacityp') +
accountBL.INBOX:contain_subject('if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron') +
accountBL.INBOX:contain_subject('[Root-sysadmin] changed ethernet address') +
accountBL.INBOX:contain_subject('Debian package update(s) for ')
) -
accountBL.INBOX:contain_subject('[AS]')
results:move_messages(accountBL.Archives)
-- monitoring and noisy e-mails
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_from('monitoring@blueline.mg') +
accountBL.INBOX:contain_subject('[AS] [ début ] ') +
accountBL.INBOX:contain_subject('[AS] [ fin ] ') +
accountBL.INBOX:contain_subject('[AS] [ en cours ]')
)
results:move_messages(accountBL['11-monitoring'])
-- sysadmin
results = accountBL.INBOX:is_unseen() *
(
accountBL.INBOX:contain_subject('[AS]') +
accountBL.INBOX:contain_subject('[Root-sysadmin]')
)
results:move_messages(accountBL['1-sys-adm'])