Chinaunix

标题: 用mutt+getmail+msmtp收发gmail [打印本页]

作者: l4kernel    时间: 2006-06-28 04:24
标题: 用mutt+getmail+msmtp收发gmail
安装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 编辑 ]
作者: guixujun    时间: 2006-06-28 14:38
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2