在测试新服务器期间,我需要测试 fetchmail 功能,但我无法让它按照我期望的方式工作。如何将获取的电子邮件发送到指定文件或标准输出?
我/etc/fetchmailrc
看起来像这样:
set syslog
set daemon 10
# TEST
poll mail.example.com proto imap
user "ulf" password "testpassword" idle
ssl
folder "INBOX/test_2016-10-24"
keep
mda "tee /tmp/fetch_test"
然后我像这样运行 fetchmail:
$ sudo fetchmail -vk -f /etc/fetchmailrc
或(如建议here):
$ sudo fetchmail -vk -m cat -f /etc/fetchmailrc
我也试过这个(将检索到的电子邮件写入文件)但没有成功。
/var/log/syslog
指定文件夹中有一封邮件,当我运行上面的任何命令时,会在它停止之前生成大量数据。最后 3 行表示找到了一条消息,但是呢?
...
Oct 25 15:16:25 example fetchmail[7271]: 1 message (1 seen) for ulf at mail.example.com (folder INBOX/test_2016-10-24).
Oct 25 15:16:25 example fetchmail[7271]: IMAP> A0005 IDLE
Oct 25 15:16:25 example fetchmail[7271]: IMAP< + idling