Permalink
Browse files

add linguamatics email set up

  • Loading branch information...
Hamish Downer
Hamish Downer committed Dec 30, 2015
1 parent 074052c commit a02eab4201facbd94e058090f4fd9a6f981c73d0
Showing with 165 additions and 11 deletions.
  1. +4 −0 emacs.d/init.el
  2. +6 −9 emacs.d/init/init-notmuch.el
  3. +4 −2 freshrc
  4. +91 −0 mail/notmuch-config-linguamatics
  5. +60 −0 mail/notmuch-post-new.linguamatics
View
@@ -7,6 +7,10 @@
;("marmalade" . "http://marmalade-repo.org/packages/")
;("melpa" . "http://melpa.milkbox.net/packages/")))
; use files from brew emacs install
(let ((default-directory "/opt/hamish/.linuxbrew/share/emacs/site-lisp/"))
(normal-top-level-add-subdirs-to-load-path))
; don't show the start up screen
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
@@ -5,7 +5,7 @@
(require 'notmuch)
; notmuch runs on a server, we use this script
(setq notmuch-command "~/bin/remote-notmuch.sh")
(setq notmuch-command "~/bin/notmuch")
; bcc emails to self, as the emails live on a different machine
(setq notmuch-fcc-dirs nil)
@@ -24,21 +24,18 @@
("flagged" :foreground "green")))
(setq notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :sort-order 'newest-first)
(:name "unreadinbox" :query "tag:inbox AND tag:unread" :sort-order 'newest-first)
(:name "unread" :query "tag:unread AND NOT tag:nagios AND NOT tag:carers" :sort-order 'newest-first)
(:name "nagios" :query "tag:nagios" :sort-order 'newest-first)
(:name "carers" :query "tag:carers AND NOT tag:logwatch" :sort-order 'newest-first)))
(:name "unreadinbox" :query "tag:inbox AND tag:unread" :sort-order 'newest-first)))
; message-mode stuff
;(setq message-send-mail-function 'message-send-mail-with-sendmail)
;(setq sendmail-program "/usr/sbin/sendmail")
;(setq sendmail-program "/home/hamish/bin/sendmail-ssh")
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-default-smtp-server "mail.aptivate.org"
smtpmail-smtp-server "mail.aptivate.org"
smtpmail-default-smtp-server "mail.linguamatics.com"
smtpmail-smtp-server "mail.linguamatics.com"
smtpmail-stream-type 'ssl
;smtpmail-smtp-service 587)
smtpmail-smtp-service 465)
smtpmail-smtp-service 587)
;smtpmail-smtp-service 465)
(setq message-from-style 'angles)
;(setq smtpmail-debug-info t)
View
@@ -123,8 +123,10 @@ if [ $(hostname) = "steelcommando" ]; then
# fresh mail/offlineimaprc --file=~/.offlineimaprc
# notmuch filtering
# fresh mail/notmuch-post-new.linguamatics --bin=~/workmail/.notmuch/hooks/post-new
# fresh afew/config.linguamatics --file=~/.config/afew/config
fresh mail/notmuch-config-linguamatics --file=~/.notmuch-config
fresh mail/notmuch-post-new.linguamatics --bin=~/local/mail/.notmuch/hooks/post-new
fresh afew/config.linguamatics --file=~/.config/afew/config
fresh mail/notmuch-work-abook-ignore --file=/opt/hamish/.notmuch-work-abook-ignore
fi
@@ -0,0 +1,91 @@
# .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=/home/hdowner/local/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=Hamish Downer
primary_email=hamish.downer@linguamatics.com
# 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=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
[addressbook]
path=/home/hdowner/local/.notmuch-work-abook.db
backend=sqlite3
ignorefile=/home/hdowner/local/.notmuch-work-abook-ignore
@@ -0,0 +1,60 @@
#!/bin/sh
LD_LIBRARY_PATH=$HOME/.linuxbrew/lib
NMW=/home/hdowner/bin/notmuch
EDE=/home/hdowner/.local/bin/extract_django_error
# ensure we label stuff in the new spam folder
# django-errors get special handling
#$NMW tag --batch <<EOF2
#+inbox +django-error -- 'tag:new AND subject:"django error external ip internal server error"'
#EOF2
#for msgid in $($NMW search --format=text --output=messages '(tag:new AND tag:django-error)') ; do
# the msgid starts with "id:" so we don't need to add it below
# file=$($NMW search --output=files --limit=1 "$msgid")
# error_tag=$($EDE --one-word $file)
# $NMW tag +$error_tag -- "$msgid"
#done
$NMW tag --batch <<EOF3
-new -- tag:new AND tag:django-error
# skip the inbox (mostly ...)
#-new +nagios -- tag:new AND from:nagios
# tag and put in inbox, but skip the notmuch-abook stage
#-new +inbox +action -- tag:new AND from:projects@linguamatics.com AND subject:"due in the next"
EOF3
# update notmuch-abook after the email I don't care about addresses for
# has been dealt with
if [ $(hostname) = 'foobacca.co.uk' ]; then
for file in $($NMW search --output=files '(tag:new AND NOT tag:consensus)') ; do
cat $file | LD_LIBRARY_PATH=$HOME/.linuxbrew/lib $HOME/bin/notmuch-abook -c $HOME/.notmuch-config-work update
done
fi
$NMW tag --batch <<EOF4
+sent -unread -- tag:new AND from:hamish.downer@linguamatics.com
+sent -unread -- tag:new AND from:hamish.downer+sent@linguamatics.com
#+here -- tag:new AND to:here@linguamatics.com
#+support -- tag:new AND to:support@linguamatics.com
# +ethical_engagement -- tag:new AND subject:"ethical engagement"
EOF4
# just does some regex header stuff
# TODO: reinstate
# LD_LIBRARY_PATH=$HOME/.linuxbrew/lib $HOME/.local/bin/afew \
# --notmuch-config=$HOME/.notmuch-config-work --new --tag
$NMW tag --batch <<EOF5
# finally, add the inbox tag to non killed/spam
+inbox -new -- tag:new AND NOT tag:killed AND NOT tag:spam
# and remove the new tag completely
-new -- tag:new
EOF5

0 comments on commit a02eab4

Please sign in to comment.