bye sup, hi notmuch/alot

This commit is contained in:
Felix Van der Jeugt 2017-04-27 18:51:18 +02:00
parent 911acc84d4
commit 55376c70d7
No known key found for this signature in database
GPG Key ID: 58B209295023754D
16 changed files with 167 additions and 177 deletions

30
config/alot/config Normal file
View File

@ -0,0 +1,30 @@
initial_command = search tag:inbox OR tag:draft AND NOT tag:killed
periodic_hook_frequency = 60
[accounts]
[[gmail]]
realname = Felix Van der Jeugt
address = felix.vanderjeugt@gmail.com
alias_regexp = felix\.vanderjeugt\+.+@gmail.com
sendmail_command = /usr/bin/msmtp --account=gmail -t
sent_box = maildir:///data/mail/gmail/Sent
draft_box = maildir:///data/mail/gmail/Sent
sent_tags = sent, gmail
sign_by_default = True
[[ugent]]
realname = Felix Van der Jeugt
address = felix.vanderjeugt@ugent.be
aliases = Felix.VanderJeugt@UGent.be,
gpg_key = 68FF561137C38F9618E97339AF25A2C2862AA368
sendmail_command = /usr/bin/msmtp --account=ugent -t
sent_box = maildir:///data/mail/ugent/Sent
draft_box = maildir:///data/mail/ugent/Sent
sent_tags = sent, ugent
sign_by_default = True
[bindings]
P = shellescape --thread True --refocus True notmuch\ new\ --quiet

16
config/alot/hooks.py Normal file
View File

@ -0,0 +1,16 @@
from alot.commands.globals import ExternalCommand
from alot.commands.search import OpenThreadCommand
def loop_hook(ui=None):
ui.apply_command(ExternalCommand(
["notmuch", "new", "--quiet"],
thread=True,
))
if ui and ui.current_buffer:
ui.update()
def post_search_select(ui=None, dbm=None, cmd=None):
if isinstance(cmd, OpenThreadCommand):
cmd.thread.remove_tags({"unread"})

12
local/bin/alot Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python2
# EASY-INSTALL-ENTRY-SCRIPT: 'alot==0.6.0.dev0','console_scripts','alot'
__requires__ = 'alot==0.6.0.dev0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('alot==0.6.0.dev0', 'console_scripts', 'alot')()
)

1
mailcap Normal file
View File

@ -0,0 +1 @@
text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput

98
notmuch-config Normal file
View File

@ -0,0 +1,98 @@
# .notmuch-config - Configuration file for the notmuch mail system
#
# For more information about notmuch, see https://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=/data/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=Felix Van der Jeugt
primary_email=felix.vanderjeugt@gmail.com
other_email=felix.vanderjeugt@ugent.be;
# 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;new;
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=gpg2

8
notmuch-hooks/post-new Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# notify for new messages
notmuch search tag:new | cut -d' ' --complement -f1 | xargs -0 --no-run-if-empty notify-send
# finally, put new messages in the inbox
notmuch tag +inbox -new -- tag:new

2
notmuch-hooks/pre-new Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
mbsync -qq ugent gmail

8
sup/.gitignore vendored
View File

@ -1,8 +0,0 @@
lock
log
sent.mbox
sync-back-ok
xapian
contacts.txt
labels.txt
drafts

View File

@ -1,49 +0,0 @@
---
:editor: nvim
:thread_by_subject: false
:edit_signature: false
:ask_for_from: false
:ask_for_to: true
:ask_for_cc: false
:ask_for_bcc: false
:ask_for_subject: true
:account_selector: true
:confirm_no_attachments: true
:confirm_top_posting: true
:jump_to_open_message: true
:discard_snippets_from_encrypted_messages: false
:load_more_threads_when_scrolling: true
:default_attachment_save_dir: '/data/temporary'
:sent_source: sup://sent
:archive_sent: true
:poll_interval: 300
:wrap_width: 0
:slip_rows: 0
:col_jump: 2
:stem_language: english
:sync_back_to_maildir: true
:continuous_scroll: true
:always_edit_async: false
:accounts:
:default:
:name: Felix Van der Jeugt
:email: felix.vanderjeugt@gmail.com
:alternates: [felixvdj@zeus.ugent.be]
:sendmail: "/usr/bin/msmtp --account=gmail -t --read-envelope-from"
:signature: "/home/felix/.signature"
:gpgkey: ''
:ugent:
:name: Felix Van der Jeugt
:email: felix.vanderjeugt@ugent.be
:alternates: []
:sendmail: "/usr/bin/msmtp --account=ugent -t --read-envelope-from"
:signature: "/home/felix/.signature"
:gpgkey: ''
:12ul:
:name: Felix Van der Jeugt
:email: felix.vanderjeugt@12urenloop.be
:alternates: []
:sendmail: "/usr/bin/msmtp --account=12ul -t --read-envelope-from"
:signature: "/home/felix/.signature"
:gpgkey: ''
:time_mode: 24h

