fetchmail

来自百合仙子's Wiki
跳转到导航 跳转到搜索

配置示例

poll pop.exmail.qq.com proto pop3 timeout 120 uidl
username "username" password "password"
keep fetchsizelimit 0 mda "procmail -f %T"

另一个多帐号的例子:

set daemon 300
set logfile ~/etc/log/fetchmail.log

defaults proto pop3 timeout 120 uidl
keep fetchsizelimit 0 mda "procmail -f %T"

poll pop.163.com interval 2
username "username" password "password"

poll pop.gmail.com
username "username" password "password"
ssl

poll pop.gmail.com interval 2016 # 7 days
username "username" password "password"
ssl

poll pop.qq.com interval 288 # one day
username "username" password "password"

poll pop.qq.com interval 2016 # 7 days
username "username" password "password"

其中, interval 指明每多少次 poll 才去收取此帐号的邮件。

退出状态

fetchmail 在收到邮件时才返回零,在没收到邮件时返回 1。因此,crontab 要这么写:

*/7 * * * * LANG=zh_CN.UTF-8 fetchmail > /dev/null; ret=$?; [ $ret -eq 1 ] || exit $ret

文件

~/.fetchmailrc
配置文件默认位置。要求权限为 700 或以下
~/.fetchids
已收取邮件 ID 列表

参见