- 配置msmtp
-
cd ~
vim .msmtprc
加入以下内容:
defaults
tls on
account gmail
host smtp.gmail.com
from 【邮箱账号】@gmail.com
auth on
user 【邮箱账号】@gmail.com
password 【邮箱密码】
port 587
account default : gmail
- 配置getmail
-
mkdir ~/.getmail
cd ~/.getmail
vim getmailrc
加入以下内容:
[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
port = 995
username = 【邮箱账号】@gmail.com
password = 【邮箱密码】
#
[destination]
type = Maildir
path = ~/Mail/inbox/
#
[options]
verbose = 0
delete = true
message_log = ~/.getmail/getmail.log
- 设置html邮件、doc附件的处理:
-
cd ~
vim .mailcap
加入以下内容:
application/msword; wvHtml --charset=gb2312 %s - | lynx --dump -stdin;nametemplate=%s.html; copiousoutput
text/html; lynx --dump %s; nametemplate=%s.html; copiousoutput
- 修改文件权限:
-
由于上面的几个配置文件中密码和用户名都是明码,如果被别人看到就完了,所以这里设置其权限为只有创建者本人可读写,其它人均不可读写:
cd ~
chmod 600 .muttrc
chmod 600 .msmtprc
cd .getmail
chmod 600 getmailrc
- 使用crontab定时自动收信(非必需,可选):
-
在终端机中输入:
crontab -e
每隔10分钟收一次信,只收未读的信件:
0,10,20,30,40,50 * * * * getmail -n
- mutt使用地址簿
-
用 alias 来实现一个地址簿。alias 命令的形式是这样的,举个例子:
alias ab Xx X <xxx@mail.ustc.edu.cn>
alias 是命令,ab 是别名,XxX <xxx@mail.ustc.edu.cn> 是一个标准 的 email 地址。这样,如果你在 index 里按 "m",在 To: 的提示下输入 "ab",就可 以发信给 XxX<xxx@mail.ustc.edu.cn>。
-
在 To: 的提示下按 Tab 就可以显示联系人列表,然后你可以移动光标选择联系人。
-
如果你有很多 alias 要写,最好把它们写到另外一个文件,比如叫 .mutt.alias. 然后 在 .muttrc 里加上:
source ~/.mutt.alias
在里面写诸如
alias music Music <music@ustc.edu.cn>
alias video 科大影视 <video@ustc.edu.cn>
.........
-
你还可以设置一个变量:
set alias_file=~/.mutt.alias
这样你在 index 里按 "a",就可以把来信人加入到这个 alias 文件了。
- 本文参考:
中国科技大学 李雪白 《配置mutt做邮件客户端》
清华大学 王垠 《Mutt email 程序使用入门》
