mutt fetchmail msmtp 收发gmail

.fetchmailrc
------------------------------
set postmaster wizard
#set syslog
set daemon 30
set logfile /home/wizard/.fetchmail.log
poll pop.gmail.com with proto POP3 and options no dns
user " wizarddewhite@gmail.com" there with pass 'xxx' is 'wizard' here
options ssl keep
sslfingerprint '90:9A:84:92:E7:60:7C:A2:45: 73:C9:11:D7:FE:7D:8A'
sslcertck sslcertpath /etc/ssl/certs
mda "/usr/bin/procmail -d %T"

.procmailrc
----------------------------------
 # .procmailrc
# routes incoming mail to appropriate mailboxes
PATH=/usr/bin:/usr/local/bin
MAILDIR=/home/wizard/Mail # all mailboxes are in .mailspool/
DEFAULT=$HOME/Mail/inbox
LOGFILE=/dev/null
SHELL=/bin/sh

# Put mail from DC-Linux mailing list into mailbox dclinux
:0:
* ^(From|Cc|To).*shlug
shlug

# Put mail from DC-Linux mailing list into mailbox dclinux
:0:
* ^(From|Cc|To).*shyw13
shyw13


.msmtprc
------------------------------
--
defaults
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca- certificates.crt

account default
host smtp.gmail.com
port 587
auth on
user wizarddewhite@gmail.com
password xxx
from wizarddewhite@gmail.com


.muttrc 从
http://www.kreny.com/docs/mutt.htm摘来的。
------------------------------ -----
set sendmail = "/usr/bin/msmtp -v -X /home/wizard/log/msmtp.log"
#set the display index format
set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"
#set mail boxs, press "c" than "tab"
mailboxes Mailbox sent-mail
#when reply a mail, whether include the original header
set header=no
#when type 'q' to quit, whether ask you or not
#set quit=ask-yes
#which kind of file could be viewed directly via mailcap?
auto_view text/html
#whether move mail from spool to mbox
#set move=no
#when display by thread, whether use ascii?
set sort=threads
set sort_aux=date
set ascii_chars=yes
#when reply, whether include original mail
set include
#charachter inserted before reply message
set indent_str=">"
#when viewing mail, stop in current mail, not jump to next mail
set pager_stop
#when reply mail, go to edit window without interactive
#set fast_reply
#after setting flag, like 't','D', move curser to next mail
set resolve=yes
#when set alias by 'a', which file to save
set alias_file=/home/wizard/.mutt/alias
#where to save sent mail
#set record="~/Mail/=sent-mail-`date +%Y-%m`"
#set coding set for display
#set charset="gb2312"
#char set for sending mail
#set send_charset="us-ascii:iso-8859-1:gb2312:utf-8"
#prompt before external program exit
set wait_key=yes
#when move mail to another mail box which already exist, append or not
set noconfirmappend
#edit mail header or not?
set edit_headers=yes
#leave number of lines to show mail list in pager mode
set pager_index_lines=8

# the mail list you subscribed, press 'L' to reply to list
subscribe shlug@googlegroups.com

my_hdr From: Wizard<wizarddewhite@gmail.com>
my_hdr Reply-To: Wizard<wizarddewhite@gmail.com>


用了这么多年,今天来记录一下怎么翻墙使用。


1. 建立一个ssh的隧道

sudo ssh -L 995:pop.gmail.com:995 root@185.92.221.13


这样,访问本地的995端口就相当于访问了pop.gmail.com:995了。


2. 修改fetmail配置,从本地的995端口收邮件

#poll pop.gmail.com with proto POP3 and options no dns
poll 127.0.0.1 with proto POP3 and options no dns


PS: 不知道能不能在配置文件中改了端口号


3. 再建立一个隧道给smtp


sudo ssh -L 587:smtp.gmail.com:587 root@185.92.221.13


4. 添加/etc/hosts


127.0.0.1  smtp.gmail.com


为什么不直接在msmtp配置中都改了呢?因为msmtp的证书要认hostname。

这知道这个毛病能不能治。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值