####################################################
#                     mutt by barabba
#                       ~/muttrc
#              customized muttrc by mm-barabba
#
#                    .xm*f""??T?@hc.
#                  z@"` '~((!!!!!!!?*m.
#                z$$$K   ~~(/!!!!!!!!!Mh
#              .f` "#$k'`~~\!!!!!!!!!!!MMc
#             :"     f*! ~:~(!!!!!!!!!!XHMk
#             f      " %n:~(!!!!!!!!!!!HMMM.
#            d          X~!~(!!!!!!!X!X!SMMR
#            M :   x::  :~~!>!!!!!!MNWXMMM@R
#            E ' *  ueeeeiu(!!XUWWWWWXMRHMMM>
#            E  8 .$$$$$$$$K!!$$$$$$$$&M$RMM>
#            3  $ 4$$$$$$$$!~!*$$$$$$$$!$MM$
#            ?> # '#$$$$$#~!!!!TR$$$$$R?@MME
#             5     ^"""~~~:XW!!!!T?T!XSMMM~
#              ?.       ~~d$X$NX!!!!!!M!MM
#               *c:.    .~"?!??!!!!!XX@M@~
#                #c`"!+~~~!/!!!!!!@*TM8M
#                'C*X  .!~!~!!!!!X!!!@RF
#                 9-MX!X!!X~H!!M!N!X$MM
#                 'L'!~M~)H!M!XX!$!XMXF
#                  R *H$@@$H$*@$@$@$%M~
#                  'k' M!~M~X!!$!@H!tF
#                   "k ~~~!~!!!!!M!X*
#                    '%:.~~~:!!!!XH"
#                      ^"#4@UU@##"
#
#                    thk's to skizzhg
######################################################
set imap_user = "user" ###MODIFICARE
set imap_pass = "pass" ###MODIFICARE
set folder = imap://localhost/
set spoolfile = imap://localhost/INBOX/
set record = imap://localhost/INBOX/Inviata
set postponed = imap://localhost/INBOX/Bozze
#set trash = imap://localhost/INBOX/Cestino/
#set mask="!^\\.[^.]"

# wait to enter mailbox manually
#set imap_passive
unset imap_passive
# Automatically poll subscribed mailboxes for new mail (new in 1.5.11)
set imap_check_subscribed
# Reduce polling frequency to a sane level
#set mail_check=15
# And poll the current mailbox more often (not needed with IDLE in post 1.5.11)
#set timeout=5
# keep a cache of headers for faster loading (1.5.9+?)
#set header_cache=~/.hcache
# Display download progress every 5K
set net_inc=5

#Add macros to make the folder browser usable by always using the mailboxes setup above
macro index c "<change-folder>?<toggle-mailboxes>" "open a different folder"
macro pager c "<change-folder>?<toggle-mailboxes>" "open a different folder"

#Set the index_format variable to include all manner of different details about each message.
#In particular, the %d format string, which inserts the date formatted according to the value of date_format
#or one of the other date format strings, such as %{fmt}, %[fmt], etc.
set index_format="%4C %Z %[!%b %d %Y] %-17.17F (%3l) %s"

#Sidebar
set sidebar_width=25
set sidebar_visible=yes
set sidebar_delim='|'
color sidebar_new yellow default
bind index,pager \CP sidebar-prev
bind index,pager \CN sidebar-next
bind index,pager \CO sidebar-open
macro generic,index,pager B '<enter-command>toggle sidebar_visible<enter><refresh>'

# brighten up stuff with colours, for more colouring examples see:
# http://aperiodic.net/phil/configs/mutt/colors
color normal      white          black
color hdrdefault  green          default
color quoted      green          default
color quoted1     yellow         default
color quoted2     brightblue     default
color signature   cyan           default
color indicator   brightyellow   red
color error       brightred      default
color status      brightwhite    blue
color tree        brightmagenta  black
color tilde       blue           default
color attachment  brightyellow   default
color markers     brightred      default
color message     white          black
color search      brightwhite    magenta
color bold        brightyellow   default

color header brightgreen default ^(From|Subject):
color body cyan default "(ftp|http|https)://[^ ]+"   # point out URLs
color body cyan default [-a-z_0-9.]+@[-a-z_0-9.]+    # e-mail addresses
color underline brightgreen default

#bind di alcune funzioni
bind  pager   <up>     previous-line
bind  pager   <down>   next-line
bind  pager   <left>   exit
bind  pager   <right>  view-attachments
bind  attach  <left>   exit
bind  attach  <right>  view-attach
bind  index   <right>  display-message
macro index   <left>   "<change-folder>?" "Select folder"
bind  browser <right>  select-entry
macro browser <left>   "<exit><change-folder>!<Enter>" "Return to folder"

# set from to ensure mutt doesn't put user@localhost.localhost 
set from="user@nospam.org"  ###MODIFICARE
set use_from=yes
set envelope_from="yes"

# set realname
set realname="MC_puppa" ###MODIFICARE

# set some coloring for easier mail reading
# Color messages
color index brightyellow default ~N
color index brightred default ~D

set send_charset="utf-8"

#MAILCAP vista allegati : ftp://ftp.mutt.org/mutt/contrib/mutt-octet-filter.tar.gz
set mailcap_path=~/.mutt_mailcap:/usr/local/etc/mailcap:/etc/mailcap
auto_view application/octet-stream

# abook info
set alias_file=~/.mutt-alias
source ~/.mutt-alias
set query_command= "abook --mutt-query '%s'"
macro index,pager A "<pipe-message>abook --add-email-quiet<return>" "add the sender address to abook"

# firma della mail
set signature="~/.signature"

#gpg set
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-sig --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="/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x44FIGA89 -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x44FIGA89 -- -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" 

# specify the uid to use when encrypting/signing
set pgp_sign_as=44FIGA89

# this set the number of seconds to keep in memory the passpharse used to encrypt/sign
# the more the less secure it will be
set pgp_timeout=1800

# it's a regexp used against the GPG output: if it matches some line of the output
# then mutt considers the message a good signed one (ignoring the GPG exit code)
set pgp_good_sign="^gpg: Good signature from"

# mutt uses by default PGP/GPG to sign/encrypt messages
# if you want to use S-mime instead set the smime_is_default variable to yes

# automatically sign all outgoing messages
#set crypt_autosign
# sign only replies to signed messages
#set crypt_replysign

# automatically sign
#set pgp_autosign=yes
# automatically encrypt outgoing messages
#set crypt_autoencrypt=no
# encrypt only replies to signed messages
#set crypt_replyencrypt=yes
# encrypt and sign replies to encrypted messages
#set crypt_replysignencrypted=yes
# automatically verify the sign of a message when opened
set crypt_verify_sig=yes

#auto bcc to me
#my_hdr Bcc:nospam@nomail.it
