commit c19ec86d5ede208dc58435e47cb5966c0bcade97
parent 5dd1adba9571621ea34029b9a1f19430bdc39c82
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Tue, 8 Mar 2016 09:34:52 -0800
add imapfilter configuration
Diffstat:
3 files changed, 160 insertions(+), 1 deletion(-)
diff --git a/.imapfilter/riseup.lua b/.imapfilter/riseup.lua
@@ -0,0 +1,153 @@
+-- see `man imapfilter_config` for info
+
+-------------
+-- Options --
+-------------
+options.timeout = 120
+options.subscribe = true
+--options.namespace = false
+--options.create = true
+
+-- for debugging purposes
+options.info = true
+
+
+
+-- function to strip trailing newlines piped from ~/.mutt/offlineimap.py
+function trim(s)
+ return (s:gsub("^%s*(.-)%s*$", "%1"))
+end
+
+
+--------------
+-- Accounts --
+--------------
+
+status, pass = pipe_from("python ~/.mutt/offlineimap.py andersd mail.riseup.net")
+account = IMAP {
+ server = 'mail.riseup.net',
+ username = 'andersd',
+ password = trim(pass),
+ ssl = 'ssl23'
+}
+
+-- Get a list of the available mailboxes and folders
+mailboxes, folders = account:list_all()
+
+-- Get a list of the subscribed mailboxes and folders
+mailboxes, folders = account:list_subscribed()
+
+
+
+
+-------------------
+-- Mailbox rules --
+-------------------
+
+-- Get the status of a mailbox
+--account.INBOX:check_status()
+
+-- Get all the messages in the mailbox
+--results = account.INBOX:select_all()
+
+-- Get newly arrived, unread messages
+--results = account.INBOX:is_new()
+
+
+-- Debian announcements list --
+addr = 'debian-announce@lists.debian.org'
+mailbox = 'debian-announce'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian laptop list --
+addr = 'debian-laptop@lists.debian.org'
+mailbox = 'debian-laptop'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian news list --
+addr = 'debian-news@lists.debian.org'
+mailbox = 'debian-news'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian photo list --
+addr = 'debian-photo@lists.debian.org'
+mailbox = 'debian-photo'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian security list --
+addr = 'debian-security-announce@lists.debian.org'
+mailbox = 'debian-security-announce'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian security list --
+addr = 'debian-security@lists.debian.org'
+mailbox = 'debian-security'
+----account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian danish list --
+addr = 'debian-user-danish@lists.debian.org'
+mailbox = 'debian-user-danish'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian security announcements list --
+addr = 'debian-security-announce@lists.debian.org'
+mailbox = 'debian-security'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian testing security announcements list --
+addr = 'debian-testing-security-announce@lists.debian.org'
+mailbox = 'debian-security'
+----account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- Debian science list --
+addr = 'debian-science@lists.debian.org'
+mailbox = 'debian-science'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+-- VTK users list --
+addr = 'vtkusers@vtk.org'
+mailbox = 'vtk-users'
+--account:create_mailbox(mailbox)
+--account:subscribe_mailbox(mailbox)
+results = account.INBOX:contain_to(addr) + account.INBOX:contain_cc(addr)
+results:move_messages(account[mailbox])
+
+
+-- Delete old DMI byvejr alerts --
+results = account.INBOX:contain_subject('Byvejr: ') * account.INBOX:is_older(1)
+results:delete_messages()
+
+-- Scholar alerts --
+results = account.INBOX:contain_from('scholaralerts-noreply@google.com')
+results:move_messages(account['academic-alerts'])
+
diff --git a/.mutt/offlineimap.py b/.mutt/offlineimap.py
@@ -46,3 +46,8 @@ def set_keychain_pass(protocol, server, user, password):
gkey.item_create_sync(gkey.get_default_keyring_sync(),
gkey.ITEM_NETWORK_PASSWORD,
name, attrs, password, True)
+
+if __name__ == '__main__':
+ account = sys.argv[1]
+ server = sys.argv[2]
+ print(get_keychain_pass(account=account, server=server))
diff --git a/create_symlinks.sh b/create_symlinks.sh
@@ -19,7 +19,8 @@ done
# Home folder dotfolders
for F in .colors .config/uzbl .config/awesome .config/dwb .config/bspwm \
.config/sxhkd .config/luakit .config/openbox .config/zathura .tmuxinator \
- .i3 .mutt .ncmpcpp .vim .vimperrator .w3m wallpapers .kwm .mpd; do
+ .i3 .mutt .ncmpcpp .vim .vimperrator .w3m wallpapers .kwm .mpd \
+ .imapfilter; do
SOURCE=$PWD/$F
TARGET=~/$F