Permalink
Browse files

several changes on email config:

1. add send-hooks config that give a chance to pick suitable email
address during composing email
2. minor tweak of offlineimaprc
3. mutt colours tweak
4. add random signatures based on email account
  • Loading branch information...
1 parent 8e09d1c commit ba6b97c84d20fff171a55b100f25edae441b11a2 @linsong committed Feb 4, 2010
View
@@ -146,4 +146,6 @@ WINDOWS_C
.fonts/fonts.scale
work/*
blog/linsong.github.com/
+.signatures/*.dat
+.signatures/seravia
View
@@ -4,55 +4,56 @@
#
# Default colour definitions
-color normal default black
-color hdrdefault black cyan
-color signature brightblack black
-color indicator brightwhite cyan
-color attachment magenta black
-color error red black
-color message green black
-color search brightwhite magenta
-color status brightyellow blue
-color tree brightblue black
-color tilde green black
-color bold brightyellow black
-color markers red black
+#color object foreground background pattern
+color normal white default
+color hdrdefault black cyan
+color signature brightblack default
+color indicator brightwhite cyan
+color attachment magenta default
+color error red default
+color message green default
+color search brightwhite magenta
+color status brightyellow blue
+color tree brightblue default
+color tilde green default
+color bold brightyellow default
+color markers red default
# Colour definitions when on a mono screen
mono bold bold
mono underline underline
mono indicator reverse
# Colours for items in the reader
-color header magenta black '^(status|lines|date|received|sender|references):'
-color header magenta brightblack '^(pr|mime|x-|user|return|content-)[^:]*:'
-color header brightyellow brightblack '^content-type:'
-color header magenta brightblack '^content-type: *text/plain'
-color header brightcyan brightblack '^(message-id|in-reply-to):'
-color header brightgreen brightblack '^list-[^:]*:'
-color header yellow brightblack '^from '
-color header brightcyan brightblack '^(disposition)'
-color header green brightblack '^(mail-)?followup'
-color header white brightblack '^reply'
-color header brightwhite brightblack '^(resent)'
-color header default brightblack '^from:'
-color header cyan brightblack '^(to|cc|bcc):'
-color header green brightblack '^(subject):.*$'
-mono header bold "^(From|Subject|X-Junked-Because|X-Virus-hagbard):"
+color header magenta default '^(status|lines|date|received|sender|references):'
+color header magenta default '^(pr|mime|x-|user|return|content-)[^:]*:'
+color header brightyellow default '^content-type:'
+color header magenta default '^content-type: *text/plain'
+color header brightcyan default '^(message-id|in-reply-to):'
+color header brightgreen default '^list-[^:]*:'
+color header yellow default '^from '
+color header brightcyan default '^(disposition)'
+color header green default '^(mail-)?followup'
+color header white default '^reply'
+color header brightwhite default '^(resent)'
+color header default default '^from:'
+color header cyan default '^(to|cc|bcc):'
+color header green default '^(subject):.*$'
+mono header bold "^(From|Subject|X-Junked-Because|X-Virus-hagbard):"
# Colours for items in the index
#color index brightwhite black "~N"
-color index green black "~R ~C nb@exoweb.net"
-color index brightgreen black "~N ~C nb@exoweb.net"
+color index green default "~R ~C nb@exoweb.net | ~C eng@seravia.com "
+color index brightgreen default "~N ~C nb@exoweb.net | ~C eng@seravia.com "
#color index green black "~N (~x exoweb\.net | ~h \"^In-[Rr]eply-[Tt]o: .*exoweb\.net\")"
-color index brightyellow black "~N (~C vincent@exoweb.net | ~C ant@exoweb.net | ~C linsong.qizi@gmail.com | ~C vincent@qnite.com)"
-color index yellow black "~R (~C vincent@exoweb.net | ~C ant@exoweb.net | ~C linsong.qizi@gmail.com | ~C vincent@qnite.com)"
-color index brightblue black "~N ( ~C linsong.qizi@gmail.com | ~C vincent@qnite.com)"
-color index blue black "~R ( ~C linsong.qizi@gmail.com | ~C vincent@qnite.com)"
+#color index brightyellow default "~N (~C vincent@exoweb.net | ~C ant@exoweb.net | ~C linsong.qizi@gmail.com | ~C vincent@qnite.com | ~C vincent@seravia.com)"
+#color index yellow default "~R (~C vincent@exoweb.net | ~C ant@exoweb.net | ~C linsong.qizi@gmail.com | ~C vincent@qnite.com | ~C vincent@seravia.com)"
+color index brightblue default "~N ( ~C linsong.qizi@gmail.com | ~C vincent@qnite.com | ~C vincent@seravia.com )"
+color index blue default "~R ( ~C linsong.qizi@gmail.com | ~C vincent@qnite.com | ~C vincent@seravia.com )"
#color index black red "~N ~d >1d"
-color index red black ~F
-color index black green ~T
-color index brightwhite black ~D
+#color index red default ~F
+#color index black green ~T
+color index brightwhite default ~D
mono index bold ~N
mono index bold ~F
mono index bold ~T
@@ -64,9 +65,9 @@ mono index bold ~D
# Highlights inside the body of a message.
# URLs
-color body brightblue black "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
-color body brightblue black "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
-color body brightblue black "news:[^ \">\t\r\n]*"
+color body brightblue default "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
+color body brightblue default "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+color body brightblue default "news:[^ \">\t\r\n]*"
mono body bold "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
mono body bold "news:[^ \">\t\r\n]*"
@@ -76,19 +77,19 @@ 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 black "<[Gg]>" # <g>
-color body brightgreen black "<[Bb][Gg]>" # <bg>
-color body brightgreen black " [;:]-*[)>(<|]" # :-) etc...
-color body brightblue black "(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)" # *Bold* text.
-color body brightblue black "(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)" # _Underlined_ text.
-color body brightblue black "(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)" # /Italic/ text.
+color body brightgreen default "<[Gg]>" # <g>
+color body brightgreen default "<[Bb][Gg]>" # <bg>
+color body brightgreen default " [;:]-*[)>(<|]" # :-) etc...
+color body brightblue default "(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)" # *Bold* text.
+color body brightblue default "(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)" # _Underlined_ text.
+color body brightblue default "(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)" # /Italic/ text.
# make quotes colorful
-color quoted cyan black
-color quoted1 green black
-color quoted2 yellow black
-color quoted3 red black
-color quoted4 brightcyan black
-color quoted5 brightgreen black
-color quoted6 brightyellow black
-color quoted7 brightred black
+color quoted cyan default
+color quoted1 green default
+color quoted2 yellow default
+color quoted3 red default
+color quoted4 brightcyan default
+color quoted5 brightgreen default
+color quoted6 brightyellow default
+color quoted7 brightred default
@@ -3,9 +3,6 @@
# Null out any folder specific keys.
bind index @ noop
-# Set default signature
-#set signature=~/.signature
-
set pager_stop # Don't skip msgs on next page.
set pager_context = 1
set pager_index_lines = 10 # when in pager mode, show a miniindex
@@ -11,14 +11,10 @@ set smtp_url="smtp://linsong.qizi@gmail.com@smtp.gmail.com"
set mbox_type=Maildir
set folder=$HOME/Mail/gmail
-
-source $HOME/.mutt/muttrc.mailboxes
-
-#set imap_keepalive = 300
-#set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
-#set postponed="+[Gmail]/Drafts"
-#set record="+[Gmail]/Sent Mail"
+set postponed="+[Gmail].Drafts"
+#set record="+[Gmail].Sent Mail"
-set mbox = "+mbox"
+source $HOME/.mutt/muttrc.mailboxes
+set quit
View
@@ -2,42 +2,16 @@
#
# Fine tune mutt depending on aspects of a message.
#
-
+# hooks defined here will be triggered when reading email, look send-hooks for
+# hooks happening during composing email
+#
# By default, don't do anything clever.
message-hook . "unset display_filter"
-# default from address is my gmail address
-message-hook . "my_hdr From: Vincent Wang <linsong.qizi@gmail.com>"
-message-hook . "set from = linsong.qizi@gmail.com"
-
# Sort out silly characters from Microsoft MUAs or MUAs that suffer the same
# problems.
message-hook "~h \"X-Mailer: (Microsoft Outlook IMO|Experian ContactMail)\"" "set display_filter='tr \\\\200\\\\202\\\\221\\\\222\\\\223\\\\224\\\\225\\\\226\\\\227 \\\\244\\\\054\\\\140\\\\047\\\\042\\\\042\\\\052\\\\055\\\\055'"
# IncrediMail, whatever the hell that is, sends out its text alternative as
# DOS formatted text. Clean things up.
message-hook "~h \"X-Mailer: IncrediMail" "set display_filter='tr -d \\\\r'"
-
-#message-hook "(~x exoweb\.net | ~h \"^In-[Rr]eply-[Tt]o: .*exoweb\.net\")" "my_hdr From: Vincent Wang <vincent@exoweb.net>"
-#message-hook "(~x exoweb\.net | ~h \"^In-[Rr]eply-[Tt]o: .*exoweb\.net\")" "set from = vincent@exoweb.net"
-#message-hook "(~x nordicbet\.com | ~h \"^In-[Rr]eply-[Tt]o: .*nordicbet\.com\")" "my_hdr From: Vincent Wang <vincent@exoweb.net>"
-#message-hook "(~x nordicbet\.com | ~h \"^In-[Rr]eply-[Tt]o: .*nordicbet\.com\")" "set from = vincent@exoweb.net"
-#
-#message-hook "~f exoweb\.net" "set from='Vincent Wang <vincent@exoweb.net>'"
-#message-hook "~f nordicbet\.com" "set from='Vincent Wang <vincent@exoweb.net>'"
-message-hook "~f qnite\.com" "set from='Vincent Wang <vincent@qnite.com>'"
-
-message-hook "~L vincent@linsong\.org" "my_hdr From: Vincent Wang <vincent@linsong.org>"
-message-hook "~L vincent@linsong\.org" "set from = vincent@linsong.org"
-
-message-hook "~L wangwei@linsong\.org" "my_hdr From: Wang Wei <wangwei@linsong.org>"
-message-hook "~L wangwei@linsong\.org" "set from = wangwei@linsong.org"
-
-message-hook "~L vincent@qnite\.com" "my_hdr From: Vincent Wang <vincent@qnite.com>"
-message-hook "~L vincent@qnite\.com" "set from = vincent@qnite.com"
-# message-hook "~h \"^X-Forwarded-For: vincent@linsong\.org\"" "my_hdr From: vincent@linsong.org"
-
-message-hook "~f seravia\.com" "set from='Vincent Wang <vincent@seravia.com>'"
-message-hook "~f seravia\.com" "my_hdr From: Vincent Wang <vincent@seravia.com>"
-message-hook "~L vincent@seravia\.com" "my_hdr From: Vincent Wang <vincent@seravia.com>"
-message-hook "~L vincent@seravia\.com" "set from = vincent@seravia.com"
View
@@ -113,6 +113,7 @@ source ~/.mutt/save-hooks # Define save-hooks.
source ~/.mutt/folder-hooks # Define folder-hooks.
source ~/.mutt/fcc-hooks # Define fcc-hooks.
source ~/.mutt/message-hooks # Define message hooks.
+source ~/.mutt/send-hooks # Define send hooks.
source ~/.mutt/scores # Define score rules
#
View
@@ -0,0 +1,17 @@
+# vim: set ft=muttrc
+#
+# hooks defined here will be triggered when composing email
+
+send-hook . "set signature='fortune ~/.signatures/general|'"
+
+send-hook "~t @seravia\.com|~f @seravia.com|~L vincent@seravia\.com" "my_hdr From: Vincent Wang <vincent@seravia.com> ; set signature=~/.signatures/seravia"
+
+send-hook "~L linsong.qizi@gmail\.org" "my_hdr From: Vincent Wang <linsong.qizi@gmail.com>"
+send-hook "~L vincent@linsong\.org" "my_hdr From: Vincent Wang <vincent@linsong.org>"
+send-hook "~L wangwei@linsong\.org" "my_hdr From: Wang Wei <wangwei@linsong.org>"
+
+#send-hook "(~x exoweb\.net | ~h \"^In-[Rr]eply-[Tt]o: .*exoweb\.net\")" "my_hdr From: Vincent Wang <vincent@exoweb.net>"
+#send-hook "(~x nordicbet\.com | ~h \"^In-[Rr]eply-[Tt]o: .*nordicbet\.com\")" "my_hdr From: Vincent Wang <vincent@exoweb.net>"
+#send-hook "~f exoweb\.net|~f nordicbet\.com" "set from='Vincent Wang <vincent@exoweb.net>'"
+
+#send-hook "~f qnite\.com|~L vincent@qnite\.com" "my_hdr From: Vincent Wang <vincent@qnite.com>"
View
@@ -66,8 +66,8 @@ maxsyncaccounts = 1
#
# You can override this with a command-line option -u.
-ui = Curses.Blinkenlights, TTY.TTYUI,
- Noninteractive.Basic, Noninteractive.Quiet
+#ui = Curses.Blinkenlights, TTY.TTYUI, Noninteractive.Basic, Noninteractive.Quiet
+ui = TTY.TTYUI, Noninteractive.Basic, Noninteractive.Quiet
# If you try to synchronize messages to a read-only folder,
# OfflineIMAP will generate a warning. If you want to suppress these
@@ -101,7 +101,6 @@ ignore-readonly = no
# The default is to have no timeout beyond the OS. Times are given in seconds.
#
# socktimeout = 60
-socktimeout = 30
# By default, OfflineIMAP will use fsync() to force data out to disk at
# opportune times to ensure consistency. This can, however, reduce
@@ -470,5 +469,5 @@ maxconnections = 1
holdconnectionopen = yes
keepalive = 60
-folderfilter = lambda foldername: foldername in ['INBOX', '[Gmail]/Sent Mail', '[Gmail]/Drafts', '[Gmail]/Starred', 'Seravia', 'GitNotification', '[list]tmux']
+folderfilter = lambda foldername: foldername in ['INBOX', '[Gmail]/Sent Mail', '[Gmail]/Drafts', '[Gmail]/Starred', 'Seravia', 'GitNotification', '[list]tmux', '[list]TopLanguage', '[list]mutt']
View
@@ -0,0 +1,11 @@
+"The tool that save the most labor in a programming project is probably a text-editing system" -- <<The Mythical Man-Month>>
+
+http://blog.linsong.org
+%
+"There are very few problems in Computer Science that cannot be solved with an additional level of indirection."
+
+http://blog.linsong.org
+%
+Make life easier ...
+
+http://blog.linsong.org
@@ -0,0 +1,4 @@
+1. sentences sperated by '%' single line in file foo
+2. run command: strfile foo
+3. fortune /path/to/foo
+
View
Binary file not shown.
@@ -3,7 +3,7 @@
new-session -d -swork -n music
#rename-window -t 0 musiC
send -t work:0 'cd ~/Music'
-send -t work:0 'ncmpc'
+send -t work:0 'ncmpcpp'
new-window -d -n mutt
send -t work:1 'mutt'

0 comments on commit ba6b97c

Please sign in to comment.