summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rwxr-xr-xmutt/choose-muttrc-type12
-rw-r--r--mutt/imap7
-rw-r--r--mutt/muttrc (renamed from muttrc)17
-rw-r--r--mutt/offlineimap16
5 files changed, 40 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index e949655..1023095 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,10 @@ INSTALL := \
.mailcap \
.mpdconf \
.msmtprc \
- .muttrc \
+ .mutt/choose-muttrc-type \
+ .mutt/imap \
+ .mutt/muttrc \
+ .mutt/offlineimap \
.ncmpcpp/bindings \
.nethackrc \
.perlcriticrc \
diff --git a/mutt/choose-muttrc-type b/mutt/choose-muttrc-type
new file mode 100755
index 0000000..46b2cbe
--- /dev/null
+++ b/mutt/choose-muttrc-type
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+
+case "$(hostname)" in
+hush)
+ echo 'source ~/.mutt/offlineimap'
+ ;;
+*)
+ echo 'source ~/.mutt/imap'
+ ;;
+esac
diff --git a/mutt/imap b/mutt/imap
new file mode 100644
index 0000000..09649c9
--- /dev/null
+++ b/mutt/imap
@@ -0,0 +1,7 @@
+set folder="imap://doy@mail.tozt.net"
+set spoolfile="=INBOX"
+bind index R imap-fetch-mail
+set timeout=60
+set mail_check=60
+
+# vim: ft=muttrc
diff --git a/muttrc b/mutt/muttrc
index 1ad1387..a992dc4 100644
--- a/muttrc
+++ b/mutt/muttrc
@@ -1,20 +1,9 @@
# folders {{{
-set mbox_type=Maildir
-set folder="~/Maildir"
-set spoolfile="~/Maildir/INBOX"
set record="=Sent"
set postponed="=Drafts"
set header_cache="~/.cache/mutt/headers"
set message_cachedir="~/.cache/mutt/bodies"
set mailcap_path="~/.mailcap"
-mailboxes = `\
- for folder in ~/Maildir/*; do\
- basename=$(basename "$folder");\
- if [ "x${basename:0:4}" != "xold." \
- -a "x$basename" != "xspam" ]; then\
- echo -n "\"=$basename\" ";\
- fi\
- done`
# }}}
# identity {{{
# i am "Jesse Luehrs <doy@tozt.net>"
@@ -146,7 +135,6 @@ bind index p search-opposite
bind index A group-reply
bind index g first-entry
bind index G last-entry
-macro index R "<enter-command>unset wait_key<enter><shell-escape>update_mail<enter><enter-command>set wait_key<enter>" "fetch mail with offlineimap"
macro index S "<enter-command>set resolve=no<enter><clear-flag>N<save-message>=spam<enter><enter-command>set resolve=yes<enter>" "mark message as spam"
macro index \Cn "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
@@ -169,12 +157,9 @@ macro index,pager U "<enter-command> set my_pdsave=\$pipe_decode<enter>\
set imap_passive=no
# populate the mailboxes list from the imap subscription list
set imap_check_subscribed
-# check mail frequently
-# NOTE: change this with an account hook if a non-local account is added
-set timeout=3
-set mail_check=0
# }}}
# aliases {{{
set query_command = "abook --mutt-query '%s'"
# }}}
+source '~/.mutt/choose-muttrc-type|'
# vim: fdm=marker
diff --git a/mutt/offlineimap b/mutt/offlineimap
new file mode 100644
index 0000000..6a8addb
--- /dev/null
+++ b/mutt/offlineimap
@@ -0,0 +1,16 @@
+set mbox_type=Maildir
+set folder="~/Maildir"
+set spoolfile="~/Maildir/INBOX"
+mailboxes = `\
+ for folder in ~/Maildir/*; do\
+ basename=$(basename "$folder");\
+ if [ "x${basename:0:4}" != "xold." \
+ -a "x$basename" != "xspam" ]; then\
+ echo -n "\"=$basename\" ";\
+ fi\
+ done`
+macro index R "<enter-command>unset wait_key<enter><shell-escape>update_mail<enter><enter-command>set wait_key<enter>" "fetch mail with offlineimap"
+set timeout=3
+set mail_check=0
+
+# vim: ft=muttrc