###############################################################################
#
#       $Date: 2008-10-05 18:09:03 +0200 (Sun, 05 Oct 2008) $
# _________________________________________
#/ this file was created by countless cuts \
#| and pastes..  ..now with sample snippets |
#|    of other config files !               |
#\ check /usr/share/doc/mutt* and mutt.org!/
# -----------------------------------------
#       \   ^__^            
#        \  (^^)\________
#           (__)\ MUTTRC )\/
#            U   ||----w.|
#            ..  ||     ||
#
#       this file may be put by anyone in place of his .muttrc.
#       the personal settings are sourced through
#

#wget  www.mutt.org/image/mutt_button.gif ; cacaview mutt_button.gif
#
#MX=... . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#WGW%%:;;t::;tt:;;:tt:;::;:::::::::::::::::::::::::::::::::::::::
#@@MXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMXMX
#88W@@@@@#@@@#@@@#@@@#8@@#@@8#@88#@@@#@@Gtt.8#888#888#888#888#t%%
#88M@@@@@@@@@@@@@@@88@@@@@88@88@@@@88   888@@88888888888888888$ZK
#88W@@@@@@@@@@@@@@@@@@@88@@@8@@@888  &S&GWG88@@888888888888888@&S
#88M@@@@@@@@@@@@@@@88@@@@8@@@@@8XM ZKfKZ @@8@@@888888888888888fZK
#88W@@@@@#888#@8  @@@#@88#@@8WGWG# &StS& %% G#G@8#888#888#888#@&S
#88M@@@@@8@@8MX 88888@@@@8888MXZ  XZKMKZ    KMX888888888888888K$$
#88W@@@@@8888  &GW8888@@@@88@&SW  S&S&S&S&S& %%@88@88888888888G@@
#88M@@@888@@X  Z  @88@@88@@@XZK XMKZKZKZ ZK KZKMXM8888888888XMKZK
#88W@@888@GWS  &  @888@888@@S#G S&S&S&S& &S G%%W88888#888#88S&Stt
#88M@@888MXMK  Z  X@@@@888XMK  MKZKZKZKZKZKZ      888888888M@@K88
#88W888@@&GW@  &S&           WG&S&S&S&S&S&S& &S tt888888888WGWG88
#88M@@8MXZXM8ZK:KZ ::    :  8  fXM   ZKZKZKZ      @88888888fKZ$M@
#88W@@@@@&GW8WG S&S&S&S&S&S&S#Gt   WG&S&S&S&S  W  GWG#888#8@S&888
#88M@@8@@MXM8MXMKZKZKZKZKZKZKZKMff    XMKZKZK  Z  $@@@88888fKZ888
#88W@@@@@&GW8  WGWS&S&S&S&S&S&S&GWttt   GWG&S  W  SWG888888WGWG88
#88MXM888ZXM8  MKZKZKZKZKZKZKZKZKZKMX XMfffM#$$8XMKMX888888M88888
#88W@@8@@&GW8  WG#S&S&S&S&S&S&S&S&G  WGWGWG#GWG8S&GWG#888#8%S&888
#88M@@8MXMXM@MX XMKZKZ MXMXMKZKZKZ   ##8XMX$KMXM$$X88888888Zff888
#88W@@8@@WGW@WG S&S&S GWGW  S&S&  G  @%%@@@8@WG&%%G88888888&8#8WG
#88M@@8MXMXM@MXMKZX         KZK XMX  @88@MXZK$$M@@8888888MXZ@@@MX
#88W@@8@8%@@G  &S& WG#G  t  G&S G#S  @GW%%S&G@@W88888#888#8&S&%88
#88M@@88@Z@@ MXZKZKZKZ MXM  XZKZKZKZK XMKMX88888@@888888888Z88K$$
#88W@@@WG&GW &S&S&S&S& WGW  S&S&S&S&S GWS  88@@8888888888WG&88%WG
#88MXMXZKM88 MXMKZKZKZ MXM  XMXZKZKZK XMK  8888888888888888888XMX
#88WGWSWG@GWG         G   GW         #   #G@8#8@8#888#888#888#888
#G@@M@@@@@@XMf:::. . . : ..... .:::=ffM#8X@@@8@@@@@@@@@@@@@@@@@@@

