# This has been touched by htmlify .01 by Sec
# You can get the un-html-i-fied version here
#
# .90 updated file - This is Stefan `Sec` Zehl's .muttrc
#
# This and the other files can be accessed as http://sec.42.org/mutt/.mutt/
#

############ Make color settings depend on $TERM
source "~/.mutt/$TERM

############ Should be in an alias-file ( Now it is -- Sec )
set alias_file=~/.mutt/aliases #reverse_alias
source ~/.mutt/aliases

############ People can reach me via maaaaany ways :)
# Liviu made this an regexp, now it's faster, but harder to read.
set alternates=sec(\\+.*)?@.*(bos-muenchen.de|muc.de|camelot.de|muffin.org|42.org|wg|leo.org|musin.de)|zehl@informatik.tu-muenchen.de|sec|.*@sec.42.org
# actually this one catches too much, but I've been lazy...

############ Bind's & Macros
bind pager  previous-page
bind pager  next-page

macro pager  ":set nowait_key\n|urlview\n:set wait_key\n"
macro index  ":set nowait_key\n|urlview\n:set wait_key\n"

# termcap is terribly wrong sometimes....
bind generic \r select-entry
bind index \r display-message
bind pager \r next-line
bind generic \e[A previous-entry
bind generic \e[B next-entry
bind index \e[A previous-undeleted
bind index \e[B next-undeleted

bind index help # just for the fun of it :)

bind index - previous-jump # Needs my previous-jump patch
bind pager - previous-jump

macro index \# "lall\r" # show _all_ mails
macro index \' "l ~F | ~U\r" # show flagged and unread mails (i.e. important)
macro index \` "l ! ~Q | ~F\r" # show unreplied and flagged mails (i.e. TODO)

macro pager S ":set invsmart_wrap invmarkers\n" #toggle Linewrap for cut'n'paste
macro compose S "Fpgp +verbose=0 -fast +clearsig=on\ny^T^Uapplication/pgp; format=text; x-action=sign\n" # To pgp-sign the old way :)

macro pager A "|~mj/bin/approve\nd" # majordomo-Mail approver

#I want to leave at ONCE with 'X'. No questions asked, all changes lost.
macro generic X xX
macro index X x
macro attach x q
macro browser x q
macro compose X xX
macro compose x qn

############ Headers to Ignore
#Std.
ignore Received From In-Reply-To Message-Id Status X-Status X-Face
#Mime
ignore MIME-Version Content- Lines
#Lists & Bounce
ignore Resent-Message-Id Resent-Date Received-Date Resent-To Old-Return-Path
ignore Precedence X-mailing-list X-loop
#Sometimes News are showing up in my mailfolder
ignore NNTP-Posting-Host Path Organization Xref Xcanpos Approved References
#Crappy
ignore X-MIME-Autoconverted X-Warning X-Sun-Charset X-Request-Do
ignore X-Commercial-Mail- X-Copyright- #Posted-Date Encoding
ignore X-Disclaimer # Junk gets junked
ignore X-MSMail-Priority X-MimeOLE # Outlook sucks.

############ PROMPTS
set copy=yes record=+sent save_name # force_name
set postpone=ask-yes recall=no postponed=~/Mail/postponed
set delete=yes move=ask-no nomove
set include=ask-yes reply_to=ask-yes print=ask-no

############ STRINGS
#set attribution="On %M %N, %n wrote:"
#set date_format="%b %d, %Y at %I:%M:%S%p"
#set date_format_local="%d.%m.%y %H:%M"
#set in_reply_to="%i; from \"%n\" on %d"
#set indent_str="> "
#set post_indent_str=""
#set post_indent_str=CU,\n\tSec\n
#set forw_format="[%a: %s]"

set forw_format="Fwd: %s"
set forw_quote

#hdr_format is set via hook.

set pager_format="[%Z] %C/%m %.38f%> %[%d.%b %y, %H:%M]"

#.87.6 finally included a version of my patch... (yes, this looks ugly)
set status_format="%r %v [%?M?%M/?%m] %?n?%n new, ?%?p?%p postponed, ?%?t?%t tagged, ?%?d?%d deleted, ?(%h:%f) %?b?%b more to go.?%> %r"

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

# Replaced by urlview in .89
#set url_regexp="([a-z]*://|mailto:)[^\" \n\t]*[^\"., \n\t>)]"
#set web_browser='~/bin/view "%s"' # my url_handler script.

############ Maillists
lists admins pi mutt-users mutt-dev challenge des-challenge ircnet irc doom sw-wml info-cvs wmx plan muc-lists mobile
mailboxes !
mailboxes +Listen/cron # I get masses of auto-email
mailboxes +Listen/mj # I get some more auto-email
mailboxes +Listen/wmx +Listen/plan +Listen/ssdev-muc
mailboxes +Listen/doom +Listen/aero
mailboxes +Listen/ircd +Listen/irc-oper
mailboxes +Listen/mutt-users +Listen/mutt-dev
mailboxes +Listen/wml +Listen/ircnet +Listen/cvs
mailboxes +Listen/muccc +Listen/ircd-dev +Listen/dnrc
mailboxes +Listen/bugtraq +Listen/bos +Listen/sic
mailboxes +Listen/challenge +Listen/des-challenge +Listen/des-challenge.muell
mailboxes +Listen/freebsd-ports
mailboxes +Listen/freebsd-mobile
mailboxes +Listen/ethereal-users +Listen/ethereal-dev
mailboxes +Listen/sage
mailboxes +muell +dupes # Test of anti-spam system

#set ignore_list_reply_to

############ Hooks
folder-hook . "bind index M noop"
folder-hook . 'set hdr_format="%4C %Z %[%b %e] %-15.15L (%4l) %s"'
folder-hook . "set nostrict_threads"
folder-hook . 'set read_inc=10 write_inc=10'
folder-hook . 'unignore X-Authentication-Warning'
folder-hook . 'unset backlog'
folder-hook . 'set sort_re'

folder-hook =Listen/ 'set hdr_format="%4C %Z %[%b %e] %-15.15F (%4l) %s"'
folder-hook =Listen/mutt- "set strict_threads"
folder-hook =Listen/irc "set strict_threads"
folder-hook =Listen/mutt- 'set read_inc=42 write_inc=42'
folder-hook =Listen/mutt- 'ignore X-Authentication-Warning'
folder-hook =Listen/ircnet 'ignore X-Authentication-Warning'
folder-hook =muell 'set hdr_format="%Z%2C: [%c] at %{%e.%b %y, %H:%M} from %a [%s]"'
folder-hook \! 'set backlog' # requires my patch.
folder-hook \! 'set nosort_re'

folder-hook =Listen/admins 'macro index M "madmins\r"'
folder-hook =Listen/mutt-dev 'macro index M "mmutt-dev\r"'
folder-hook =Listen/mutt-users 'macro index M "mmutt-users\r"'
folder-hook =Listen/ircd 'macro index M "mirc@info5.rus.uni-stuttgart.de\r"'

# they return submissions.
save-hook ~L\ sw-wml +Listen/wml
save-hook ~L\ mutt-dev +Listen/mutt-dev
save-hook ~L\ mutt-users +Listen/mutt-users
save-hook ~L\ admins +Listen/admins
save-hook ~L\ ^pi$ +Listen/pi
save-hook ~L\ doom +Listen/doom
save-hook ~L\ muc.lists +Listen/muc-lists
save-hook ~L\ ssdev-muc +Listen/ssdev-muc

send-hook . set record=+sent
send-hook mutt-dev set record=+sent-dupes
send-hook mutt-users set record=+sent-dupes
send-hook admins set record=+sent-dupes
send-hook muc-lists set record=+sent-dupes
send-hook ^pi$ set record=+sent-dupes
send-hook ssdev-muc set record=+sent-dupes

# they don't
save-hook ~L\ irc-opers +Listen/irc-opers
save-hook ~L\ irc +Listen/ircd
send-hook irc-opers set record=+Listen/irc-opers
send-hook irc set record=+Listen/ircd

# I hate it, but i gotta do it.
send-hook . unmy_hdr From:
send-hook mutt-dev my_hdr From: sec+mutt-dev

# Some Headers. Just for fun.
send-hook . "my_hdr X-URL: http://sec.42.org/"
send-hook . "unmy_hdr X-Visit-My-Mutt-Page"
send-hook . "unmy_hdr X-Nick"
send-hook . "unmy_hdr Reply-To"

send-hook mutt- "unmy_hdr X-URL"
send-hook mutt- "my_hdr X-Visit-My-Mutt-Page: http://sec.42.org/mutt/"
#send-hook mutt- "my_hdr X-Visit-My-Mutt-Page: Currently down till 1st May"
send-hook irc "my_hdr X-Nick: Sec"
send-hook irc@.*uni-stuttgart.de\
"my_hdr Reply-To: irc@info5.rus.uni-stuttgart.de"

# Some persons like pgp.
send-hook . set nopgp_autosign
send-hook wist@ex.muffin.org set pgp_autosign
send-hook opp@muffin.org set pgp_autosign
send-hook knarf@camelot.de set pgp_autosign

############ Some other settings
set fast_reply # Life's so short.
set smart_wrap
set sort=threads
set nohelp # I'm no newbie, man!
set history=50
set pager_stop # I'm used to it.
set tilde # I want to know where the mail ends...
set nostatus_on_top pager_status_on_top # Requires pager_status_on_top patch
set nomark_old # Old mails don't exist :)

set signature=~/bin/randomsig.pl| #remote_sig local_sig

set edit_hdrs editor="/usr/local/bin/vim +/^\$"
my_hdr I-love-doing-this: really
my_hdr Accept-Languages: de, en

set nopgp_strict_enc # I don't want to send Q-P mails.
set pgp_timeout=1200
set pgp_replysign pgp_replyencrypt # If the other end agrees on PGP, we join
#for secret things maybe: set nopgp_encryptself

set pipe_decode nopipe_split pipe_sep=

#set Realname="Stefan `Sec` Zehl"
#set allow_8bit
#set noquote_sig # Requires appropriate patch. Will be dumped soon.

set noconfirmappend # Get rid of nasty 0.80 warning.

# Ha, finally it's there.
hdr_order From From: Reply-To: To: Cc: Subject: Date:

# Some people send non-text mails.
auto_view text/x-vcard
auto_view text/html
alternative_order text/plain # I like plaintext more, than html.

# Saving all outgoing adresses with my script
set sendmail="~/bin/spam_wrapper /usr/sbin/sendmail -oi -oem -t"

# Try this out. Requires a lot of symlinks :)
set save_address
set nouse_domain

############ End of .muttrc - start scratch area :)

set reverse_name # Split-personality? -Danger. makes me send crap. needs fix
set score_auto # requires my score_auto patch

#score 'cvs' '~f Wunsch' +1000
#score '.' '~f sec' +100

# My scoring area.

# note: is order important ? i think, once i reaches <0 its killed.

folder-hook . unscore *
folder-hook . score '~A' +50
folder-hook . score '~F' +50
folder-hook . score '~E' -60

# Fernsehprogramm von Chillout.Org das aelter als ein tag ist: weg
folder-hook \! "score '~d >1d ~t tv@wellenbad.chillout.org ~f root@chillout.org' -60"

#To see what scoring is doing.
macro index S ':set hdr_format="%4C %Z %[%b %e] %-15.15L (%4N) %s"'\n

# ispell in german or english. Dont check quoted Text thus.
bind compose \cxi ispell
macro compose i ":set ispell=newsbody-ispell\n\cxi"
macro compose I ":set ispell=newsbody-ispell-deutsch\n\cxi"

set pgp_default_version=pgp2 # bug in the -i version

# Two different kinds of forwarding.
macro index \ef ":set mime_fwd\n\cxf"
macro index f ":set nomime_fwd\n\cxf"
bind index \cxf forward-message
set nomime_forward_decode forward_decode

# send unpgp'd
macro compose Y pfy

#send-hook . "my_hdr Test: default"
#send-hook "~C .de$" "my_hdr Test: somede"
#send-hook "^~C .de$" "my_hdr Test: allde"

# sendmail_wait - *sigh*
set sendmail_wait=1