Chinaunix首页 | 论坛 | 博客
  • 博客访问: 400280
  • 博文数量: 76
  • 博客积分: 3016
  • 博客等级: 中校
  • 技术积分: 782
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-27 12:05
文章分类

全部博文(76)

文章存档

2017年(1)

2015年(1)

2009年(2)

2008年(28)

2007年(44)

我的朋友

分类:

2007-04-28 10:02:06

今天我说一下,我是如何配置fetchmail 来收取gmail 邮件的。
首先,我花了几天的时间看了fetchmail 和procmail 等这些东西在/usr/share/doc 下的文档。同时大概看了一下fetchmail 的手册页。
配置如下,参考了example 文件:
# ~/.fetchmailrc for user-specific
# This file MUST be chmod 0600, owner fetchmail

# The default for this option is 300, which polls the server every 5 minutes.
#
# set daemon    1200
#
# By default, the fetchmail will output logging messages to
# syslog; uncomment the line below to disable this. This might be useful
# if you are logging to another file using the 'logfile' option.
#
# set no syslog
#
# Avoid loss on 4xx errors. On the other hand, 5xx errors get more
# dangerous.
#
 set no bouncemail
#
# Set postmaster to nico, so that I can receive mail under any conditions
# Even if destination of undeliverable mail or no matching local recipient
# mails
#
 set postmaster nico
#
# The following defaults are used when connecting to any server, and can
# be overridden in the server description below.
#
# Set antispam to -1, since it is far safer to use that together with no
# bouncemail.
#
#
defaults
    protocol pop3
    mda "formail -s procmail"
    antispam -1
    ssl sslcertck keep
        sslcertpath '/etc/ssl/certs/'
poll pop.gmail.com with uidl
       user 'mygmailaccount@gmail.com' there with password 'mypassword' is 'nico' here

说明:
1.文字中的反斜杠请在复制后手工删除,这是博客系统的问题。为防止安全问题,它自动对引号进行了转义。

按照fetchmail 手册页中的说法(我英文不是太好)
2. set ... 开头的是全局参数,如 bouncemail、postmaster等。这里我设置了postmaster 为nico
   ,这是我的Debian 系统上的一个用户名,请换成你自己的用户名。这样我就可以收到一些发信地址不可
   到达或者是本地没有相关匹配收件人的邮件。
3. 关键词defaults 等同于poll ,因此在defaults 后面跟着的第一行一定要是邮件服务器用的参数,如
   protocol、uidl、dns、no dns等。
4. 下面的poll 用来具体指定一个邮件服务器,完全可以把上面defaults 字段中的参数放到这里。但要小
   心,千万不要把服务器参数和用户参数混淆了。
5. defaults 字段中的protocol 是服务器参数,antispam、ssl、keep 是用户参数。mda 建议放在 
   defaults 字段。其它的关键词只要不跟在服务器或者用户帐号的后面,放哪里都行。
6. mda "formail -s procmail"来自于man procmail。请改成你自己的MDA客户端程序,并做相应配
   置。fetchmail 的手册页里不推荐procmail ,它推荐maildrop 作为客户端。但我用着没问题。个
   人看着办吧。想要这方面的详细信息,请man fetchmail
7. sslcertpath 中的内容请改成自己系统中的路径。如果没有请参照网上的方法做一下签名文件放好。
7. 暑假我会找时间翻译fetchmail、procmail、msmtp 的手册页的。
阅读(3232) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~