Mutt + MSMTP + getmail Configuration Memo

Source: Internet
Author: User
Tags date header mail account gmail

Set up a combination of Mutt + MSMTP + getmail to manage the mail and paste the configuration file here as a memo.

. muttrc

set locale = zh_CN.gbk
set charset = gbk
#设置邮件储存位置
set spoolfile = ~/spool/inbox
set mbox_type = Maildir
set folder = ~/Mail
set mbox = "+inbox"
set record = "+sent"
set postponed = "+outbox"
#用msmtp发送邮件
set sendmail = "/usr/local/bin/msmtp"
set use_from = yes
# 设置用gmail帐号发信
set from = xxxxxx@gmail.com
set envelope_from = yes
my_hdr From: xxxxxx<xxxxxx@gmail.com>
my_hdr Reply-To: xxxxxx<xxxxxxx@gmail.com>
ignore headers *
unignore headers from: to: subject date
#set hdr_order to from subject date
#设置快捷键G调用脚本 checkmail 检查新邮件
macro index G "!~/checkmail" "Checking mails......"
#处理html格式的邮件
auto_view text/html
#邮件头的颜色
color header brightred black ^from
color header brightblue black ^to
color header brightcyan black ^subject
color header brightgreen black ^date

. mailcap

#设置用w3m显示html格式邮件
text/html; w3m %s; nametemplate=%s.html
text/html; w3m -dump %s; nametemplate=%s.html; copiousoutput

. MSMTPRC

# Set default values for all following accounts.
defaults
tls on
logfile ~/.msmtp.log
# gmail.com mail service
# 设置用gmail的smtp服务发信
account gmail
host smtp.gmail.com
from xxxxxx@gmail.com
auth on
user xxxxxx@gmail.com
password xxxxxx
port 587
# Set a default account
account default : gmail

Checkmail script that collects messages with Getmail

#!/bin/bash
#[username]和[password]用真实的用户名和密码代替
echo -n "Checking "
echo -n "xxxxxx@21cn.com "
getmail_fetch -d -q pop.21cn.com [username] [password] ~/spool/inbox
echo -n "xxxxxx@tom.com "
getmail_fetch -d -q pop.tom.com [username] [password] ~/spool/inbox
echo -n "xxxxxx@163.com "
getmail_fetch -d -q pop.163.com [username] [password] ~/spool/inbox
echo -n "xxxxxx@gmail.com "
getmail_fetch -s -q pop.gmail.com [username] [password] ~/spool/inbox
echo "Done."


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.