###############################################################################
#                               personal settings...
###############################################################################
#reads account info from private files
#source ~/.mutt/subscriptions
#source ~/.mutt/mailboxes                  # Define the list of folders that receive mail.
#source ~/.mutt/pgp

###############################################################################
source "~/Mail/merged-mail.aliases"
set alias_file=~/Mail/mail.aliases.`echo $HOSTNAME`     # mail aliases

#suppose you share the same configuration file on multiple machines.
#this line allows you to separate the alias names for backup purposes!
#source ~/Mail/mail.aliases.`echo $HOSTNAME`            # ... with loading
source ~/Mail/mail.aliases.`echo $HOSTNAME`             # ... with loading
# 20071218 plain  $HOSTNAME stopped to work..

set sort_alias=address                  # alias,address,unsorted

set mailcap_path = ~/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
#set mailcap_path=~/.mailcap    # i could also use a ad-hoc mailcap file!

set tmpdir=~/.tmp                       # prevents from creation of temporary files in unsure folders

################################################################################
#                               internal mailboxes settings...
################################################################################
set folder="~/Mail"             # all the mailboxes should be inside this folder
#set spoolfile="/var/spool/mail/$USER"
set spoolfile=+inbox.new
set mbox_type=maildir           # maildir file format : less standard, faster
#set mbox_type=mbox             # mailbox file format : more standard, slower
set mbox=+inbox.read            # messages read in $spoolfile are moved in $folder/mbox
#set mbox=+mbox         # messages read in $spoolfile are moved in $folder/mbox
set postponed=+postponed                # mailbox to store postponed messages in
#set record=+mbox                       # default location to save outgoing mail                
#set record=+sentt              # default location to save outgoing mail                
set record="=sent.$HOSTNAME"    # the file to which the outgoing mail will be appended. default is nowhere
#set record=+sent.`echo $HOSTNAME`      # the file to which the outgoing mail will be appended. default is nowhere
#set record=+sent.chip  # the file to which the outgoing mail will be appended. default is nowhere
#set force_name=yes             #would save each email in a folder named after the recipient username

#mailboxes `echo $HOME/Mail/Lists/*`
#mailboxes `echo $HOME/Mail/Friends/*`
#mailboxes `echo $HOME/Mail/spam`
#mailboxes pop://pop.tiscali.it/

#mailboxes ! =$HOME/Mail/mbox =in.tmp =mbox.friends =mbox.lists =sent
#mailboxes ! =in.tmp =mbox.friends =mbox.lists =sent    # these are the mailboxes which are checked for new mail
mailboxes ! =spam =Lists/iis =in.mbox =spam =deliveries.mail
#mailboxes $HOME/Mail/spam
#mailboxes $HOME/Mail/lists.iis

set confirmcreate=yes           # confirmation when creating mailbox
set confirmappend=yes           # confirmation on appending



################################################################################
#                               environment
################################################################################
#set spoolfile="~/Mail/mbox"
#set spoolfile="+spam"
#set spoolfile="pop://user@isp.it@pop.isp.it"

#set sendmail=/usr/sbin/sendmail
#set sendmail=/usr/local/bin/msmtp      # redhat linux
#set sendmail=/usr/bin/msmtp            # gentoo linux
#set sendmail=`whereis msmtp | cut -f 2 -d ' '`         # any unix, default account
set sendmail=""                         # we don't use any default account !
################################################################################
#A SAMPLE SIMPLE .msmtprc
################################################################################
#defaults
#logfile ~/.msmtp.log
#
#account default
#host smtp.host.com
#from username@host.com
#user username@host.com

################################################################################
#A SAMPLE .msmtprc PARANOID ACCOUNT
################################################################################
#account paranoid.tls
#port 1234
#from username@host.com
#user username@host.com
#auth on
#password XXX
#tls on
#host host.com



#set editor="/usr/bin/vim"              # overriding $VISUAL,$EDITOR, and vi
set editor = "vim -c :so~/.mutt/email.vim"

# the file where server certificates, once accepted, will be placed
set certificate_file="~/.mutt/certificates.$HOSTNAME"

################################################################################
#                               mailing lists  
################################################################################
set metoo=no                    # remove my address from an address list when replying (default)
#source ~/.mutt/private.lists  


################################################################################
#                               index visualization
################################################################################
#set alias_format="%2n %t %-10a   %r"   # alias format
set alias_format="%4n %2f %t %-10a %r"
  
