全部博文(78)
分类: LINUX
2008-01-08 11:39:40
$ mkdir ~/Mail5.设置getmail
$ cd ~/Mail
$ touch inbox
$ touch sent
$ touch postponed
2. 配置mutt (~/.muttrc)
#编辑器 直接在 Mutt 的终端里使用vim
set editor="vim"
#设置信箱
set folder="~/Mail"
set mbox="~/Mail/inbox"
set spoolfile="~/Mail/inbox"
set postponed="~/Mail/postponed"
set record="~/Mail/sent"
# 让mutt监视下面几个邮箱,并随时报告新邮件
mailboxes "=inbox"
...
set check_new = yes
set timeout = 600
#设置邮件发送程序
set sendmail="/usr/bin/msmtp"
set envelope_from=yes
set use_from=yes
set realname="XXX"
set from=XXX@gmail.com
#多帐号选择
macro generic "1" ":set from=XXX@gmail.com"
macro generic "2" ":set from=XXX@bupt.edu.cn"
macro generic "3" ":set from=XXX@sina.com"
#编码设置
set charset="utf8"
set send_charset="us-ascii:iso-8859-1:gb2312:utf-8"
charset-hook ^us-ascii$ utf-8
charset-hook ^iso-8859-1$ utf-8
charset-hook ^utf-8$ utf-8
charset-hook !gb2312 utf-8
set assumed_charset="gb2312:big5:utf-8"
#mutt直接查看html,word文档,需要设置.mailcap
auto_view text/html
auto_view text/html application/msword
3. 自动显示word文档的设置 (~/.mailcap)
ext/html ; w3m -T text/html -I %{charset} -dump %s ; \
nametemplate=%s.html ;copiousoutput
application/msword; wvHtml %s - | w3m -dump -T text/html;copiousoutput
application/octet-stream; wvHtml %s - |w3m -dump -T text/html ;copiousoutput
application/octet-stre; wvHtml %s - |w3m -dump -T text/html ;copiousoutput
4. msmtp的设置(~/.msmtprc)
#为了安全,.msmtprc权限不能过高
defaults
logfile ~/Mail/msmtp.log
account gmail
host smtp.gmail.com
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
port 587
from xxx@gmail.com
user xxx@gmail.com
password xxx
account sina
host smtp.sina.com
from xxx@sina.com
tls off
auth login
user xxx
password xxx
account default : gmail
[retriever]
type = SimplePOP3Retriever
server = pop3.sina.com
username = xxx@sina.com.cn
password = xxxxxx
[destination]
type = MDA_external
path = /usr/bin/procmail
unixfrom = true
#gmail.rc
[options]
verbose = 1
read_all = false
message_log = ~/.getmail/gmail.log
[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username = xxx@gmail.com
password = xxxxxx
[destination]
type = MDA_external
path = /usr/bin/procmail
unixfrom = true
6.设置procmail
#~/.procmailrc
PATH=/bin:/sbin:/usr/bin:/usr/sbin
SHELL=/bin/bash
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/inbox
LOGFILE=$MAILDIR/.procmaillog
#分类的例子,把来自gmail的信放到Gmail中
:0
* ^From.*@gmail.com
Gmail
:0 #最后的这个配置就是指如果上面分类剩下的信件全扔到inbox里
* .* inbox
# 黑名单(垃圾邮件)
# :0:
# * ^From.*badguy
# /dev/null
7.其他,暂时就这些吧
参考文章
mutt手册