fetchmail+mutt+promail+msmtp 设…

来源:互联网 发布:全栈工程师用什么编程 编辑:程序博客网 时间:2024/05/22 03:42
Fetchmail:
Fetchmail用于将其它支持pop3的邮件服务器上取回邮件并保存到本地的spool中。它的配置文件为
~/.fetchmail,在配置好后,还需要在shell的启动脚本里写入启动fetchmail的指令。
.fetchmail文件的内容为:
=============================================================================
default
    mda"/usr/bin/procmail -d username" 
set daemon 60 #设置每过60秒取一次邮件
poll st.gsau.edu.cn #设置邮件服务器的地址
uidl #设置每次只取新邮件
protocol POP3 #取信协议为POP3
user "username" #用户名
password "password" #登陆口令
keep #取完邮件后保留邮件在服务器上。
ssl#对于启用了SSL加密的POP3服务器需要加入这条规则,比如GMAIL。
=============================================================================
.muttrc设置
set folder ="/home/gaoyang/Mail"
set mbox="+gaoyang"
my_hdr From:"gaoyang"<gao.yang@126.com>
my_hdr Reply-To:"gaoyang"<gao.yang@126.com>
set spoolfile="+gaoyang"
set sendmail = "/usr/local/bin/msmtp"
set envelope_from = yes
set charset = "gb2312"
set locale = "zh_CN"
set header = no
set hostname = slk.com
set quit = yes
set move = no
set ascii_chars = yes
set include = yes
set indent_str = " > "
set sort = reverse-date
set fast_reply = yes
set pager_stop = yes
set resolve = yes
auto_view text/html
source ~/aliases
set alias_file=~/aliases
set record="+sent-mail"
set send_charset="us-ascii:iso-8859-1:gb2312:utf-8"
set wait_key = yes
set edit_headers = no
set pager_index_lines = 4
set index_format = "%Z %2C |%{%b%d日} %-15.15L (%5lk) %s"

macro index G "!fetchmail"
color normal white default
color attachment black magenta
color signature brightred default
color status white blue
color tilde blue default
color tree brightmagenta default
color underline yellow default
color bold green default
color error red default
color indicator black white
color markers brightred default
color message white blue

color body cyan default "ftp://[^ ]*"
color body cyan default "www.[^ ]*"
color body brightgreen default"[[:alnum:]][-+.#_[:alnum:]]*@[-+.[:alnum:]]*[[:alnum:]]"
color body cyan default "<URL:[^ ]*>"
color body brightblue default"(^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$)"
color body brightblue default"(^|[[:space:]])_[^[:space:]]+_([[:space:]]|$)"
color body brightblue default"(^|[[:space:]])/[^[:space:]]+/([[:space:]]|$)"
color body yellow default "[;:]-[)/(|]"
color body yellow default "[8][-\^][)|]"
color body yellow default "[;:][)/(|]"
color body brightblue default"(http|https|rsync|ftp|news|telnet|finger|gopher)://[^ ]*"
color body brightblue default"<(http|https|rsync|ftp|news|telnet|finger|gopher)://[^]*>"

color header yellow default "^cc: "
color header red cyan "^X-Spam-Status:"
color header green default "^date: "
color header yellow default "^from "
color header cyan default "^from: "
color header yellow default "^newsgroups: "
color header yellow default "^reply-to: "
color header cyan default "^subject: "
color header green default "^to: "
color header yellow default "^x-mailer: "
color header yellow default "^message-id:"
color header yellow default "^Organization:"
color header yellow default "^Organisation:"
color header yellow default "^User-Agent:"
color header yellow default "^message-id: .*pine"

color quoted cyan default
color quoted1 yellow default
color quoted2 red default
color quoted3 green default
color quoted4 cyan default
color quoted5 yellow default
color quoted6 red default
color quoted7 green default

color index green default ~N
color index red default ~O
color index magenta default ~F
color index blue default ~T
color index yellow default ~D

folder-hook . "ignore *; unignore from to subject date X-MailerUser-Agent"
folder-hook sent.* "ignore *; unignore from to subject date"
hdr_order X-Mailer User-Agent date from to subject
我的procmail分拣信件设置

MAILDIR="/home/gaoyang/Mail/"
LOGFILE="/var/log/procmail.log"
FORMAIL="/usr/bin/formail"
:0
* .*
gaoyang

安装mamtp,配置好可以通过smtp身份验证,以下是配置:

.msmtprc


account 126com
host smtp.126.com
from *********@126.com
auth login
user *********
password *********
port 25
account default : 126com


原创粉丝点击