版權聲明:轉載時(shí)請以超鏈接形式標明文章原始出處和作者信息及本聲明
http://bb2hh.blogbus.com/logs/36283857.html
1.getmail配置:
本人收取2個(gè)郵箱的,下面是126的配置:
[retriever]
type = SimplePOP3Retriever
server = pop.126.com
username = ×××××××@126.com
password = ××××××××××××××
[destination]
type = Maildir
path = ~/.Mail/inbox/
[options]
verbose = 0
delete = false
message_log = ~/.getmail/getmail.log
gmail的設置如下:
[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
getmail的腳本:
#!/bin/bash
getmail -v -n -r ~/.getmail/getmailrc.gmail -r ~/.getmail/getmailrc.126
定時(shí)收取 :crontab -e
*/5 * * * * ~/.getmail/getmail
2.muttrc配置:
set signature = "~/.Mail/signature|"
set editor = "abiword"
set folder = "~/.Mail/"
set mbox = "~/.Mail/inbox/"
set mbox_type = maildir
set spoolfile = "~/.Mail/inbox/"
set postponed = "~/.Mail/postponed"
set record = "~/.Mail/sent"
#增加垃圾箱,雖然不是很完善
folder-hook . 'macro index d "s$folder/trash\r"'
folder-hook $folder/trash 'bind index d delete-message'
## 我自己的郵箱
#mailboxes "+incoming"
#mailboxes "+outgoing"
#mailboxes "+company"
#mailboxes "+personal"
#mailboxes "+debian"
# 終端的編碼
set charset="UTF-8"
# 外發(fā)郵件使用的編碼
set send_charset="UTF-8"
# 用中文格式顯示日期
set locale=`echo "${LC_ALL:-${LC_TIME:-${LANG}}}"`
# 解決沒(méi)有設置字符編碼的信件顯示為亂碼的問(wèn)題
charset-hook ^us-ascii$ GB2312
# 解決主題為UTF-8的信件標題顯示為亂碼的問(wèn)題
charset-hook !UTF-8 GB2312
# 解決未經(jīng)過(guò)MIME編碼的信件顯示為亂碼的問(wèn)題
#set strict_mime=no
set assumed_charset="GB2312"
# 解決中文附件名為亂碼的問(wèn)題
set rfc2047_parameters=yes
# 回信時(shí)自動(dòng)包含原文
set include
# 回信引文之前的符號
set indent_str="> "
# 回信引文不用包含原文的信頭
set header=no
# 讓mutt可以更好的閱讀html郵件
auto_view text/html
#view word
auto_view application/msword
# 讓mutt識別不同的郵件特征
# " "(空): 表示這封郵件的 To: 和 Cc: Bcc: 都沒(méi)有你的地址,很多垃圾郵件都有這個(gè)特征。
# +: 表示你是收件人(To: 是你的地址之一),而且是唯一的收件人。
# T: 表示你是收件人(To: 包括了你的地址之一),但是你不是唯一的收件人。這是一封群體信件。
# C: 表示你的地址出現在 CC:,但是你不是唯一的被抄送的人。
# F: 表示這封郵件是你發(fā)出去的。
# L: 表示這是一封你已經(jīng)加入的郵件列表寄來(lái)的。
# mutt用純ascii表示樹(shù)狀列表
set ascii_chars=yes
# 禁止PAGE鍵切換到下一封信件
set pager_stop
# 快速回復,不用確認回復地址和主題
set fast_reply
# 退出時(shí)不在提示把信件從spool移動(dòng)到的mbox文件
set move=no
# 避免整頁(yè)整頁(yè)的翻,我們要一行一行的翻
set menu_scroll
# 設置要顯示的郵件頭及其顯示順序
ignore *
unignore From:
unignore To:
unignore Reply-To:
unignore Date:
unignore CC:
unignore BCC:
#unignore X-Label:
#unignore Organization:
#hdr_order Subject: To: CC: BCC: From: Date: Reply-To: X-Label: Organization:
hdr_order Subject: To: CC: BCC: From: Date: Reply-To:
# 在mutt提示To:時(shí),按tab顯示通訊錄
#source ~/.abc.alias
# 在mutt按a,把發(fā)件人添加到通訊錄
#set alias_file=~/.abc.alias
set index_format="%Z %?M?%-22.22n (%M)&%-26.26n? %?y?[%Y] %s&%s? %> %?X?/& ? %{%b%d}"
# 實(shí)現從多個(gè)賬戶(hù)發(fā)送信件
set use_from=yes
# 此選項確保從真正的郵送域發(fā)送信件
set envelope_from=yes
# 默認使用的的郵送域
my_hdr From: python_wang<pythonlong@gmail.com>
my_hdr Reply-To: python_wang<pythonlong@gmail.com>
#show index of messages while in pager
set pager_index_lines=6
#put status bar on top instead of bottom
set status_on_top
#treat all unread messages as new
set mark_old=no
#default subject when forwarding
set forward_format="Fwd: %s"
#don't confirm when appending messages to a mailbox
set confirmappend=no
#don't collapse threads w/ unread messages
set collapse_unread=no
# 將郵件正文解碼再搜索
set thorough_search=yes
#快捷鍵,
#key binding getmail
macro index g "!~/.getmail/getmail\n" "Invoke getmail"
macro pager g "!~/.getmail/getmail\n" "Invoke getmail"
#enter mailbox
#macro index A "c=archive\r"
#macro pager A "c=archive\r"
#macro index I "c!\n" "Go to Inbox"
#macro pager I "c!\n" "Go to Inbox"
#macro index F "c=favorites\r"
#macro pager F "c=favorites\r"
#macro index J "c=junkmail\r"
#macro pager J "c=junkmail\r"
# 采用msmtp發(fā)送郵件
set sendmail="/usr/bin/msmtp"
3.msmtp發(fā)送配置:
只用gmail發(fā)送:
defaults
tls on
logfile ~/.Mail/msmtp.log
# gmail.com mail service
# 設置用gmail的smtp服務(wù)發(fā)信
account gmail
host smtp.gmail.com
from ××××××××@gmail.com
auth on
user ×××××××@gmail.com
password ××××××××××××
port 587
auth on
tls_certcheck off
# Set a default account
account default : gmail
4.mailcap配置,可以在mutt種查看html,圖片和word
defaults
tls on
logfile ~/.Mail/msmtp.log
# gmail.com mail service
# 設置用gmail的smtp服務(wù)發(fā)信
account gmail
host smtp.gmail.com
from ××××××××××@gmail.com
auth on
user ××××××××××××@gmail.com
password
port 587
auth on
tls_certcheck off
# Set a default account
account default : gmail
這里用到了w3m-img腳本
#!/bin/sh
echo \<img src="\"$1\"" \\\> > ${1}.html
w3m ${1}.html
rm ${1}.html
聯(lián)系客服