commit c55641f94096ea064c59066db80600b9cf05dcfc parent cc1a1bffa162be243a19c50446de0ee1a281037c Author: Anders Damsgaard Christensen <adc@geo.au.dk> Date: Tue, 8 Nov 2016 22:47:39 -0800 add missing dotfiles Diffstat:
A | .imapfilter/riseup.lua | | | 173 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | .notmuch-config | | | 98 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 271 insertions(+), 0 deletions(-)
diff --git a/.imapfilter/riseup.lua b/.imapfilter/riseup.lua @@ -0,0 +1,173 @@ +-- 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() + +-------------------- +-- Spam filtering -- +-------------------- +--all = account.INBOX:select_all() +all = account.INBOX:is_new() +spam = Set {} +unsure = Set {} +for _, msg in ipairs(all) do + mbox, uid = unpack(msg) + text = mbox[uid]:fetch_message() + flag = pipe_to('bogofilter', text) + if (flag == 0) then + table.insert(spam, msg) + elseif (flag == 2) then + table.insert(unsure, msg) + end +end +--account:create_mailbox('Spam/unsure') +spam:move_messages(account['Spam']) +--unsure:copy_messages(account['Junk/unsure']) +unsure:move_messages(account['Spam/unsure']) + + +-- 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/.notmuch-config b/.notmuch-config @@ -0,0 +1,98 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see http://notmuchmail.org + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# +[database] +#path=/Users/adamsgaard/Mail + +# User configuration +# +# Here is where you can let notmuch know how you would like to be +# addressed. Valid settings are +# +# name Your full name. +# primary_email Your primary email address. +# other_email A list (separated by ';') of other email addresses +# at which you receive email. +# +# Notmuch will use the various email addresses configured here when +# formatting replies. It will avoid including your own addresses in the +# recipient list of replies, and will set the From address based on the +# address to which the original email was addressed. +# +[user] +name=Anders Damsgaard +primary_email=andersd@riseup.net +other_email=adc@geo.au.dk;anders.damsgaard@geo.au.dk;adamsgaard@ucsd.edu;andersdc@gmail.com;a.damsgaard@icloud.com;andersd@stanford.edu + +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# +[new] +tags=unread;inbox; +ignore= + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# +[maildir] +synchronize_flags=true + +# Cryptography related configuration +# +# The following option is supported here: +# +# gpg_path +# binary name or full path to invoke gpg. +# +[crypto] +gpg_path=gpg