summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-01-09 16:45:04 -0800
committerJesse Morgan <morganjm@amazon.com>2013-01-09 16:45:04 -0800
commit4e52a7884016a776cbd46d67d09324f2d80a9dc6 (patch)
treed80730dbb51309a0e617b15b0725c1c1b8f13be4 /base
parentd6cdd193535b974a70071b992bcb44a5b9efe26e (diff)
Various changes to make offlineimap work better on my laptop.
Diffstat (limited to 'base')
-rw-r--r--base/bashrc13
-rw-r--r--base/muttrc1
-rw-r--r--base/offlineimap/.nolink0
-rw-r--r--base/offlineimap/helper.py26
-rw-r--r--base/offlineimaprc24
5 files changed, 64 insertions, 0 deletions
diff --git a/base/bashrc b/base/bashrc
index 204fcf0..b7f87f1 100644
--- a/base/bashrc
+++ b/base/bashrc
@@ -103,12 +103,25 @@ if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
fi
# Personal Settings
+export TERMINAL=gnome-terminal
export EDITOR=vim
+export MAILDIR=$HOME/.maildir/INBOX
if [ -f ~/.shell_pathes ]; then
source ~/.shell_pathes
fi
+# GPG
+if [ -f "${HOME}/.gpg-agent-info" ]; then
+ . "${HOME}/.gpg-agent-info"
+ export GPG_AGENT_INFO
+ export SSH_AUTH_SOCK
+fi
+
+GPG_TTY=$(tty)
+export GPG_TTY
+
+
# Host Specific Settings
if [ -f ~/.host-specific/bashrc ]; then
source ~/.host-specific/bashrc
diff --git a/base/muttrc b/base/muttrc
index caebefa..867e1a0 100644
--- a/base/muttrc
+++ b/base/muttrc
@@ -12,6 +12,7 @@ set delete=yes
unset confirmappend
set sort=threads
set pager_stop=yes
+set mark_old = no
# Headers
ignore *
diff --git a/base/offlineimap/.nolink b/base/offlineimap/.nolink
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/base/offlineimap/.nolink
diff --git a/base/offlineimap/helper.py b/base/offlineimap/helper.py
new file mode 100644
index 0000000..9cb94d8
--- /dev/null
+++ b/base/offlineimap/helper.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+import os, subprocess,sys
+
+
+def mailpasswd(file):
+ path = os.getenv("HOME") + "/.offlineimap/" + file + ".gpg"
+ args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
+ try:
+ return subprocess.check_output(args).strip()
+ except subprocess.CalledProcessError:
+ return ""
+
+def prime_gpg_agent():
+ ret = False
+ i = 1
+ while not ret:
+ ret = (mailpasswd("prime") == "prime")
+ if i > 2:
+ from offlineimap.ui import getglobalui
+ sys.stderr.write("Error reading in passwords. Terminating.\n")
+ getglobalui().terminate()
+ i += 1
+ return ret
+
+prime_gpg_agent()
diff --git a/base/offlineimaprc b/base/offlineimaprc
new file mode 100644
index 0000000..ce7106e
--- /dev/null
+++ b/base/offlineimaprc
@@ -0,0 +1,24 @@
+[general]
+accounts = Jesterpm.net
+pythonfile = ~/.offlineimap/helper.py
+
+[Account Jesterpm.net]
+localrepository = Local
+remoterepository = Remote
+#autorefresh = 5
+status_backend = sqlite
+
+[Repository Local]
+type = Maildir
+localfolders = ~/.maildir
+
+[Repository Remote]
+type = IMAP
+remotehost = californium.jesterpm.net
+remoteusereval = "jesse"
+remotepasseval = mailpasswd("password")
+folderfilter = lambda folder: folder not in ['sent', 'search']
+ssl = yes
+maxconnections = 2
+#holdconnectionopen = false
+#idlefolders = ['INBOX', 'dc206']