aboutsummaryrefslogtreecommitdiffstats
path: root/mutt
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-02-02 20:35:42 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-02-02 22:01:01 +0100
commit7e7aa928072775240ff70ca61f2dd0e8a09242d8 (patch)
treee22d0a73612befd95744dec72770e74593ab47cd /mutt
downloaddotfiles-7e7aa928072775240ff70ca61f2dd0e8a09242d8.tar.xz
(Let's pretend that this is the) initial commit
Diffstat (limited to 'mutt')
-rw-r--r--mutt/gpg.rc85
-rw-r--r--mutt/mailcap2
-rw-r--r--mutt/muttrc139
-rw-r--r--mutt/sig3
-rw-r--r--mutt/themes/comidia52
-rw-r--r--mutt/themes/current88
-rwxr-xr-xmutt/tiny.pl49
7 files changed, 418 insertions, 0 deletions
diff --git a/mutt/gpg.rc b/mutt/gpg.rc
new file mode 100644
index 0000000..d6c9def
--- /dev/null
+++ b/mutt/gpg.rc
@@ -0,0 +1,85 @@
+# -*-muttrc-*-
+#
+# Command formats for gpg.
+#
+# This version uses gpg-2comp from
+# http://70t.de/download/gpg-2comp.tar.gz
+#
+# $Id$
+#
+# %p The empty string when no passphrase is needed,
+# the string "PGPPASSFD=0" if one is needed.
+#
+# This is mostly used in conditional % sequences.
+#
+# %f Most PGP commands operate on a single file or a file
+# containing a message. %f expands to this file's name.
+#
+# %s When verifying signatures, there is another temporary file
+# containing the detached signature. %s expands to this
+# file's name.
+#
+# %a In "signing" contexts, this expands to the value of the
+# configuration variable $pgp_sign_as. You probably need to
+# use this within a conditional % sequence.
+#
+# %r In many contexts, mutt passes key IDs to pgp. %r expands to
+# a list of key IDs.
+
+# Note that we explicitly set the comment armor header since GnuPG, when used
+# in some localiaztion environments, generates 8bit data in that header, thereby
+# breaking PGP/MIME.
+
+# decode application/pgp
+set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
+
+# verify a pgp/mime signature
+set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"
+
+# decrypt a pgp/mime attachment
+set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
+
+# create a pgp/mime signed attachment
+# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
+set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
+
+# create a application/pgp signed (old-style) message
+# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
+set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
+
+# create a pgp/mime encrypted attachment
+# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
+set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
+
+# create a pgp/mime encrypted and signed attachment
+# set pgp_encrypt_sign_command="pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
+set pgp_encrypt_sign_command="pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
+
+# import a key into the public key ring
+set pgp_import_command="gpg --no-verbose --import %f"
+
+# export a key from the public key ring
+set pgp_export_command="gpg --no-verbose --export --armor %r"
+
+# verify a key
+set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
+
+# read in the public key ring
+set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --list-keys %r"
+
+# read in the secret key ring
+set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --list-secret-keys %r"
+
+# fetch keys
+# set pgp_getkeys_command="pkspxycwrap %r"
+
+# pattern for good signature - may need to be adapted to locale!
+
+# set pgp_good_sign="^gpgv?: Good signature from "
+
+# OK, here's a version which uses gnupg's message catalog:
+# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`"
+
+# This version uses --status-fd messages
+set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
+
diff --git a/mutt/mailcap b/mutt/mailcap
new file mode 100644
index 0000000..e0ed500
--- /dev/null
+++ b/mutt/mailcap
@@ -0,0 +1,2 @@
+text/html; ~/.config/mutt/tiny.pl %s %{charset} ; copiousoutput ; nametemplate=%s.html
+text/plain; ~/.config/mutt/tiny.pl %s %{charset} 't' ; copiousoutput ; nametemplate=%s.html
diff --git a/mutt/muttrc b/mutt/muttrc
new file mode 100644
index 0000000..8044f21
--- /dev/null
+++ b/mutt/muttrc
@@ -0,0 +1,139 @@
+# Compose View Options -------------------------------
+set realname = "Johannes Löthberg"
+set from = "johannes@kyriasis.com"
+set envelope_from # which from?
+set sig_dashes # dashes before sig
+set edit_headers # show headers when composing
+set fast_reply # skip to compose when replying
+set fcc_attach # save attachments with the body
+unset mime_forward # forward attachments as part of body
+set forward_format = "Fwd: %s" # format of subject when forwarding
+set forward_decode # decode when forwarding
+set attribution = "On %d, %n wrote:" # format of quoting header
+set reply_to # reply to Reply to: field
+set reverse_name # reply as whomever it was to
+set include # include message in replies
+set forward_quote # include message in forwards
+set charset = "utf-8"
+set send_charset = "utf-8"
+
+set editor = "vim"
+set text_flowed = yes
+set mark_old = no
+set sleep_time = 0 # no delay when opening a maildir!
+
+set mbox_type = Maildir
+set folder = "~/.mail/kyriasis"
+set trash = "~/.mail/kyriasis/Trash"
+set header_cache = ~/.config/mutt/cache/headers # where to store headers
+set message_cachedir = ~/.config/mutt/cache/ # where to store bodies
+set certificate_file = ~/.config/mutt/certificates # where to store certs
+set mailcap_path = ~/.config/mutt/mailcap # entries for filetypes
+set tmpdir = ~/.config/mutt/temp # where to keep temp files
+set signature = ~/.config/mutt/sig # my signature file
+set spoolfile = "+INBOX"
+set mbox = "+Archives"
+set postponed = "+Drafts"
+mailboxes +INBOX +Sent +Drafts +Trash +Archives +arch-dev-public +arch-bugs +Spam +Ham
+
+## Abook
+set query_command= "abook --datafile ~/.config/abook/addressbook --mutt-query '%s'"
+macro index,pager A "<pipe-message>abook --datafile ~/.config/abook/addressbook --add-email-quiet<return>" "Add this sender to Abook"
+bind editor <Tab> complete-query
+
+# Sync email
+macro index O "<shell-escape>offlineimap<enter>" "run offlineimap to sync all mail"
+macro index o "<shell-escape>offlineimap -qf INBOX<enter>" "run offlineimap to sync inbox"
+
+set sendmail = "/usr/bin/msmtp -a kyriasis"
+set sendmail_wait = 0
+set record = +Sent
+set copy = yes
+
+# Basic Options --------------------------------------
+#set wait_key = no # shut up, mutt
+#set timeout = 3 # idle time before scanning
+#set mail_check = 0 # minimum time between scans
+#unset move # gmail does that
+#set delete # don't ask, just do
+#unset confirmappend # don't ask, just do!
+#set quit # don't ask, just do!!
+#unset mark_old # read/new is good enough for me
+set beep_new # bell on new mails
+unset pipe_decode # strip headers and eval mimes when piping
+set thorough_search # strip headers and eval mimes before searching
+
+
+# Status Bar -----------------------------------------
+set status_chars = " *%A"
+set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"
+
+# Header Options -------------------------------------
+#ignore * # ignore all headers
+#unignore from: to: cc: date: subject: # show only these
+unignore X-Spambayes-Classification: X-Spambayes-Trained:
+#unhdr_order * # some distros order things by default
+#hdr_order from: to: cc: date: subject: # and in this order
+
+# Index View Options ---------------------------------
+set date_format = "%d/%m"
+set index_format = "[%Z] %D %-20.20F %s"
+set sort = threads # like gmail
+#set sort_aux = reverse-last-date-received # like gmail
+#set sort = reverse-last-date-received # like gmail
+#set sort_aux = threads # like gmail
+set uncollapse_jump # don't collapse on an unread message
+set sort_re # thread based on regex
+set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
+# Pager View Options ---------------------------------
+set pager_index_lines = 10 # number of index lines to show
+set pager_context = 3 # number of context lines to show
+set pager_stop # don't go to next message automatically
+set menu_scroll # scroll in menus
+set tilde # show tildes like in vim
+unset markers # no ugly plus signs
+
+set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
+alternative_order text/plain text/enriched text/html
+
+
+macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
+macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"
+
+# Index Key Bindings
+bind index gg first-entry
+bind index G last-entry
+
+bind index R group-reply
+bind index S sync-mailbox
+bind index <space> collapse-thread
+bind index B bounce-message
+
+# Pager Key Bindings ---------------------------------
+bind pager k previous-line
+bind pager j next-line
+bind pager gg top
+bind pager G bottom
+bind pager R group-reply
+
+# Move message to Archives
+macro index,pager a "s=Archives<enter>"
+
+# View attachments properly.
+bind attach <return> view-mailcap
+
+# Save and recall drafts
+bind compose P postpone-message
+bind index P recall-message
+
+source ~/.config/mutt/gpg.rc
+set pgp_timeout = 3600 # how long to cache the pass-phrase
+set crypt_autosign = yes
+set crypt_replyencrypt = yes
+set pgp_sign_as = 3A9D0BB5
+set pgp_use_gpg_agent = yes
+set crypt_use_pka = yes
+
+source ~/.config/mutt/themes/comidia
+
+subscribe arch-dev-public@archlinux.org
diff --git a/mutt/sig b/mutt/sig
new file mode 100644
index 0000000..5d39d0e
--- /dev/null
+++ b/mutt/sig
@@ -0,0 +1,3 @@
+Sincerely,
+ Johannes Löthberg
+ PGP Key ID: 3A9D0BB5
diff --git a/mutt/themes/comidia b/mutt/themes/comidia
new file mode 100644
index 0000000..40f70c6
--- /dev/null
+++ b/mutt/themes/comidia
@@ -0,0 +1,52 @@
+#
+# This theme is from H. D. Lee
+#
+# This colors file was originally taken from Rosenfeld's
+# Modified slightly.
+# Running aterm with:
+# aterm +sb -geometry 80x60 -bg papayawhip -fg darkgreen -e mutt
+#
+# color terminals:
+# (default, white, black, green, magenta, blue, cyan, yellow, red)
+# (bright...)
+# (color1,color2,...,colorN-1)
+#
+# object foreground background
+#
+color normal default default # normal text
+color indicator brightcyan black # actual message
+color tree brightmagenta default # thread arrows
+color status cyan black # status line
+color error brightcyan default # errors
+color message cyan default # info messages
+color signature red default # signature
+color attachment green default # MIME attachments
+color search brightyellow red # search matches
+color tilde brightmagenta default # ~ at bottom of msg
+color markers red default # + at beginning of wrapped lines
+color hdrdefault blue default # default header lines
+color bold red default # hiliting bold patterns in body
+color underline green default # hiliting underlined patterns in body
+color quoted cyan default # quoted text
+color quoted1 green default
+color quoted2 red default
+color quoted3 magenta default
+color quoted4 blue default
+color quoted5 blue default
+#
+# object foreground backg. RegExp
+#
+color header red default "^(from|subject):"
+color body yellow default "((ftp|http|https)://|(file|news):|www\\.)[-a-z0-9_.:]*[a-z0-9](/[^][{} \t\n\r\"<>()]*[^][{} \t\n\r\"<>().,:!])?/?"
+color body cyan default "[-a-z_0-9.+]+@[-a-z_0-9.]+"
+color body red default "(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]"
+color body green default "(^| )_[-a-z0-9_]+_[,.?]?[ \n]"
+
+uncolor index * # unset all color index entries
+color index green default ~F # Flagged
+color index red default ~N # New
+color index magenta default ~T # Tagged
+color index yellow default ~D # Deleted
+color index blue default '\[(CHRPM|Contrib-Rpm)\]'
+color index color240 default "~h ^X.Mailer..Microsoft.Outlook"
+#color index brightblack default "~n 10-20"
diff --git a/mutt/themes/current b/mutt/themes/current
new file mode 100644
index 0000000..028ab5b
--- /dev/null
+++ b/mutt/themes/current
@@ -0,0 +1,88 @@
+
+## Theme kindly inspired from
+## http://nongeekshandbook.blogspot.ie/2009/03/mutt-color-configuration.html
+
+## Colours for items in the index
+color index brightcyan black ~N
+color index brightred black ~O
+color index brightyellow black ~F
+color index black green ~T
+color index brightred black ~D
+mono index bold ~N
+mono index bold ~F
+mono index bold ~T
+mono index bold ~D
+
+## Highlights inside the body of a message.
+
+## URLs
+color body brightgreen black "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
+color body brightgreen black "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+mono body bold "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
+mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+
+## Email addresses.
+color body brightgreen black "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
+
+## Header
+color header green black "^from:"
+color header green black "^to:"
+color header green black "^cc:"
+color header green black "^date:"
+color header yellow black "^newsgroups:"
+color header yellow black "^reply-to:"
+color header brightcyan black "^subject:"
+color header red black "^x-spam-rule:"
+color header green black "^x-mailer:"
+color header yellow black "^message-id:"
+color header yellow black "^Organization:"
+color header yellow black "^Organisation:"
+color header yellow black "^User-Agent:"
+color header yellow black "^message-id: .*pine"
+color header yellow black "^X-Fnord:"
+color header yellow black "^X-WebTV-Stationery:"
+
+color header red black "^x-spam-rule:"
+color header green black "^x-mailer:"
+color header yellow black "^message-id:"
+color header yellow black "^Organization:"
+color header yellow black "^Organisation:"
+color header yellow black "^User-Agent:"
+color header yellow black "^message-id: .*pine"
+color header yellow black "^X-Fnord:"
+color header yellow black "^X-WebTV-Stationery:"
+color header yellow black "^X-Message-Flag:"
+color header yellow black "^X-Spam-Status:"
+color header yellow black "^X-SpamProbe:"
+color header red black "^X-SpamProbe: SPAM"
+
+## Coloring quoted text - coloring the first 7 levels:
+color quoted cyan black
+color quoted1 yellow black
+color quoted2 red black
+color quoted3 green black
+color quoted4 cyan black
+color quoted5 yellow black
+color quoted6 red black
+color quoted7 green black
+
+## Default color definitions
+color hdrdefault white green
+color signature brightmagenta black
+color indicator black cyan
+color attachment green black
+color error red black
+color message white black
+color search brightwhite magenta
+color status brightyellow blue
+color tree brightblue black
+color normal white black
+color tilde green black
+color bold brightyellow black
+color underline magenta black
+color markers brightcyan black
+
+## Colour definitions when on a mono screen
+mono bold bold
+mono underline underline
+mono indicator reverse
diff --git a/mutt/tiny.pl b/mutt/tiny.pl
new file mode 100755
index 0000000..06b51b7
--- /dev/null
+++ b/mutt/tiny.pl
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+###################################
+# By: Ventz Petkov #
+# Date: 01-05-11 #
+# Last: 01-02-13 #
+# Parses HTML + Long URLs in MUTT #
+###################################
+
+use URI::Escape;
+$file = $ARGV[0];
+@text = ();
+
+# Only shorten URLs at least this length or more
+$tinyurltrigger = 40;
+
+# If we pass a 2nd argument, it means we want to force HTML check a 'text/plain' file
+if(defined($ARGV[2])) { open(FP, $file); for(<FP>) { push(@text, $_); } close(FP); }
+# Otherwise, treat as HTML first
+else { @text = `elinks -dump -dump-charset $ARGV[1] -default-mime-type text/html $file`; }
+
+
+# Note: using while (instead of for) b/c for supposedly loads
+# everything into memory - no reason to load large emails into memory
+
+while (my $line = shift @text) {
+ next if($line =~ /mailto:/);
+ if($line =~ /(\w+:\/\/\S+)/) {
+ my $link = $1;
+ chomp($link);
+ $size = length($link);
+ if($size >= $tinyurltrigger) {
+ eval {
+ my $alarm = 5;
+ alarm $alarm;
+ my $link = uri_escape($link);
+ $tinyurl=`wget -q -O - http://tinyurl.com/api-create.php?url=$link`;
+ alarm 0;
+ };
+
+ if ($@) {
+ $line =~ s/(\w+:\/\/\S+)/$link (wget TimeOut)/; }
+ else { $line =~ s/(\w+:\/\/\S+)/$tinyurl\n\t[>> $link <<]/; }
+ }
+ }
+ print "$line";
+}
+
+
+exit 0;