Skip to content

Instantly share code, notes, and snippets.

@gnurag
Last active February 28, 2018 08:11
Show Gist options
  • Save gnurag/4077db5e30b64c05b63f008cac36fe02 to your computer and use it in GitHub Desktop.
Save gnurag/4077db5e30b64c05b63f008cac36fe02 to your computer and use it in GitHub Desktop.
mutt setup
## $Id: .muttrc,v 0.3 Jan 11 23:21:42 IST 2004 Anurag Patel $
# My .muttrc file, (C) 2004, 2005, 2012, 2015, 2017 Anurag
#
# Notes: When viewing filtered mails using 'l' key,
# then use ~A to display all mails.
push <show-version> # show version on startup
##################################################
## My General settings
##################################################
#set noconfirmappend # dont bother to prompt me
set copy=yes # save a copy of outgoing mail
#set edit_headers=yes # enable header editing
set help=yes # show help options ???
#set pager=less # want to view mail in `less`
set delete=ask-no # auto mail deletion
set pager_stop=yes # dont move to next mails
set editor="emacs -nw " # i like emacs to compose mails
set forward_format="[Fw: %s:]"
set include # include messages when replying
unset move # ask before moving
set pager_context=6 # include prev lines while paging
set hdrs
set beep=no # beep me when i make mistakes
set beep_new # beep when new mail comes
set check_new # check for new mails
set mail_check=5 # time interval for mail check
set arrow_cursor=no
set mime_forward
#set locale=en_US
set attribution="Irgendwann am %d, schrieb %n:"
set thorough_search # search thorougly through emails
unset mark_old # read/new is OK
set quit=yes
set hostname=bb8.lab.eng.brq.redhat.com
#set hidden_host
auto_view text/html
##################################################
## Sorting options
##################################################
set sort=threads
set strict_threads=yes
# set sort=reverse-last-date-received
set sort_aux=last-date
set sort_browser=date
unset collapse_unread
bind index - collapse-thread
bind index _ collapse-all
folder-hook . "push <collapse-all>\n"
##################################################
## 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
#unset markers # no ugly plus signs
#set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
set tilde # show tildes like in vim
alternative_order text/plain text/enriched text/html
##################################################
## Sidebar settings for Mac
## brew install mutt --with-sidebar-patch --with-gpgme --with-trash-patch --with-confirm-attachment-patch
##################################################
set sidebar_visible=yes
set sidebar_width=30
set sidebar_divider_char = '│'
set sidebar_folder_indent = yes
set sidebar_indent_string = ' '
set sidebar_short_path = yes
set sidebar_format = "%B%* %?N? (%N)?"
color sidebar_new color221 color233
color sidebar_highlight black yellow
##################################################
# Set identity
##################################################
set use_from=yes
set from="[email protected]"
set realname="Anurag"
set signature= "~/.signature"
##################################################
## My friendly key bindings:
##################################################
bind pager <up> previous-line
bind pager <down> next-line
bind pager . next-undeleted
bind pager , previous-undeleted
bind index I imap-fetch-mail
bind index A create-alias
#bind index <delete>
# Sidebar Navigation
bind index,pager ] sidebar-prev
bind index,pager [ sidebar-next
bind index,pager \\ sidebar-open
bind index,pager \' sidebar-toggle-visible
##################################################
## Macro keybindings to enable Gmail delete
##################################################
# \043 = pound sign (like the keyboard shortcut for Gmail's web interface)
#macro index,pager \043 "<save-message>=[Gmail].Trash<enter><enter><refresh>" "Trash Message"
macro index,pager d "<save-message>=[Gmail].Trash<enter><enter><refresh>" "Move message to Trash"
macro index,pager a "<save-message>=[Gmail].All\ Mail<enter><enter><refresh>" "Archive Message (Gmail archive action)"
bind index,pager \043 delete-message
##################################################
## Headers i want to view:
##################################################
ignore *
unignore X-Mailer: User-Agent: From: Date: To: Cc:
unignore Subject: List-Id:
##################################################
## Order of display of headers
##################################################
unhdr_order * # forget prev header order settings
hdr_order from to cc date subject
##################################################
## Add extra headers:
##################################################
#my_hdr X-Operating-System: "`uname -a|sed s/\#//g`"
##################################################
## Mailbox settings:
##################################################
# Set remote folder location
#set folder="imaps://[email protected]@imap.gmail.com"
set folder="~/Mail/xinh.org"
# Set Inbox, Sent and Drafts folder
set spoolfile = +INBOX
set record = +"[Gmail].Sent Mail"
set postponed = +"[Gmail].Drafts"
#set trash = +Trash
##################################################
## Check IMAP folders
##################################################
#set imap_check_subscribed
set folder_format = "%2C %t %N %8s %d %f" # imap folder listing format.
set index_format = "%4C [%Z] %D %-20.20F %s"
##################################################
## Set SMTP server
##################################################
#set sendmail="/usr/local/bin/msmtp -a xinh"
set smtp_url="smtp://[email protected]@smtp.gmail.com:587/"
set smtp_pass="here be dragons"
##################################################
## LDAP Addressbook settings
##################################################
#set query_command="~/.mutt/mutt-ldap.pl '%s'"
set query_command="abook --mutt-query '%s'"
bind editor "\t" complete-query
##################################################
## My color display settings:
##################################################
color normal white default
color hdrdefault red default
color quoted blue default
color signature blue default
color indicator white blue
color error red default
color status brightyellow blue
color tree magenta default # the thread tree in the index menu
color tilde magenta default
color message cyan default
color markers cyan default
color attachment green default
color search brightyellow blue # how to hilite search patterns in the pager
color index yellow default ~N # new mails
#color header yellow default "^Subject:"
color index green default "~v~(!~N)~(!~F)" # collapsed thread with no New or Flagged
color index red default "~v~(~F)~(!~N)" # collapsed thread with Flagged but no New
color index yellow default "~v~(~N)" # collapsed thread with New
##################################################
## Store local settings in another file
##################################################
source ~/.addressbook
##################################################
## Cache headers for faster mutt
##################################################
# Note: mkdir -p ~/.mutt/cache
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/messages"
##################################################
## My watched mailboxes
##################################################
set mail_check_stats = yes
mailboxes +INBOX \
+"[Gmail].Sent Mail" \
+"[Gmail].Drafts" \
+"[Gmail].Spam" \
+"[Gmail].Starred" \
+"[Gmail].Trash" \
+memo-list \
# Email alias configuration
set alias_file=~/.mutt/aliases
## End of .muttrc file
# Address aliases
alias gnurag Anurag <[email protected]>
# Sample minimal config file. Copy this to ~/.offlineimaprc and edit to
# get started.
[general]
ui = Basic
accounts = Gmail
fsync = False
socktimeout = 60
maxsyncaccounts = 2
############################
## Personal Gmail account ##
############################
[Account Gmail]
localrepository = Gmail-Local
remoterepository = Gmail-Remote
status_backend = sqlite
synclabels = yes
labelsheader = X-Keywords
autorefresh = 5
[Repository Gmail-Local]
type = GmailMaildir
localfolders = ~/Mail/xinh.org
[Repository Gmail-Remote]
maxconnections = 1
type = Gmail
ssl = yes
sslcacertfile = /etc/pki/tls/cert.pem
remotehost = imap.gmail.com
remoteuser = [email protected]
remotepass = here be dragons
auth_mechanisms = PLAIN, LOGIN
realdelete = yes
idlefolders = ['INBOX']
expunge = yes
# Sync every folder except:
#folderfilter = lambda foldername: foldername in ['INBOX', '[Gmail]/Sent Mail'
folderfilter = lambda foldername: (foldername not in ['[Gmail]/All Mail', '[Gmail]/Important']) and (not foldername.startswith('DontSyncMe'))
#!/bin/bash
/usr/bin/ldapsearch -LL -x -h ldapmaster.corp.redhat.com -b "ou=users,dc=redhat,dc=com" uid="*"|pv| abook --convert --informat ldif --outformat abook > ~/.abook/addressbook
@gnurag
Copy link
Author

gnurag commented Dec 26, 2017

anurag@coruscant ~$ cat .mailcap
text/html; links '%s'; nametemplate=%s.html
text/html; links -dump '%s'; nametemplate=%s.html; copiousoutput
image/*; eog '%s'; copiousoutput
application/pdf; evince '%s'; copiousoutput
application/octet-stream; open '%s'; copiousoutput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment