## pouzivam maildir...
set folder=~/Maildir
set mbox_type=Maildir
set mbox=~/Maildir/.trash/
mailboxes =. =.sent-mail =.trash =.spam =.Linux =.Linux-admin =.Linux-kernel =.Linux-prog =.hw-news =.saved-messages =.sent-mail =.Webdesign =.zpracovat =.ulozeno
set mask="!^\\.[^.][.^]"

#hlavicky ktere chci videt pri cteni
ignore *
unignore From To Cc Subject Date Reply-To Organization
hdr_order From: Date: To: Cc: Subject:

my_hdr From: (Zdeněk Burda) zdenda@zdenda.com
my_hdr Reply-To: (Zdeněk Burda) zdenda@zdenda.com 
# Automatically begin editing messages
set autoedit=yes
set edit_headers

# Append messages to other mailboxes automatically
unset confirmappend

# Automatically delete messages
set delete=yes

# View html mails using lynx
set implicit_autoview
auto_view text/html  application/x-pgp-message
set mailcap_path="~/.mailcap"
set mailcap_sanitize=yes

# envelope sender must match
set envelope_from
# Reply FASTER!
#set fast_reply

# Don't save outgoing attachments
unset fcc_attach

# Dont include self in reply
unset reply_self

# Automatically quote message
set include=yes

# Set quotemark to 1 byte
set indent_str="> "

#set index_format   = "%4C %Z %{%b %d} %-15.15F (%4l) %s"
set index_format   = "%4C %Z %{%b %d} %-15.15F  %s"
set forward_format="Fw: %s"     # subject in forwarded messages
set date_format="%d/%m/%y %H:%M %Z"
set quote_regexp="^([A-Za-z ]+>|[]%>:|}-][]>:|}-]*)"
set reply_regexp='^((re(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*'

set mime_forward=ask-yes

# Use vim as the editor - this line will wrap
# Set wordwrap on in vim to automatically wrap lines - 
# no :gq all the time
set editor="vim +':set textwidth=77' +':set foldcolumn=0' +':set nu!' +':set wrap' +\`awk '/^$/ {print i+2; exit} {i++}' %s\` %s" 
set visual=vim			# editor invoked by ~v in the builtin editor

# dont mark messages old
set nomark_old

# Location for postponed messages
set postponed="=.postponed-msgs/"

# I don't want to resume postponed messages
#set recall=no

# Save copies of outgoing e-mail
set record="=.sent-mail/"

# Don't confirm using Reply-To: headers
set reply_to=yes

# Delete empty mailboxes
unset save_empty

# Save mail to =received when I press ">", like in Elm
set mbox="=./"

# Apply operations to tagged messages automatically
set auto_tag

# Tell mutt which mails to recognize as mailing lists
subscribe Linux Linux-kernel hw-news Linux-prog Linux-admin Webdesign


folder-hook . set sort=threads
folder-hook . my_hdr From: Zdeněk Burda <Z.Burda@sh.cvut.cz>
folder-hook . my_hdr X-PGP-Key: http://www.zdenda.com/zdenek_burda.pub
folder-hook . my_hdr Organization: http://www.zdenda.com
#folder-hook . my_hdr X-OS: `uname -mnrs`
# Ignore annoying MAIL SYSTEM INTERNAL DATA message
# generated by c-client (pine / uw-imapd)
folder-hook . "push \"l!(~s 'FOLDER INTERNAL DATA')\n*\""

folder-hook Linux unmy_hdr reply-to
#folder-hook linux 'set attribution="+++ %n [linux] [%d]:"'
#folder-hook linux my_hdr From: linux@bar.com (Foo Linux)
#folder-hook linux my_hdr Organization: Hopelessly Disorganized
#folder-hook linux set signature="~/sig.unix|"


# color patterns for mutt
color normal     white		default # normal text
color indicator  brightyellow   red     # actual message
color tree       green          default # thread arrows
color status     brightyellow   blue    # status line
color error      brightred      default # errors
color message    brightcyan     default # info messages
color signature  red            default # signature
color attachment brightyellow   red     # MIME attachments
color search     default        green   # search matches
color tilde      brightmagenta  default # ~ at bottom of msg
color markers    brightcyan     default # + at beginning of wrapped lines
color hdrdefault cyan           default # default header lines
color bold       red            default # hiliting bold patterns in body
color underline  brightgreen    default # hiliting underlined patterns in body
color quoted     green          default # quoted text
color quoted1    magenta        default
color quoted2    red            default
color quoted3    green          default
color quoted4    magenta        default
color quoted5    cyan           default
color quoted6    magenta        default
color quoted7    red            default
color quoted8    green          default
color quoted9    cyan           default
color body   magenta  default  "((ftp|http|https)://|news:)[^ >)\"\t]+"
color body   magenta  default  "[-a-z_0-9.+]+@[-a-z_0-9.]+"
color body   red   default  "(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]"
color body   green default  "(^| )_[-a-z0-9_]+_[,.?]?[\n]"
color body   red   default  "(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]"
color body   green default  "(^| )_[-a-z0-9_]+_[,.?]?[ \n]"
color index  cyan  default  ~F         # Flagged
color index  yellow   default  ~N         # New
color index  magenta    default  ~T         # Tagged
color index  cyan       default  ~D         # Deleted
color attachment brightmagenta default


# Don't ask to move read messages to mbox on exit
set move=no

###
# Bindings - change key bindings
###

# Customize the pager
bind pager [ previous-line
bind pager < previous-line
bind pager ] next-line
bind pager > next-line
bind pager <down> next-page
bind pager <up> previous-page
bind pager <left> previous-entry
bind pager <right> next-entry 

bind index <up> previous-entry
bind index <down> next-entry

# imitate the old search-body function
macro index \eb '/~b ' 'search in message bodies'

# simluate the old url menu
#macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
#macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'

# Show documentation when pressing F1
macro generic <f1> "!less /usr/doc/mutt/manual.txt\n" "Show Mutt documentation"
macro index   <f1> "!less /usr/doc/mutt/manual.txt\n" "Show Mutt documentation"
macro pager   <f1> "!less /usr/doc/mutt/manual.txt\n" "Show Mutt documentation"

macro index \ea "!$EDITOR ~/.mutt-aliases\n:source ~/.mutt-aliases\n" "edit aliases file and reload it"
macro pager \ea "!$EDITOR ~/.mutt-aliases\n:source ~/.mutt-aliases\n" "edit aliases file and reload it"

#macro pager d <exit><delete-message>

#macro index l "g?\t" "folder list" # Shows folder list
#macro pager l "g?\t" "folder list" # Shows folder list
#macro browser c "qm" "compose mail" # To compse new mail from the browser
#macro index S "as" "save tagged messages" # Saves tagged messages
#macro pager P "!gpg --keyserver wwwkeys.us.pgp.net --recv-key 0x" "Get PGP Key"
#macro pager L "!gpg --lsign-key " "Sign PGP Key"

#macro index \ee ":source ~/.mutt/muttrc\n" "\"ESC e\" reloads the muttrc"
#macro pager \ee ":source ~/.mutt/muttrc\n" "\"ESC e\" reloads the muttrc"
macro index <F5> ":source ~/.muttrc\n" "Reload the muttrc"
macro pager <F5> ":source ~/.muttrc\n" "Reload the muttrc"

#macro index \cx "!fetchmail\n" "Check for new mail via fetchmail"
#macro pager \cx "!fetchmail\n" "Check for new mail via fetchmail"
macro pager S "<save-message>\n" "Save without confirmation"
macro index S "<save-message>\n" "Save without confirmation"




# Set and source our alias file
set alias_file=~/.mutt-aliases
source ~/.mutt-aliases


source ~/.gpg.rc
set fcc_clear
set forward_decrypt
unset pipe_decode
set pgp_ignore_subkeys  # On OpenPGP keys only show the main key, not the sub.
unset pgp_autosign      # pgp sign every outgoing mail. (send-hook?)
unset pgp_autoencrypt   # pgp encrypt every outgoing mail. (send-hook?)
set pgp_create_traditional=ask-no       # Use old-style PGP? (don't do it!)
set pgp_replyencrypt    # Encrypt replies on encrypted mail
set pgp_replysign       # Sign replies on signed mail
set pgp_replysignencrypted      # Sign replies on encrypted mail
unset pgp_retainable_sigs       # disable retainable signatures.
set pgp_verify_sig=yes  # ask me whether I want to check a pgp signature
set pgp_timeout=7200    # forget PGP passphrase after 7200 seconds (=2 hours)
set pgp_strict_enc      # allway use QP enc. with PGP.
unset pgp_long_ids      # display 64bit PGP key-ids (don't change this!)
set pgp_show_unusable   # show unusable PGP keys in menu
set pgp_sign_as=0x0161626E