View File

@ -1,6 +0,0 @@
if num_inbox > 0
system "notify-send", \
"#{num_inbox_total_unread} unread messages (#{num_inbox} new)", \
from_and_subj_inbox.map {|p| "#{p[0]} - #{p[1]}"}.join("\n")
end

View File

@ -1,4 +0,0 @@
say "Running mbsync..."
if not system "mbsync", "-qq", "ugent", "gmail"
say "mbsync unsuccesful."
end

View File

@ -1,3 +0,0 @@
crypto_selector.set_to :sign if crypto_selector.can_set_to? :sign

View File

@ -1,46 +0,0 @@
#!/usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
require 'xapian'
require 'trollop'
require 'set'
unless defined? BASE_DIR
BASE_DIR = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup")
end
xapian = Xapian::Database.new File.join(BASE_DIR, 'xapian')
version = xapian.get_metadata 'rescue-version'
version = '0' if version.empty?
contacts = Hash.new { |key| Set.new }
case version
when '0'
xapian.postlist('Kmail').each do |x|
entry = Marshal.load(xapian.document(x.docid).data)
([entry[:from]] + entry[:to] + entry[:cc] + entry[:bcc]).compact.each do |email, name|
next if email.nil?
name = name.strip.chomp("'").chomp('"').reverse
.chomp("'").chomp('"').reverse unless name.nil?
email.downcase!
if name.nil? or email.include? name.downcase
contacts[email] = Set.new unless contacts.has_key? email
else
contacts[email] <<= name
end
end
end
else
abort "this sup-dump version doesn't understand your index"
end
contacts.map do |email, names|
if names.empty?
email
else
names.map { |name| "#{name} <#{email}>" }
end
end.flatten

View File

@ -1 +0,0 @@
system "xdg-open #{uri} > /dev/null"

View File

@ -1,7 +0,0 @@
require 'shellwords'
unless sibling_types.member? "text/plain"
case content_type
when "text/html"
`/usr/bin/w3m -dump -T #{content_type} #{Shellwords.escape filename}`
end
end

View File

@ -1,53 +0,0 @@
---
- !supmua.org,2006-10-01/Redwood/Maildir
uri: maildir:/data/mail/gmail/Inbox
usual: true
archived: false
sync_back: true
id: 1
labels:
- GMail
- !supmua.org,2006-10-01/Redwood/Maildir
uri: maildir:/data/mail/ugent/Inbox
usual: true
archived: false
sync_back: true
id: 3
labels:
- UGent
- !supmua.org,2006-10-01/Redwood/Maildir
uri: maildir:/data/mail/12ul/Inbox
usual: true
archived: false
sync_back: true
id: 5
labels:
- 12UL
- !supmua.org,2006-10-01/Redwood/Maildir
uri: maildir:/data/mail/gmail/Sent
usual: true
archived: true
sync_back: true
id: 2
labels:
- GMail
- Sent
- !supmua.org,2006-10-01/Redwood/Maildir
uri: maildir:/data/mail/ugent/Sent
usual: true
archived: true
sync_back: true
id: 4
labels:
- UGent
- Sent
- !supmua.org,2006-10-01/Redwood/Maildir
uri: maildir:/data/mail/12ul/Sent
usual: true
archived: true
sync_back: true
id: 6
labels:
- 12UL
- Sent
- !supmua.org,2006-10-01/Redwood/SentLoader {}