set sort_browser=reverse-date           # alpha | date | size | unsorted
#set sort="reverse-date-received"
set sort="reverse-date-sent"            # last on top
#set sort="reverse-threads"
#set status_format="-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"   #default
#set date_format="!%a, %b %d, %Y at %I:%M:%S%p %Z"
set date_format="%Y%m%d@%H:%M"
set index_format="%4C %Z %d %-15.15L %-30.30a %4c %s"   #mine

set menu_scroll=yes             #scroll 1 line in menus instead of an entire page

################################################################################
#                               mail composing
################################################################################
set copy=yes                    # i want to save sent mail
set delete=ask-yes              #
#set move=ask-yes                       #
set move=ask-no                 #
set postpone=ask-yes            # postponing messages to be sent later, when aborted composing
set abort_nosubject=ask-no
set include=ask-yes             # include on reply
set allow_8bit=yes              # automatic conversion to Quoted-Printable of [128-255] chars
set edit_headers                # so it is possible to edit header and type in messages faster
set weed=yes                    # header weeding is set by default, but can be disabled
unset allow_8bit                #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#set signature="~/.signature.mutt"      # this file will be included

#set charset="it-ascii"?
#set send_charset="us-ascii:iso-8859-1:utf-8"   #default
set send_charset="us-ascii:iso-8859-1:utf-8"    #this is the default : SHOULD BE ADJUSTED TO ITALIAN..
#iconv-hook iso-8859-1 8859-1   # this should be used with charset-hook
################################################################################
#                               mail reading (pager settings)
################################################################################
set tilde=yes                   # message end will be padded with tilde lines
set timeout=300                 # check the mail every timeout seconds
#set pager="less"               # builtin or arbitrary
set pager_context=1             # when moving vertically in the pager, the number of boundary lines
set pager_stop=yes              # the pager will stop when last page is reach, instead of going to the next msg
#"builtin"
unset mark_old                  #when unset, messages are kept 'new' if unread, instead of being marked as old
alternative_order text/plain text/enriched text/html image/* # alternative/multipart display order


set pager_format = "-%S- %C/%m %a %s %cbytes score:%N"  # pager displaying format
#set pager_format = "-%S- %C/%m: %-20.20n(%a)   %s[%c bytes] [score :%N]"       # pager displaying format
# Default pager_format : "-%Z- %C/%m: %-20.20n   %s%*  -- (%P)"

set smart_wrap          # default is set; whole words on line boundaries in the internal pager
#set status_format="%r%v [%?M?%M/?%m] %?n?%n new, ?%?p?%p postponed, ?%?t?%t +tagged, ?%?d?%d deleted, ?%?b?%b more to go.?%> %r"
set status_format="-%r-Mutt@%h: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"


###############################################################################
#                               misc settings
###############################################################################

set quit=ask-yes        # mutt will exit without asking


set history=20          # command line history (def. 10)
set nomark_old          # Don't mark unread new msgs as old.

set markers             # (default set) a + is displayed prior ahead of wrapped lines
#set mime_forward       # Forward message as MIME attachments (default no)

set help=yes                    # i feel lame and i want help displayed on top bar
set beep_new=yes                # on new message .. defaults to no
set sort_re=yes         # defaults to yes but.. it is a it complicated



################################################################################
#       macro menu key sequence [description]
#macro ( pager | index | compose | alias | attach | browser | pgp | postpone | generic | editor )
################################################################################

macro pager <F6> |ipview.sh\n   "NMAPs the sending host :)"


macro generic <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro attach  <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro alias   <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro pager   <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro pgp     <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro postpone <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro index   <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro compose <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."
macro browser <F5> ":source ~/.muttrc<enter>" "reload the .muttrc file..."


#control-b invokes the urlview program
macro index \cb |urlview\n      "display the URLs and visit them"
macro pager \cb |urlview\n      "display the URLs and visit them"

macro index <F2> "<delete-pattern> ~h it\.tiscali\.com" "delete it.tiscali.com emails!!"
################################################################################
# POP (only if compiled with --enable-pop)
################################################################################
set pop_authenticators="apop"   # colon separted list of user, apop, DANGEROUS! DO NOT SET THIS TO "" (user!)
set pop_auth_try_all=no         # try all available auth methods.
set pop_checkinterval=300       # how often (seconds) look for new mail via POP
set pop_delete=ask-no           # keep POP messages at the server.
set pop_reconnect=yes           # try to reconnect to POP server when cconnection gets lost.
#set hidden_host=yes
################################################################################
#personal accounts information
#macro index <F6> ":source ~/.mutt/accounts"    "bum"

source ~/.mutt/muttrc.accounts          # my accounts settings
#a sample of the macro I use to switch accounts:
#macro index <F3> ":unset pop_user<enter>:unset pop_pass<enter>:set pop_host=pop.host.com<enter>:set pop_user=user@host.com<enter>:set pop_pass=XXX<enter><change-folder-readonly> pop://user@host.com@pop.host.com<enter>" "user@host.com POP"

set compose_format="Mutt@%h -- Compose [Approx. msg size: %l Attachments: %a]%>-"

################################################################################
#                       folder hooks
################################################################################

unhook send-hook
#source ~/.mutt/private.folderhooks             #there are personal hooks
#a sample folder hook for folder named 'news':
#folder-hook news set sort=reverse-threads

#security.. :)
set pop_authenticators="digest-md5:apop:user"

#folder-hook sent "set index_format='%2C fmg  %t %N %F %2l %-8.8u %-8.8g %8s %d %f'"
folder-hook sent "set index_format='%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f'"
#set index_format="%2C onfrn %t %N %F %2l %-8.8u %-8.8g %8s %d %f"

################################################################################
#set folder_format = "%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f"

################################################################################
#                       header display cleanup
################################################################################
ignore *
unignore from date subject to cc
unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
unignore posted-to:
# Now order the visable header lines
unhdr_order *
#hdr_order From: Subject: To: Cc: Bcc: Reply-To: Mail-Followup-To: Date: Organization: User-Agent: X-Mailer:
hdr_order 'From' Subject To Cc Bcc Reply-To Mail-Followup-To Date Organization User-Agent 'X-Mailer List-Id'
unignore User-Agent
#unignore From:
#unignore To:
#unignore Reply-To:
#unignore Mail-Followup-To:
#unignore Subject:
#unignore Date:
#unignore Organization:
#unignore Newsgroups:
#unignore CC:
#unignore BCC:
#unignore Message-ID:
#unignore X-Mailer:
#unignore User-Agent:
#unignore X-Junked-Because:
#unignore X-SpamProbe:
#unignore X-Virus-hagbard:


################################################################################

################################################################################
#                       custom bindings
################################################################################
bind pager   <up>     previous-line
bind pager   <down>   next-line
#bind pager   <left>   previous-undeleted
#bind pager   <right>  next-undeleted
bind pager   <left>   previous-entry
bind pager   <right>  next-entry
bind index   <left>   previous-entry       # so i am able to fly over mistakenly deleted
bind index   <right>  next-entry               # yep
bind pager   <home>   top
bind pager   <end>    bottom
#bind pager   \c<pageup>   previous-undeleted           # these don't work
#bind pager   \c<pagedown>  next-undeleted              #
bind pager   <pageup>   previous-page
bind pager   <pagedown>  next-page
# HTML is the last option.
################################################################################


################################################################################
#                       colors
################################################################################

# Last, but not least, get mutt to display its version on startup.
#push <show-version>
# email addresses
#color body brightblue  white "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
#mono  body bold              "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"

# Various smilies and the like
#color body brightgreen white "<[Gg]>"                                            # <g>
#color body brightgreen white "<[Bb][Gg]>"                                        # <bg>
#color body brightgreen white " [;:]-*[)>(<|]"                                    # :-) etc...
#color body brightblue  white "(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)" # *Bold* text.
#color body brightblue  white "(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)"     # _Underlined_ text.
#color body brightblue  white "(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)"     # /Italic/ text.

################################################################################
#Dealing with color problems often leads to setting approipriately environment variables...
#see the manual for details!
#Red Hat colors variant

#color normal white default
color hdrdefault red default
color quoted brightblue default
color quoted1 cyan default
color quoted2 yellow default
color quoted3 green default
color signature red default
color indicator brightyellow red
color error brightred default
color status yellow blue
color tree magenta default      # the thread tree in the index menu
color tilde magenta default     # for blank lines
color message brightcyan default
color markers brightcyan default
color attachment yellow default
color search default brightgreen        # how to hilight search patterns in the pager only

color header brightred default ^(From|Subject|X-Mailer|User-Agent|List-Id):
color body brightgreen default "(ftp|http|https)://[^ ]+"       # point out URLs
color body magenta default [-a-z_0-9.]+@[-a-z_0-9.]+    # e-mail addresses
color underline brightgreen default

# fancy messages coloring
color index green default '~l ~d <10d'  # "subscribe"'d messages and ones fresher than 10 days will be marked green
color index brightyellow default '~='   # duplicates


# mono terminals still can be tweaked
#mono header underline ^(From|Subject):
#mono quoted bold
################################################################################




#set quote_regexp="^ *[a-zA-Z]*[]>|}=][]>|}:=]*"
#set forward_format = "[Fwd] %s"

#set mime_forward       # default set; converts the text to plain when forwarding..
set fcc_clear = yes     #default unset; if set, fcc ( like ordinary emails, when saved ) are not encripted with GPG
#my_hdr X-Operating-System: `uname -a`

#still missing spam dealing, gpg, folder handling

##########################################################################
## BOGOFILTER - spam filtering with bayesian algorithms
## macros to educate your filters
#macro index s "<enter-command>unset wait_key\n<pipe-entry>bogofilter -N\n<enter-command>set wait_key\n<save-entry>"
#macro pager s "<enter-command>unset wait_key\n<pipe-entry>bogofilter -N\n<enter-command>set wait_key\n<save-entry>"
macro index c "<change-folder>" "change folder"

macro index L "<enter-command>unset wait_key\n<pipe-entry>bogofilter -N\n<enter-command>set wait_key\n"

macro compose \cF "<edit-type>^Utext/plain\n<edit-type>^Umessage/rfc822\n" "Attachment forwarding : first forward the message, and before sending use this!"
macro postpone d "<delete-message>"
macro postpone <delete> "<delete-message>"

#macro index r "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<reply>"
#macro pager r "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<reply>"

macro index M "<enter-command>unset wait_key\n<pipe-entry>bogofilter -S\n<enter-command><undelete-message>\n" "undo a spam mark of ham"
macro pager M "<enter-command>unset wait_key\n<pipe-entry>bogofilter -S\n<enter-command><undelete-message>\n" "undo a spam mark of ham"

macro index g "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<group-reply>"
macro pager g "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<group-reply>"

# we want l assigned to 'limit'
#macro index l "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<list-reply>"
#macro pager l "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<list-reply>"

macro index L "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>\n"
macro pager L "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>\n"

#macro index S "<enter-command>unset wait_key\n<pipe-entry>bogofilter -s\n<enter-command>set wait_key\n<delete-message>" "spam learning and deletion"
#macro pager S "<enter-command>unset wait_key\n<pipe-entry>bogofilter -s\n<enter-command>set wait_key\n<delete-message>" "spam learning and deletion"
macro index S "<enter-command>unset wait_key\n<pipe-entry>bogofilter -s\n<enter-command>set wait_key\n<copy-message>=inbox.spam<enter>\n<delete-message>" "spam learning, copying in inbox.spam and deletion"
macro pager S "<enter-command>unset wait_key\n<pipe-entry>bogofilter -s\n<enter-command>set wait_key\n<copy-message>=inbox.spam<enter>\n<delete-message>" "spam learning, copying in inbox.spam and deletion"

#macro index N "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Ns\n<enter-command>set wait_key\n<delete-message>" "mark as spam what has been marked as ham"
#macro index \cN "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Ns\n<enter-command>set wait_key\n<tag-entry>" "mark as spam what has been marked as ham"
#macro pager \cN "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Ns\n<enter-command>set wait_key\n<tag-entry>" "mark as spam what has been marked as ham"
macro index \cS "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Ns\n<enter-command>set wait_key\n<tag-entry>" "mark as spam what has been marked as ham"
macro pager \cS "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Ns\n<enter-command>set wait_key\n<tag-entry>" "mark as spam what has been marked as ham"


macro pager n "<mark-as-new>" "mark as new (unread)"
macro index n "<mark-as-new>" "mark as new (unread)"

#macro index N "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Sn\n<enter-command>set wait_key\n<delete-message>"       "when bogofilter fails bad, we want to mark ham as such!"
#macro pager N "<enter-command>unset wait_key\n<pipe-entry>bogofilter -Sn\n<enter-command>set wait_key\n<delete-message>" "when bogofilter fails bad, we want to mark ham as such!"

# -a fetches all (read and unread mail)
 macro index g "<shell-escape>fetchmail -k -m procmail --fetchmailrc ~/.fetchmailrc.keep" "fetch the mail from IMAP/POP servers"
 macro index G "<shell-escape>fetchmail    -m procmail" "fetch the mail from IMAP/POP servers"
#macro index G "<shell-escape>fetchmail -a -m procmail" "fetch the mail from IMAP/POP servers"

#macro pager \cP "<enter-command>previous-thread"
#macro index \cP "<enter-command>previous-thread"

# next means 'upper', previous means 'lower'
bind  pager N previous-thread
bind  index N previous-thread
bind  pager P next-thread
bind  index P next-thread
#bind  pager D delete-thread
#bind  index D delete-thread
bind  pager D delete-thread
bind  index D delete-thread
bind  pager R read-thread
bind  index R read-thread
#bind  pager ^N next-thread
#bind  index ^N next-thread
#bind  pager ^P previous-thread
#bind  index ^P previous-thread

# macro index y "M<change-folder>?<toggle-mailboxes>"
#
# ^D is not correct for Control-D ! you need \cD !
bind index \cD delete-pattern


##########################################################################
## Using PGP
#forget the passphrase in 3 hours
set pgp_timeout = 11800 #  3600
#unset pgp_long_ids
set pgp_replyencrypt
#set pgp_autosign
#unset pgp_autoencrypt
#set pgp_encryptself
unset pgp_replysign
#set pgp_strict_enc
set pgp_verify_sig = yes

# CLEARTEXT INLINE GPG
set pgp_create_traditional = no
macro compose \cx "Fgpg --clearsign\nyy"
macro pager \cv "|gpg --verify;sleep 1\n"
macro pager \ef "|view-x-face\n"

###############################################################################
# decode application/pgp
#
# note that you can add "echo 'MY ALMIGHTY SECRET PASSPHRASE ' |" prior to "gpg ... --passphrase-fd 0" in this file if you want ..
#
# --no-emit-version

set pgp_decode_command="gpg --no-emit-version %?p?--passphrase-fd 0? --no-verbose --batch -o - %f"
# verify a pgp/mime signature
set pgp_verify_command="gpg --no-emit-version --no-verbose --batch -o - --verify %s %f"
# decrypt a pgp/mime attachment
set pgp_decrypt_command="gpg --no-emit-version --passphrase-fd 0 --no-verbose --batch -o - %f"
# create a pgp/mime signed attachment
#set pgp_sign_command="gpg -q --batch -o - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_sign_command="gpg --no-emit-version -q --batch -o - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
# create a application/pgp signed (old-style) message
set pgp_clearsign_command="gpg --no-emit-version --no-verbose --batch -o - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
# create a pgp/mime encrypted attachment
set pgp_encrypt_only_command="pgpewrap gpg --no-emit-version -v --batch -o - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
# create a pgp/mime encrypted and signed attachment
set pgp_encrypt_sign_command="pgpewrap gpg --no-emit-version --passphrase-fd 0 -v --batch -o - --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-emit-version --no-verbose --import -v %f"
# export a key from the public key ring
set pgp_export_command="gpg --no-emit-version --no-verbose --export --armor %r"
# verify a key
set pgp_verify_key_command="gpg --no-emit-version --no-verbose --batch --fingerprint --check-sigs %r"
# read in the public key ring
set pgp_list_pubring_command="gpg --no-emit-version --no-verbose --batch --with-colons --list-keys %r" 
# read in the secret key ring
set pgp_list_secring_command="gpg --no-emit-version --no-verbose --batch --with-colons --list-secret-keys %r" 
# receive key from keyserver:
set pgp_getkeys_command="gpg --no-emit-version --recv-key %r"

# my own key pair is in a personal file
set pgp_sign_as=""
set pgp_autosign="no"
# this way, mutt will not prompt anymore for S/MIME encryption
set crypt_autosmime="no"

# asbesto's  recipe to decrypt non mime signed messages!
message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ MESSAGE"' "exec check-traditional-pgp
message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec check-traditional-pgp"

##########################################################################

# sendhooks :
#sample sendhooks:
#send-hook . 'my_hdr From: user <user@host.com>'
#send-hook '~t institution\.gov$' 'my_hdr From: Name Surname <user@host.com>'
#send-hook '~t ^friend@host.com$' 'my_hdr From: Your Preferite Geek <user@host.com>'

source "~/.mutt/muttrc.personal"                # personal color settings, pgp_sign_as ..

##########################################################################
## Printing options
set print_command="lpr"
#set print=ask-no
#push ":ciao belli!"
set dsn_notify="failure,success,delay"

#mbox-hook pattern mailbox

set ispell="ispell -d  /usr/lib/ispell/italian.hash"

iconv-hook iso-8859-1 8859-1
              

set mime_forward=ask-yes

#let's say you want some more privacy.. your Message-ID will reflect this!
set hostname = "localhost"
#.... and the pride of using Mutt ? :)
#set user_agent = "no"
set user_agent = "yes"

# idea : could ue this to exec a custom script with custom-random settings :P
macro index E  ":source ~/.mutt/extra.rc" "use new Extra features. estabilished 20080519"

set askbcc=yes


#this configuration works on :
#Mutt 1.5.11 (2005-09-15)
#Copyright (C) 1996-2002 Michael R. Elkins and others.
#Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
#Mutt is free software, and you are welcome to redistribute it
#under certain conditions; type `mutt -vv' for details.
#
#System: Linux 2.6.16.17 (i686) [using ncurses 5.4] [using libidn 0.5.15 (compiled with 0.5.15)]
#Compile options:
#-DOMAIN
#-DEBUG
#-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
#-USE_FCNTL  +USE_FLOCK   -USE_INODESORT  
#+USE_POP  +USE_NNTP  +USE_IMAP  -USE_GSS  -USE_SSL  +USE_GNUTLS  -USE_SASL  
#-HAVE_REGCOMP  +USE_GNU_REGEX  +COMPRESSED  
#+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
#+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
#+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  +CRYPT_BACKEND_GPGME  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
#+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
#+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +HAVE_GETADDRINFO  +USE_HCACHE  
#-ISPELL
#SENDMAIL="/usr/sbin/sendmail"
#MAILPATH="/var/spool/mail"
#PKGDATADIR="/usr/share/mutt"
#SYSCONFDIR="/etc/mutt"
#EXECSHELL="/bin/sh"
#MIXMASTER="mixmaster"
#To contact the developers, please mail to <mutt-dev@mutt.org>.
#To report a bug, please use the flea(1) utility.
#
#vvv.nntp
#patch-1.5.6.dw.pgp-timeout.1
#patch-1.5.6.dw.mbox-hook.1
#rr.compressed
#patch-1.5.4.lpr.collapse_flagged Lukas P. Ruf <lukas.ruf@lpr.ch>
#patch-1.5.10.tt.assumed_charset.1

# A tip : to delete duplicate messages, in the main menu sort by thread
# (o and t) then press T, select the =~ pattern. And then ;d to delete :)
#




# note : dez@chip msmtp-1.4.15rc1 $ ./configure  --with-ssl=openssl
# the following (shipped with debian) is flawed :
#
# chip:~# msmtp --version
# msmtp version 1.4.15
# TLS/SSL library: OpenSSL
# Authentication library: built-in
# Supported authentication methods:
# plain cram-md5 external login
# IDN support: disabled
# NLS: enabled, LOCALEDIR is /usr/local/share/locale
# System configuration file name: /usr/local/etc/msmtprc
# User configuration file name: /root/.msmtprc
#
# Copyright (C) 2008 Martin Lambers and others.
# This is free software.  You may redistribute copies of it under the terms of
# the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
# There is NO WARRANTY, to the extent permitted by law.
#
# On Debian, the pgpewrap file is by default in /usr/lib/mutt


# 20080728 from today, I use isync, too :
# http://isync.sourceforge.net/
# Description: MailDir mailbox synchronizer
#
# http://www.rc0.org.uk/mairix/
# mairix is a program for indexing and searching email messages stored in Maildir (see the documentation section below), MH or mbox folders.
#
# mboxgrep
# ./configure   --enable-pop  --enable-smtp  --enable-imap  --with-gnutls
#