# This has been touched by htmlify .01 by Sec
# You can get the un-html-i-fied version here
#
# .95 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...

# I'm now using a maildir-inbox
set spoolfile=+Inbox/

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

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

# 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

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

macro pager S ":set invsmart_wrap invmarkers\n" #toggle Linewrap for cut'n'paste

# To pgp-sign the old way :)
macro compose S "Fpgp +verbose=0 -fast +clearsig=on\ny^T^Uapplication/pgp; format=text; x-action=sign\n" "PGP-sign the OLD way"

# To pgp-encrypt the old way. Needs my expand-hook patch.
send-hook . 'macro compose E "Fpgp +verbose=0 +clearsig=on -fate \"%O\"\ny^T^Uapplication/pgp; format=text; x-action=encrypt\n"'

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

#I want to leave at ONCE with 'X'. No questions asked, all changes lost.
macro generic X xX "Exit Mutt"
macro index X x "Exit Mutt"
macro compose X xX "Exit Mutt"
macro attach x q
macro browser x q
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 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 folder-hook.
#attribution is set via send-hook.

#set pager_format="[%Z] %C/%m %.38f%> %[%d.%b %y, %H:%M]"
# next line needs my %A-patch
set pager_format="[%Z] %A-%C/%m %.34f%>%[%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 postfix-users freebsd-mobile canossa irc-id
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/wml +Listen/ircnet +Listen/cvs
mailboxes +Listen/muccc +Listen/ircd-dev +Listen/dnrc
mailboxes +Listen/news-admins +Listen/postfix-users
mailboxes +Listen/bugtraq +Listen/bos +Listen/sic +Listen/ccc-intern
mailboxes +Listen/challenge +Listen/des-challenge +Listen/des-challenge.muell
mailboxes +Listen/mutt-users +Listen/mutt-dev
mailboxes +Listen/freebsd-ports +Listen/irc-id
mailboxes +Listen/freebsd-mobile +Listen/unix
mailboxes +Listen/ethereal-users +Listen/ethereal-dev
mailboxes +Listen/sage +Listen/pilotgear
mailboxes +Listen/pilotmgr-announce +Listen/canossa
mailboxes +Listen/pilot-unix +Listen/kpilot-list +Listen/nocol
mailboxes +muell +Listen/semi-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 . unmy_hdr Reply-To:
send-hook mutt-users my_hdr From: sec@subscribe.mutt-users.lists.sec.42.org
send-hook mutt-users my_hdr Reply-To: sec
send-hook mutt-dev my_hdr From: sec+mutt-dev
send-hook mutt-dev my_hdr Reply-To: sec

# Lets see,
send-hook pilot-unix my_hdr From: sec@subscribe2.pilot-unix.lists.sec.42.org

# 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 mutt- "unmy_hdr X-URL"
send-hook mutt- "my_hdr X-Visit-My-Mutt-Page: http://sec.42.org/mutt/"
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 '^~C "(wist@ex.muffin.org|opp@muffin.org|knarf@camelot.de|markus@roses.de)"'\
set pgp_autosign


# Try to localize .signatures and attribution
send-hook . 'set signature="~/bin/randomsig.pl .e|"'
send-hook . 'set attribution="On %%d, %%n wrote:"'
#send-hook . 'my_hdr X-Sec-Match: default'

send-hook '!~C @' 'set signature="~/bin/randomsig.pl .d|"'
send-hook '!~C @' 'set attribution="Am %%[%%d. %%b %%Y um %%H:%%M %%Z] schrieb %%n:"'
#send-hook '!~C @' 'my_hdr X-Sec-Match: to local'

send-hook '^~C .de$' 'set signature="~/bin/randomsig.pl .d|"'
send-hook '^~C .de$' 'set attribution="Am %%[%%d. %%b %%Y um %%H:%%M %%Z] schrieb %%n:"'
#send-hook '^~C .de$' 'my_hdr X-Sec-Match: to .de'

send-hook '~l' 'set signature="~/bin/randomsig.pl .e|"'
send-hook '~l' 'set attribution="On %%d, %%n wrote:"'
#send-hook '~l' 'my_hdr X-Sec-Match: to list'


############ 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 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

set reverse_name # Split-personality? -Danger. makes me send crap. needs fix

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

set score_auto # requires my score_auto patch

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@wellenbad.chillout.org' -60"

# Commits for FreeBSD-ports are not so interesting.
# Except on initial Import or beeing discussed about.
# Read Mails vanish on their own, but flagged Mails never disappear.

folder-hook +Listen/freebsd-cvs "unscore *"
folder-hook +Listen/freebsd-cvs "score '~F' +999"
folder-hook +Listen/freebsd-cvs "score '~s ports/ ! ~s ^Re: ! ~s Imported' -20"
folder-hook +Listen/freebsd-cvs "score '~N' +10"
folder-hook +Listen/freebsd-cvs "score '~d >10d' -10"

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

# other different things...

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

set pgp_default_version=pgp2 # bug in the -i version

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

# send unpgp'd
macro compose Y pfy "send mail without pgp"

# sendmail_wait - *sigh*
set sendmail_wait=1

# The most used part of the mutts manual.txt:
#
# ~A all messages
# ~b EXPR messages which contain EXPR in the message body
# ~B EXPR messages which contain EXPR in the whole message
# ~c USER messages carbon-copied to USER
# ~C EXPR message is either to: or cc: EXPR
# ~D deleted messages
# ~d [MIN]-[MAX] messages with ``date-sent'' in a Date range
# ~E expired messages
# ~e EXPR message which contains EXPR in the ``Sender'' field
# ~F flagged messages
# ~f USER messages originating from USER
# ~g PGP signed messages
# ~G PGP encrypted messages
# ~h EXPR messages which contain EXPR in the message header
# ~k message contains PGP key material
# ~i ID message which match ID in the ``Message-ID'' field
# ~L EXPR message is either originated or received by EXPR
# ~l message is addressed to a known mailing list
# ~m [MIN]-[MAX] message in the range MIN to MAX *)
# ~n [MIN]-[MAX] messages with a score in the range MIN to MAX *)
# ~N new messages
# ~O old messages
# ~p message is addressed to you (consults $alternates)
# ~P message is from you (consults $alternates)
# ~Q messages which have been replied to
# ~R read messages
# ~r [MIN]-[MAX] messages with ``date-received'' in a Date range
# ~S superseded messages
# ~s SUBJECT messages having SUBJECT in the ``Subject'' field.
# ~T tagged messages
# ~t USER messages addressed to USER
# ~U unread messages
# ~x EXPR messages which contain EXPR in the `References' field
# ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)

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