# %n = number   %k = key id     %K = key id of the principal key
# %u = user id  %a = algorithm  %A = algorithm of the princ. key
# %l = length   %L = length of the princ. key
# %f = flags    %F = flags of the princ. key
# %c = capabilities             %C = capabilities of the princ. key
# %t = trust/validity of the key-uid association
set pgp_entry_format="%4n %t%f %[%y/%m/%d] %4l/0x%k %-4a %2c %u"
set pgp_sort_keys=trust
# Once you are done with composing a mail in vim, and
# before you press y to send out an email, just press
# S and enter your PGP passphrase to pgp-clearsign an
# email.  Mutt uses PGP-MIME signatures by default, and
# several clients (most notably windows clients) absolutely
# hate the very idea of PGP-MIME :(
# Put your gpg key id below instead of my key 0xEDEDEFB9
macro compose S "gpg -a --clearsign -u 0161626E"

# Don't encrypt
send-hook . unset pgp_autoencrypt
# Sign
send-hook . set pgp_autosign
# Abort if no subject.
send-hook . set abort_nosubject=ask-yes
# Now the exceptions:
# Majordomo doesn't care about signatures or subject lines
send-hook Majordomo@ unset pgp_autosign
send-hook Majordomo@ set abort_nosubject=no
# Send encrypted to these people
#send-hook tim@cyberelk\.demon\.co\.uk set pgp_autoencrypt
#send-hook twaugh@redhat.com set pgp_autoencrypt
#send-hook bandregg@redhat\.com set pgp_autoencrypt
# Use the 'twaugh@redhat.com' key for this address
#pgp-hook tim@cyberelk\.demon\.co\.uk 44E96F28

# I don't have a signature, so I don't use sigdashes
#unset sig_dashes
###############################################




#set arrow_cursor
set attribution="On %d or thereabouts, %n wrote:"
unset beep
set copy=yes
set forward_format="Fwd: %s"
set pager_context=1
set print_command="lpr -P tiskarna"
set history=100
set pipe_decode
set pager_stop
set pager_index_lines=5
set realname="Zdeněk Burda"

set reply_regexp="^((re(\\^[0-9])? ?:|a(nt)?w(ort)?:|\\(fwd\\))[ \t]+)*"
set smileys="(>From )|(>?[;:][-^]?[][)(><}{|/DP][)}]*)"
set sort=threads
set sort_aux=date-sent

# move 1/2 page up/down like in vi
bind generic \Cu    half-up
bind generic \Cd    half-down
bind pager   \Cu    half-up
bind pager   \Cd    half-down
bind generic   b    previous-page
bind generic \Cb    previous-page
bind generic \Cf    next-page
bind generic   1G   first-entry
bind generic   1g   first-entry
bind generic <Home> first-entry
bind generic \Ca    first-entry
bind generic   G    last-entry
bind generic <End>  last-entry
bind generic \Ce    last-entry

bind pager   \eD    delete-thread
bind pager   \eU    undelete-thread
# ^U and ^D were bound otherwise, so bind it now again to something else
bind pager \Ca      top
bind pager <Home>   top
bind pager  1G      top
bind pager  1g      top
bind pager \Ce      bottom
bind pager <End>    bottom
bind pager   G      bottom
bind pager   q      exit
bind pager <Left>   exit
bind pager   i      noop
bind pager   B      bounce-message
bind pager   b      previous-page
bind pager \Cb      previous-page
bind pager \Cf      next-page
bind pager <Up>     previous-line
bind pager <Down>   next-line
bind pager <Insert> previous-entry
bind pager <Delete> next-entry

bind index \eD     delete-thread
bind index \eU     undelete-thread
# ^U and ^D were bound otherwise, so bind it now again to something else
bind index   B     bounce-message
bind index \ef     forget-passphrase
bind index \Cb     previous-page
bind index \Cf     next-page
bind index <Up>    previous-entry
bind index <Down>  next-entry
bind index <Right> display-message
bind index <Home>  first-entry
bind index <End>   last-entry
bind index   1G    first-entry
bind index   1g    first-entry
bind index \Ca     first-entry
bind index   G     last-entry
bind index \Ce     last-entry

bind alias <Tab> next-entry

bind browser <Right> select-entry

auto_view text/html text/enriched text/x-vcard application/x-zip-compressed
alternative_order text/plain text/html

set signature="~/.signature"

set dsn_notify="failure,delay,success"  # failure = chyba
                                        # delay = prodlení
                                        # success = úspěšné doručení
set dsn_return="hdrs"

set charset="iso-8859-2"
set allow_8bit

