mutt + msmtp发送邮件 配置

2009-10-06 11:38
今天又整了一次mutt 配置文件是同学给的 环境ubuntu 9.04
sudo apt-get install mutt msmtp
然后配置 在主目录下
mkdir Mail
touch .msmtp.log
进入Mail目录
cd Mail
touch sent default index send postponed
mkdir inbox
-------------- 这是在主目录下
(((.msmtprc的配置)))
defaults
tls on
logfile ~/.msmtp.log
account gmail
host smtp.gmail.com
from tonghuasanren@gmail.com
port 587
user tonghuasanren@gmail.com
password 你的密码
auth on
tls_certcheck off
account default:gmail

(((.muttrc配置)))
# 默认信箱目录
set folder="~/Mail"
# 已读的信箱
set mbox="~/Mail/inbox"
# 进入mutt后默认使用的信箱,可以考虑和$HOME/.procmailrc设置的默认信箱相同
set spoolfile="~/Mail/inbox"
# 不清楚
#set postponed="~/Mail/postponed"
# 已发送的信箱
set record="~/Mail/sent"

set envelope_from = yes
my_hdr Reply-To:tonghua<tonghuasanren@gmail.com>
set use_from=yes
set from="tonghuasanren@gmail.com"
my_hdr From:tonghua<tonghuasanren@gmail.com>
set realname="tonghua"
set editor=vim
set sort=threads

mailboxes = "inbox"

set check_new = yes
set timeout = 300

# 终端的编码
set charset="UTF-8"
# 外发邮件使用的编码
set send_charset="UTF-8"
# 用中文格式显示日期
set locale="zh_CN.UTF-8"
# 解决没有设置字符编码的信件显示为乱码的问题
charset-hook ^us-ascii$ gb2312
# 解决主题为utf-7的信件标题显示为乱码的问题
charset-hook !UTF-8 gb2312
# 解决未经过MIME编码的信件显示为乱码的问题
#set strict_mime=no
set assumed_charset="gb2312"
# 解决中文附件名为乱码的问题
set rfc2047_parameters=yes

# Color
color hdrdefault black        cyan
color quoted     red          white
color signature  brightblack  white
color indicator  brightwhite  magenta
color attachment black        green
color error      red          white
color message    blue         white
color search     brightwhite  magenta
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

auto_view text/html

#新闻组
#subscribe xiyoulinux@googlegroups.com #xiyousource@googlegroups.com
#地址薄:
#source ~/.muttrc.a
# 采用msmtp发送邮件
set sendmail="/usr/bin/msmtp"
# 让mutt可以更好的阅读html邮件
auto_view text/html
#set signature="~/.mutt_sig"
# 用快捷键G来调用getmial收取邮件
macro index G "!/usr/bin/getmail"
#set sig_on_top=YES
(((.procmail配置)))
PATH=/bin:/sbin:/usr/bin:/usr/sbin
SHELL=/bin/bash
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/inbox
:0
* ^From.*@gmail.com
Gmail
:0 #最后的这个配置就是指如果上面分类剩下的信件全扔到inbox里
* .* inbox

# 黑名单(垃圾邮件)
:0:
* ^From.*badguy
/dev/null
# 分拣日志保存的位置
LOGFILE=”/var/log/procmail.log”
# 邮件转换程序
#FORMAIL=/usr/bin/formail
# 暂时未作任何分拣
# 所有经过分拣后的邮件都存储在$MAILDIR/default信箱中
#:0
#* .*
#default

(((.getmailrc配置)))
[retriever]
type = SimplePOP3SSLRetriever
server = 209.85.199.109
#server = pop.gmail.com
port = 995
username = tonghuasanren@gmail.com
password = #######
[destination]
type = Maildir
path = ~/Mail/inbox/

[options]
verbose = 0
delete = true
最重要的一点就是 把Mail/sent这个文件的权限改为600 chmod 600 sent 这样就ok了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值