[~]$ vi ~/.getmail/getmailrc.nuoerlz.gmail
[retriever] // 设置为gmail的收件服务器 type = SimplePOP3SSLRetriever server = pop.gmail.com port = 995 username = [email protected] // 用户名 password = xxxxxxx // 用户密码 [destination] // 告诉getmail把收取下来的邮件如何储存等 type = Maildir // 以目录的形式储存 path = ~/.Mail/inbox/nuoerlz.gmail/ // 储存到的目录(若没有须手动创建) [options] // 一些选项 verbose = 0 // 调试时很有用 delete = false // 在邮箱服务端也保留一份 message_log = ~/.getmail/getmail.gmail.log // ... // End of getmailrc.nuoerlz.gmail
[~]$ vi ~/.muttrc
# user set realname = "erlz.nuo" # folder & spool set spoolfile = ~/.Mail/inbox/default/ # 启动mutt默认进入的邮箱 set folder = ~/.Mail # 信箱根目录 set tmpdir = ~/.mutt/tmp # set mbox_type = Maildir # 设置为目录存储方式 set mbox = +inbox # 设置mbox(~/.Mail/inbox) set record = +sent # 保存发送后的邮件(~/.Mail/sent) set postponed = +postponed # # 退出时不在提示把信件从spool移动到的mbox文件 set move = no # 当你按q退出时, 是否提示你(ask-yes,ask-no) set quit=ask-yes # 快捷键超时时间 set timeout = 600 # locale set charset = UTF-8 set locale = zh_CN.UTF-8 # hook charset charset-hook gb2312 gb2312 charset-hook GB2312 GB2312 charset-hook big5 big5 charset-hook !UTF-8 gbk charset-hook "^us-ascii$" "utf-8" # send charset set send_charset="us-ascii:iso-8859-1:utf-8:gbk" set rfc2047_parameters=yes #Flag # " "(空): 表示这封邮件不是给你的, 也就是说 To: 和 Cc: Bcc: 都没有你的地址, # 很多转发的邮件, 未确认的邮件列表邮件, 垃圾邮件都有这个特征. # +: 表示你是收件人(To: 是你的地址之一), 而且是唯一的收件人. # T: 表示你是收件人(To: 包括了你的地址之一), 但是你不是唯一的收件人. 这是一封群体信件. # C: 表示你的地址出现在 CC:, 但是你不是唯一的被抄送的人. # F: 表示这封邮件是你发出去的. # L: 表示这是一封你已经加入的邮件列表寄来的. set to_chars=" +TCFL" # 增加垃圾箱, 虽然不是很完善 folder-hook . 'macro index d "s$folder/trash\r"' folder-hook $folder/trash 'bind index d delete-message' # Set header ignore headers * unignore headers from: to: cc: subject date reply-to: # 回信引文不用包含原文的信头 set header=no # set index set index_format="%5C %Z %{%y年%b%d} %-20.20L (%?l?%4l&%4c?) %s" #score #score "~N" +4 #新信件 #score "~D" -5 #有删除标记 #score "~O" +1 #上次没有读 #score "~f huiqin" +2 #来自 xxxx #score "~s xxxx" + 3 #主题上有 xxxx #sort set sort = 'threads' # 当用 thread 排序方式时, 我们对各个 thread 的相对时间顺序. set sort_aux = 'reverse-last-date-received' # don't confirm when appending messages to a mailbox set confirmappend = no # 禁止PAGE键切换到下一封信件 set pager_stop = yes # 当行太长需要折行显示时, 按单词为边界折行, 而不是以屏幕边界为界限. set smart_wrap = yes # 当你在用 pager 看信件时, 在 index 留出多少行显示邮件列表? set pager_index_lines = 5 # message editor set editor = "vim" # 快速回复, 不用确认回复地址和主题 set fast_reply = yes # 是否把邮件头也放在编辑器里可以修改? set edit_headers = no # ext app to view attachment set mailcap_path="~/.mailcap" # 当外部程序退出时, 是否要求用户按一个键才返回 set wait_key=yes # alias set alias_file = ~/.mutt/.mutt.alias source ~/.mutt/.mutt.alias # Attachment set attach_format = "%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s]" set attach_sep = "\n" set attach_split = yes alternative_order text/enriched text/plain text application/postscript image/* # Colors #color obj front back #----- ------------ --------------- --------- #color hdrdefault black cyan # 邮件头颜色 #color quoted blue white # 引文颜色 #color signature brightblack white color indicator brightwhite magenta color attachment black green #color error red white #color message blue white color search black brightyellow color status brightyellow blue color tree red white #color normal blue white color tilde green white #color bold brightyellow white #color markers red white color index brightwhite red ~N color index red default ~O color index brightblack default ~D mono bold bold mono underline underline mono indicator reverse # 让mutt可以更好的阅读html邮件 auto_view text/html #view word auto_view application/msword # include original content when reply set include = yes # from set envelope_from = yes set encode_from = yes # send hook ##所有我可能会用到的邮箱 send-hook . 'set sendmail="/usr/local/msmtp/bin/msmtp"' alternates "[email protected]|[email protected]|[email protected]" set from="[email protected]" # 默认的发信人 set use_from=yes # mutt自动生成from地址 set reply_to=yes # 尽量使用原信中的reply-to, 对邮件列表尤其适用 set reverse_name=yes # 用哪个邮箱收的信, 就用哪个邮箱回信 # key binding macro index ,gp "c=postponed\r" macro index ,gp "c=postponed\r" macro index ,gs "c=sent\r" macro index ,gs "c=sent\r" macro index ,gr "c=trash\r" macro index ,gr "c=trash\r" macro index,pager ,G "!~/.getmail/getmail\n" "Invoke getmail" macro index,pager ,ebt ":set [email protected]\r:set edit_headers=yes\r:set realname=NuoErlz\r" macro index,pager ,ebn ":set [email protected]\r:set edit_headers=yes\r:set realname=erlz.nuo\r" macro index,pager ,ehd ":set edit_headers=yes\r" macro index,pager ,ehn ":set edit_headers=no\r" macro index,pager ,gdf "c=inbox/default\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gic "c=inbox/nuoerlz_gmail/list_cpp\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gid "c=inbox/nuoerlz_gmail/default\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gie "c=inbox/nuoerlz_gmail/list_eng\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gif "c=inbox/nuoerlz_gmail/list_fedora\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gig "c=inbox/nuoerlz_gmail/news_G2G\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gij "c=inbox/nuoerlz_gmail/list_joke\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gim "c=inbox/nuoerlz_gmail/list_vim\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gis "c=inbox/nuoerlz_gmail/list_shlug\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,giv "c=inbox/nuoerlz_gmail/list_devel\r:set [email protected]\r:set edit_headers=no\r:set realname=\"erlz.nuo\"\r" macro index,pager ,gld "c=inbox/lcy3636_126/default\r:set [email protected]\r:set edit_headers=no\r:set realname=NuoErlz\r" macro index,pager ,gtd "c=inbox/tge3636_126/default\r:set [email protected]\r:set edit_headers=no\r:set realname=NuoErlz\r" macro index,pager,generic ,sm ":source $HOME/.muttrc\r" macro index,pager,generic ,vm "!xterm -bg wheat -e gvim $HOME/.muttrc\r" ## 告诉 Mutt 你已经订阅了那些邮件列表(mailing-list). subscribe [email protected]|[email protected]|[email protected] // End of .muttrc
[~]$ vi ~/.procmailrc
############################################################ ############# Help ############# # # $ man procmailrc # ############# Help ############# PATH=/bin:/sbin:/usr/bin:/usr/sbin SHELL=/bin/bash MAILDIR=/home/scr/.Mail/inbox/ DEFAULT=$MAILDIR/default/ LOGFILE=$MAILDIR/.procmaillog #FORMAIL=/usr/bin/formail #VERBOSE=on # 只在调试时使用 ############################################################ ############# @126.com ############# :0 * ^(To|Cc):.*lcy3636@126\.com.* lcy3636_126/default/ :0 * ^(To|Cc):.*tge3636@126\.com.* tge3636_126/default/ :0 * .*lcy3636@126\.com.* lcy3636_126/default/ :0 * .*tge3636@126\.com.* tge3636_126/default/ ############################################################ ############# @gmail.com ############# :0 * ^(To|Cc):.*(english365)@googlegroups\.com.* nuoerlz_gmail/list_eng/ :0 * ^(To|Cc):.*shlug@googlegroups\.com.* nuoerlz_gmail/list_shlug/ :0 * ^From: .*(xxx |support@eoemobile\.net|sap@mailsap\.com|educationfirst@ef\.com).* /dev/null :0 * ^(To|Cc): .*(undisclosed-recipients:|undisclosed recipients:|minggong_jjz@hotmail\.com|\ unliste-recipients:).* /dev/null :0 * ^Subject:.*(credit|cash|money|debt|sex|sale|loan) /dev/null :0 * ^(To|Cc):.*(googlegroups\.com|mutt\.org|kernel\.org).* nuoerlz_gmail/list_devel/ :0 * .*nuoerlz@gmail\.com.* nuoerlz_gmail/default/ ############################################################ ############# default ############# # 最后一条规则: 将到达这的邮件送到默认邮箱 :0 * .* default/ // End of ~/.procmailrc
[~]$ vi ~/.getmail/getmailrc.nuoerlz.gmail
[retriever] // 设置为gmail的收件服务器 type = SimplePOP3SSLRetriever server = pop.gmail.com port = 995 username = [email protected] // 用户名 password = xxxxxxx // 用户密码 [destination] // 告诉getmail把收取下来的邮件如何储存等 type = MDA_external // 告诉getmail把收取下来的邮件交给外部程序处理 path = /usr/bin/procmail // 由 procmail 来处理 [options] // 一些选项 verbose = 0 // 调试时很有用 delete = false // 在邮箱服务端也保留一份 message_log = ~/.getmail/getmail.gmail.log // ... // End of getmailrc.nuoerlz.gmail
[~]$ vi ~/.msmtprc
#msmtp的配置: defaults tls on auth on tls_certcheck off logfile ~/.Mail/msmtp.log # Gmail service account nuoerlz host smtp.gmail.com from [email protected] port 587 user [email protected] password xxxxxxx # 126 service account tge3636 tls off auth plain host smtp.126.com from [email protected] user [email protected] password xxxxxxx # Set a default account account default : nuoerlz // End of ~/.msmtprc