mutt configuration, as of 17-09-2014

This commit is contained in:
2014-09-17 23:36:57 +02:00
parent de46d4715d
commit 7c0689119a
12 changed files with 182 additions and 2 deletions

View File

@@ -1,2 +1,4 @@
mutt mutt configuration
==== ==================
Only modify account.conf

6
accounts.conf Normal file
View File

@@ -0,0 +1,6 @@
set folder = '~/Mail'
set hostname = 'MAIL_SERVER'
set realname = 'NAME'
set from = 'FROM_ADDRESS'
set pgp_sign_as = 0xSHORTKEY
fcc-hook .* MAIN_MAILBOX

3
aliases Normal file
View File

@@ -0,0 +1,3 @@
alias NICKNAME1 LASTNAME1 FIRSTNAME1 <EMAIL1>
alias NICKNAME2 LASTNAME2 FIRSTNAME2 <EMAIL2>
...

27
colors.conf Normal file
View File

@@ -0,0 +1,27 @@
## color item forground backgrount
# Browser colors
color normal white default # default
color indicator black green # hilight
color error white red # Error
color status yellow blue # Status bar
color search black white # Search box
color tree white default # Tree colors
color index red default ~N # folder with unread mails
color sidebar_new red default # folder with unread mails
# Mail colors
color hdrdefault yellow default # header
color attachment yellow default # attachment
color markers red default
color signature blue default # signature
# Mails and links colored to red
color body red default [_a-z\.\$A-Z0-9-]+@[a-zA-Z0-9\./\-]+
color body red default ((http|https|ftp)://|www.)[_%?=+&\@\(\)a-zA-Z0-9\./~\-]+
color message white default # mail text
color quoted yellow default # quotes
color tilde yellow default # fill bottom with ~
# GPG colors
color body green default "^gpg: .*"
color body white red "^gpg: BAD signature from.*"

32
default.conf Normal file
View File

@@ -0,0 +1,32 @@
set mbox_type = Maildir
set check_new = yes
set mail_check = '5'
set timeout = 10
set sendmail = "/usr/bin/msmtp"
set quit = yes # no confirmation to quit
set beep_new = yes
set sort = threads
set sort_aux = date-sent
unignore .*
auto_view text/html image/*
alternative_order text/plain
set assumed_charset = 'utf-8:iso-8859-15:us-ascii'
set send_charset = 'utf-8:iso-8859-15:us-ascii'
set allow_ansi = yes
set editor = "emacsclient"
set reply_self = no
set edit_headers = yes
set header = yes
set fast_reply = yes # automatically fill the header
set envelope_from = yes
set signature = "~/.signature"
set tilde = yes # fill bottom with ~
set record = '+Sent'
set postponed = '+Drafts'
# Alias file (created by abook) and abook query
set alias_file = aliases
source $alias_file
set query_command = "/usr/bin/pc_query -m '%s'"

8
formats.conf Normal file
View File

@@ -0,0 +1,8 @@
set attach_format = "%2n %D%I%u%t %T%f %d (%s) (%m/%M, %e, %C)" # attachments
set compose_format = "[Approx. msg size: %l, Atts: %a] %>-"
set date_format = "!%d/%m/%Y %H:%M"
set folder_format = "%N %3C %d %2l (%5s) %f"
set message_format = "From: <%a>, Sub: %s"
set index_format = "%Z %3C %d %-20.20u %.100s"
set pager_format = "%Z %3C/%3m %d (%-20.20u) %-100.100s %c"
set status_format = "%-24f: [%3m messages, %4l]"

19
gpg.conf Normal file
View File

@@ -0,0 +1,19 @@
# GPG commands
set pgp_decode_command = "gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
set pgp_verify_command = "gpg --no-verbose --batch --output - --verify %s %f"
set pgp_decrypt_command = "gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
set pgp_sign_command = "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command = "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_encrypt_only_command = "pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to #MYKEY -- -r %r -- %f"
set pgp_encrypt_sign_command = "pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f"
set pgp_import_command = "gpg --no-verbose --import -v %f"
set pgp_export_command = "gpg --no-verbose --export --armor %r"
set pgp_verify_key_command = "gpg --no-verbose --batch --fingerprint --check-sigs %r"
set pgp_list_pubring_command = "gpg --no-verbose --batch --with-colons --list-keys %r"
set pgp_list_secring_command = "gpg --no-verbose --batch --with-colons --list-secret-keys %r"
# GPG conf
set pgp_autosign = yes
set pgp_replyencrypt = no
set pgp_timeout = 1800
set pgp_good_sign = "^gpg: Good signature from"

9
keys.conf Normal file
View File

@@ -0,0 +1,9 @@
set meta_key = yes
bind index,pager <esc><up> sidebar-prev # alt-up
bind index,pager <esc><down> sidebar-next # alt-down
bind index <esc><return> sidebar-open # alt-enter
macro index M "T.*\n;WN" "Mark all messages as read" # "M" to mark all read
macro index <return> <display-message><sync-mailbox> # flag update on reading mail
macro pager q <exit><sync-mailbox> # flag update on exiting pager

34
mailboxes.py Executable file
View File

@@ -0,0 +1,34 @@
#! /usr/bin/env python
import os
mail_location = os.path.expanduser("~/Mail/")
filters = [
# Directory not list in mutt
# relative paths from 'mail_location'
]
def get_addresses():
return sorted(os.listdir(mail_location))
def get_maildirs(addresses):
l = []
for i in addresses:
if os.path.isdir(mail_location + i + "/cur"):
l.append("+" + i)
else:
for j in sorted(os.listdir(mail_location + i)):
if "+" + i + "/" + j not in filters:
l.append("+" + i + "/" + j)
return l
def format(maildirs):
return " ".join(['"' + x + '"' for x in maildirs])
if __name__ == "__main__":
print format(get_maildirs(get_addresses()))

11
muttrc Normal file
View File

@@ -0,0 +1,11 @@
## Main mutt configuration file.
source accounts.conf # account informations
mailboxes `mailboxes.py` # mailboxes list
source colors.conf
source default.conf
source formats.conf # mail format
source gpg.conf # GPG configuration
source keys.conf
source sidebar.conf
source aliases # mail aliases

25
screenrc Normal file
View File

@@ -0,0 +1,25 @@
startup_message off
vbell off
bell_msg "^G"
attrcolor b ".I"
attrcolor i "+b"
nonblock on
escape ^||
bindkey "^[x" command
bindkey "^[Od" prev # change window with ctrl-left
bindkey "^[Oc" next # change window with ctrl-right
hardstatus on
hardstatus alwayslastline
#hardstatus string "%{.kW}%-w%{.W}%n %t%{-}%{=b kw}%?%+w%? %=%c %d/%m/%Y" #B&W & date&time
hardstatus string "%{.kW}%-w%{.W}%n %t%{-}%{=b kw}%?%+w%? %=%c %d/%m/%Y" #B&W & date&time
sorendition kw
screen -t offlineimap 0 offlineimap
screen -t ACCOUNT1 1 mutt -F ~/config/muttrc_ACCOUNT1
screen -t ACCOUNT2 2 mutt -F ~/config/muttrc_ACCOUNT2

4
sidebar.conf Normal file
View File

@@ -0,0 +1,4 @@
set sidebar_width = 45
set sidebar_visible = yes
set sidebar_delim = ' '
set sidebar_sort = no