Chinaunix首页 | 论坛 | 博客
  • 博客访问: 219997
  • 博文数量: 19
  • 博客积分: 757
  • 博客等级: 军士长
  • 技术积分: 320
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-08 07:55
个人简介

醉卧沙场君莫笑

文章分类

全部博文(19)

文章存档

2016年(5)

2015年(2)

2014年(3)

2013年(1)

2012年(5)

2011年(3)

分类: Python/Ruby

2012-11-29 21:37:41

从开始学习mutt后就爱上了mutt。可惜mutt一套操作和其他软件不太一样。我这样的懒人也不愿意去重新记忆一套快捷键了。幸好mutt的bind功能非常强大。通过更改~/.muttrc可以让mutt像vim一样好操作。
以下是我的muttrc:

点击(此处)折叠或打开

  1. #======================================================#
  2. # Boring details
  3. set realname = "x"
  4. set from = "xx@gmail.com"
  5. set use_from = yes
  6. set envelope_from ="yes"
  7. # Use a signature
  8. set signature="~/.signature"
  9. # Use msmtp rather than sendmail. Check that
  10. # the path is correct for your system:
  11. set sendmail="/usr/bin/msmtp"
  12. # If not set in ~/.bashrc:
  13. set spoolfile = /usr/Mail/mbox
  14. #======================================================#
  15. # Folders
  16. set folder="/usr/Mail/" # Local mailboxes stored here
  17. set record="+sent" # Where to store sent messages
  18. set postponed="+postponed" # Where to store draft messages
  19. set mbox_type=mbox # Mailbox type
  20. set move=no # Don't move mail from spool
  21. #======================================================#
  22. # Watch these mailboxes for new mail, useful only if
  23. # Procmail or Maildrop is used to sort mail.
  24. mailboxes ! +slrn +fetchmail +mutt
  25. set sort_browser=alpha # Sort mailboxes by alpha(bet)
  26. #======================================================#
  27. # What to show and order of headers
  28. ignore *
  29. unignore Date: From: User-Agent: X-Mailer X-Operating-System To: \
  30. Cc: Reply-To: Subject: Mail-Followup-To:
  31. hdr_order Date: From: User-Agent: X-Mailer X-Operating-System To: \
  32. Cc: Reply-To: Subject: Mail-Followup-To:
  33. #======================================================#
  34. # which editor do you want to use?
  35. # vim of course!
  36. set editor="vim -c 'set tw=70 et' '+/^$' "
  37. set edit_headers=yes # See the headers when editing
  38. #======================================================#
  39. # Aliases
  40. set alias_file = ~/mutt/mutt_aliases # In their own file
  41. source ~/mutt/mutt_aliases # Source them
  42. set sort_alias=alias # Sort alphabetically
  43. #======================================================#
  44. # Colours: defaults are a little bleak so experiment!
  45. source ~/mutt/mutt_colors # In their own file
  46. #======================================================#
  47. # Lists: An example using the mutt-users list:
  48. lists mutt-users
  49. subscribe mutt-users
  50. set followup_to=yes # Sets 'Mail-Followup-To' header
  51. set honor_followup_to=yes
  52. fcc-hook mutt-user +mutt # See your own posts using fcc
  53. #======================================================#
  54. # Odds and ends
  55. set markers # mark wrapped lines of text in the pager with a +
  56. set smart_wrap # Don't wrap mid-word
  57. set pager_context=5 # Retain 5 lines of previous page when scrolling.
  58. set status_on_top # Status bar on top.
  59. push # Shows mutt version at startup
  60. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  61. #
  62. # Identify mailing lists I subscribe to
  63. #
  64. # lists [ ... ]
  65. subscribe linux-kernel@vger.kernel.org
  66. bind pager G bottom
  67. bind pager j next-line
  68. bind pager next-line
  69. bind pager k previous-line
  70. bind pager previous-line
  71. bind pager \cf next-page
  72. bind pager \cb previous-page
  73. bind pager \cj next-entry
  74. bind pager \ck previous-entry
  75. bind pager gg top
  76. bind pager G bottom
  77. bind index gg first-entry
  78. bind index G last-entry
  79. bind index R group-reply
  80. bind index \cf next-page
  81. bind index \cb previous-page
  82. bind index } bottom-page
  83. bind index f change-folder
  84. set charset="utf8"
  85. set send_charset="gb2312:us-ascii:iso-8859-1:utf8"
  86. charset-hook !utf-8 gb2312
  87. set pager_index_lines=4
mutt靠procmail来给邮件归类,以下是我对邮件列表的一些设置:
~/.procmailrc

点击(此处)折叠或打开

  1. PATH=/bin:/usr/bin:/usr/local/bin
  2. VERBOSE=off
  3. DEFAULT=/usr/Mail/mbox
  4. MAILDIR=/usr/Mail
  5. LOGFILE=$HOME/.procmaillog
  6. # Recipes below this comment:
  7. :0
  8. * ^To:.*linux-fsdevel@vger.kernel.org
  9. linux-fsdevel
  10. :0
  11. * ^Mailing-List:.*linux-ext4@vger.kernel.org
  12. linux-fsdevel
  13. :0
  14. * ^Mailing-List:.*linux-btrfs@vger.kernel.org
  15. linux-fsdevel
  16. :0
  17. * ^X-Mailing-List:.*linux-kernel@vger.kernel.org
  18. linux-kernel
  19. :0
  20. * ^To:.*qemu-devel@nongnu.org
  21. qemu-devel
  22. :0
比较纠结的是fetchmail,我看有些人fetchmail设置成五分钟一次,我等不及。我设置的是10秒钟察看一次邮箱:
~/.fetchmailrc

点击(此处)折叠或打开

  1. # Configuration created Fri Oct 19 11:57:01 2012 by fetchmailconf 1.57
  2. set syslog
  3. set postmaster "zh"
  4. set bouncemail
  5. set no spambounce
  6. set softbounce
  7. set properties ""
  8. set daemon 10
  9. set invisible
  10. poll pop.gmail.com with proto POP3
  11. user 'xx' there with password 'xxxx' is 'zh' here options no keep stripcr ssl sslcertck sslcertpath '/home/zh/.certs/'
  12. mda '/usr/bin/procmail -d %T'
发邮件通过msmtp:
~/.msmtprc:

点击(此处)折叠或打开

  1. # Set default values for all following accounts.
  2. defaults
  3. logfile ~/.msmtp.log
  4. # gmail
  5. account gmail
  6. protocol smtp
  7. host smtp.gmail.com
  8. from xx@gmail.com
  9. user xx@gmail.com
  10. password xxx
  11. port 587
  12. auth on
  13. tls on
  14. tls_trust_file /etc/ssl/certs/ca-certificates.crt
  15. syslog LOG_MAIL
  16. # Set a default account
  17. account default : gmail
  18. tls on
  19. tls_starttls on
  20. tls_trust_file /home/zh/.certs/Equifax_Secure_CA.pem
  21. auth on

阅读(3611) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~