Browse Source

Remove imapfilter config (replaced by imapdomo)

Alois Mahdal 8 years ago
parent
commit
07a527f186

+ 0
- 1
.gitignore View File

@@ -3,7 +3,6 @@
3 3
 .netrwhist
4 4
 */gittum/private.gitconfig
5 5
 */vim/bundle/private/*
6
-dotfiles/imapfilter/private
7 6
 dotfiles/imapdomo/private
8 7
 dotfiles/imapdomo/certificates
9 8
 dotfiles/moc/cache/

+ 0
- 74
dotfiles/imapfilter/common/functions.lua View File

@@ -1,74 +0,0 @@
1
-os = require "os"
2
-socket = require "socket"
3
-
4
-function shortname()
5
-    local long = socket.dns.gethostname()
6
-    return string.gmatch(long, '[^.]+')()
7
-end
8
-
9
-function get_queue(mbox)
10
-    --TODO: try to get tail
11
-    return mbox.FILTER_QUEUE:is_newer(84)
12
-end
13
-
14
-function _notifirc1(subj, from, body)
15
-    --notify about message using (pre-configured) notifirc
16
-    local fd = assert(io.popen('notifirc -f - "message preview:"', "w"))
17
-    local fmt = "> %s\n> %s\n> BODY: %s"
18
-    fd:write(fmt:format(subj, from, body))
19
-    fd:close()
20
-end
21
-
22
-function notifirc_all(seq)
23
-    for _, mesg in ipairs(seq) do
24
-        mbox, uid = table.unpack(mesg)
25
-        subj = mbox[uid]:fetch_field('Subject')
26
-        from = mbox[uid]:fetch_field('From')
27
-        body = mbox[uid]:fetch_body()
28
-        _notifirc1(subj, from, body)
29
-    end
30
-end
31
-
32
-function _partinf_compare(a, b)
33
-    if not type(a) == type(b) then
34
-        return false
35
-    end
36
-    if type(a) == 'number' then
37
-        return a == b
38
-    elseif type(a) == 'string' then
39
-        return a:lower() == b:lower()
40
-    end
41
-end
42
-
43
-function has_part_like(query, structure)
44
-    if structure == nil then
45
-        return false
46
-    end
47
-    for partid, partinf in pairs(structure) do
48
-        local part_answer = true
49
-        -- check all query parts
50
-        for qkey, qvalue in pairs(query) do
51
-            value = partinf[qkey]
52
-            if not _partinf_compare(value, qvalue) then
53
-                part_answer = false
54
-                break
55
-            end
56
-        end
57
-        if part_answer then
58
-            return true
59
-        end
60
-    end
61
-    return false
62
-end
63
-
64
-function filter_part_like(query, seq)
65
-    result = Set {}
66
-    for _, mesg in ipairs(seq) do
67
-        mbox, uid = table.unpack(mesg)
68
-        structure = mbox[uid]:fetch_structure()
69
-        if has_part_like(query, structure) then
70
-            table.insert(result, mesg)
71
-        end
72
-    end
73
-    return result
74
-end

+ 0
- 6
dotfiles/imapfilter/config.lua View File

@@ -1,6 +0,0 @@
1
-dofile ".imapfilter/common/functions.lua"
2
-
3
-host_folder = ".imapfilter/host/" .. shortname()
4
-dofile (host_folder .. "/accounts.lua")
5
-dofile (host_folder .. "/options.lua")
6
-dofile (host_folder .. "/rules.lua")

+ 0
- 1
dotfiles/imapfilter/host View File

@@ -1 +0,0 @@
1
-../../external/dotfiles/imapfilter/host

+ 0
- 4
dotfiles/imapfilter/private/README View File

@@ -1,4 +0,0 @@
1
-Keep here only files that are never to leave the particular
2
-machine ie. never to be backed up or synchronized.
3
-
4
-This folder should be auto-ignored by all such tools.