免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1941 | 回复: 1
打印 上一主题 下一主题

用mutt+getmail+msmtp收发gmail [复制链接]

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-28 04:24 |只看该作者 |倒序浏览
安装mutt,msmtp和getmail,我用的是Ubuntu dapper,repository中有,直接apt-get install就可以了。

网站分别为:

http://www.mutt.org/
http://msmtp.sourceforge.net/
http://pyropus.ca/software/getmail/

getmail是个类似于fetchmail的程序,为什么作者要写这个程序请参见:

http://pyropus.ca/software/getmail/faq.html#faq-about-why


1,建Mail目录

建一个~/Mail目录,然后:

  1. $ mkdir -m 700 ~/Mail/inbox/{,tmp,new,cur}
复制代码



2,配置getmail

建~/.getmail,在此目录下编辑getmailrc.gmail:


  1. [retriever]
  2. type = SimplePOP3SSLRetriever
  3. server = pop.gmail.com
  4. port = 995
  5. username = mail_add@gmail.com
  6. password = 1234567

  7. [destination]
  8. type = Maildir
  9. path = ~/Mail/inbox/

  10. [options]
  11. verbose = 0
  12. delete = true
  13. message_log = ~/.getmail/getmail.log
复制代码


3,配置~/.msmtprc

内容:

  1. account default
  2. tls on
  3. host smtp.gmail.com
  4. from mail_add@gmail.com
  5. user mail_add@gmail.com
  6. auth on
  7. port 587
  8. password 1234567
复制代码


3,在~/.muttrc中加入:

  1. set folder=~/Mail
  2. mailboxes +inbox
  3. set sendmail="/usr/bin/msmtp"
复制代码

原来的其他内容如果不和上面冲突就不用改变。



4,用cron或者其他你喜欢的类似程序指定运行getmail检查gmail的频率, getmail执行方式为:

  1. $ getmail -r ~/.getmail/getmailrc.gmail
复制代码




5,运行mutt查看信件

  1. $ mutt -y
复制代码

[ 本帖最后由 l4kernel 于 2006-6-28 21:40 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-06-28 14:38 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP