diff --git a/README.md b/README.md index 8e234a7..71bb027 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ -mutt -==== +mutt configuration +================== + +Only modify account.conf diff --git a/accounts.conf b/accounts.conf new file mode 100644 index 0000000..0447e4f --- /dev/null +++ b/accounts.conf @@ -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 diff --git a/aliases b/aliases new file mode 100644 index 0000000..5d81501 --- /dev/null +++ b/aliases @@ -0,0 +1,3 @@ +alias NICKNAME1 LASTNAME1 FIRSTNAME1 +alias NICKNAME2 LASTNAME2 FIRSTNAME2 +... diff --git a/colors.conf b/colors.conf new file mode 100644 index 0000000..86a9f89 --- /dev/null +++ b/colors.conf @@ -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.*" diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..bfd3e84 --- /dev/null +++ b/default.conf @@ -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'" diff --git a/formats.conf b/formats.conf new file mode 100644 index 0000000..5d6cb5d --- /dev/null +++ b/formats.conf @@ -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]" diff --git a/gpg.conf b/gpg.conf new file mode 100644 index 0000000..148a105 --- /dev/null +++ b/gpg.conf @@ -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" diff --git a/keys.conf b/keys.conf new file mode 100644 index 0000000..ee9a271 --- /dev/null +++ b/keys.conf @@ -0,0 +1,9 @@ +set meta_key = yes + +bind index,pager sidebar-prev # alt-up +bind index,pager sidebar-next # alt-down +bind index sidebar-open # alt-enter + +macro index M "T.*\n;WN" "Mark all messages as read" # "M" to mark all read +macro index # flag update on reading mail +macro pager q # flag update on exiting pager diff --git a/mailboxes.py b/mailboxes.py new file mode 100755 index 0000000..c182f14 --- /dev/null +++ b/mailboxes.py @@ -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())) diff --git a/muttrc b/muttrc new file mode 100644 index 0000000..b21dac8 --- /dev/null +++ b/muttrc @@ -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 diff --git a/screenrc b/screenrc new file mode 100644 index 0000000..e3647bf --- /dev/null +++ b/screenrc @@ -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 diff --git a/sidebar.conf b/sidebar.conf new file mode 100644 index 0000000..8e18b9b --- /dev/null +++ b/sidebar.conf @@ -0,0 +1,4 @@ +set sidebar_width = 45 +set sidebar_visible = yes +set sidebar_delim = ' ' +set sidebar_sort = no