From dd4b2aad1d694ad73fe6162b6057bcd88c2c5104 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sun, 3 May 2020 18:28:28 +0100 Subject: [PATCH] Adds imapfilter to dotfiles --- imapfilter/.config/imapfilter/config.lua | 43 ++++++++++++++++++ .../imapfilter/work-account.lua.secret | Bin 0 -> 318 bytes 2 files changed, 43 insertions(+) create mode 100644 imapfilter/.config/imapfilter/config.lua create mode 100644 imapfilter/.config/imapfilter/work-account.lua.secret diff --git a/imapfilter/.config/imapfilter/config.lua b/imapfilter/.config/imapfilter/config.lua new file mode 100644 index 00000000..bcd1c24c --- /dev/null +++ b/imapfilter/.config/imapfilter/config.lua @@ -0,0 +1,43 @@ +-- According to the IMAP specification, when trying to write a message +-- to a non-existent mailbox, the server must send a hint to the client, +-- whether it should create the mailbox and try again or not. However +-- some IMAP servers don't follow the specification and don't send the +-- correct response code to the client. By enabling this option the +-- client tries to create the mailbox, despite of the server's response. +-- This variable takes a boolean as a value. Default is “false”. +options.create = true +-- By enabling this option new mailboxes that were automatically created, +-- get auto subscribed +options.subscribe = true +-- How long to wait for servers response. +options.timeout = 120 + +-- The directory for all my imapfilder files +imapfilterdir= os.getenv("HOME") .. '/.config/imapfilter/' + + + +function split (inputstr, sep) + if sep == nil then + sep = "%s" + end + local t={} + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + table.insert(t, str) + end + return t +end + +-- This function takes a table of email addresses and flags messages from them in the inbox. +function flagSenders(senders) + for _, v in pairs(senders) do + messages = work["Inbox"]:contain_from(v) + messages:mark_flagged() + end +end + + +-- Load my work-account credentials and work specific rules +loadfile(imapfilterdir .. "work-account.lua.secret")() + + diff --git a/imapfilter/.config/imapfilter/work-account.lua.secret b/imapfilter/.config/imapfilter/work-account.lua.secret new file mode 100644 index 0000000000000000000000000000000000000000..24c66fdd09d4da8a4b50e48ee33ccf88dbdd1d86 GIT binary patch literal 318 zcmV-E0m1$NM@dveQdv+`0DW-wv2V-3ZI>93hCC;!m@+X!3c|$oJ4u=ld{{#1y@*N;c%>^Ek$YXe zg1DC0Gsb?>j5zy73DU3u?Ba^`SVslQ9ZhVPEFdTmbTEz+k}SLy_wd%ZE?+=%vqy}> zmZ2d8Du5FCcZ}66&_|IC0DDy;K?R!=Lq7uUp>GRCX5jcj3i^vL}9ML3w5f~ z`!~_PA(j*8eor)L8yP7mAhTtj