我正在尝试设置 fetchmail 以使用 pop3 从 gmail 下载一些邮件。如您所见,问题在于 fetchmail 而不是使用 pop 协议将使用 imap。
为了确保在配置过程中不犯任何错误,我将总结该过程:
我在 /etc/default 文件夹中编辑了名为“fetchmail”的文件,并将变量 demo 设置为“yes”;
现在我在文件夹 /etc 中创建了配置文件“fetchmailrc”。在这篇文章中,我写道:
set postmaster "root" set daemon 600 poll pop.gmail.com with proto POP3 user '[email protected]' there with password 'secretPWD' is root here options ssl
然后我继续进行测试,看看它是否使用命令:“fetchmail -d0 -vk pop.gmail.com”。该命令的响应如下:
fetchmail: 6.4.2 querying pop.gmail.com (protocol auto) at Mon Jul 12 12:43:41 2021: poll started fetchmail: 6.4.2 querying pop.gmail.com (protocol IMAP) at Mon Jul 12 12:43:41 2021: poll started Trying to connect to 173.194.69.109/143...connection failed. fetchmail: connection to pop.gmail.com:imap [173.194.69.109/143] failed: Connection timed out. Trying to connect to 173.194.69.108/143...connection failed. fetchmail: connection to pop.gmail.com:imap [173.194.69.108/143] failed: Connection timed out. Trying to connect to 2a00:1450:4013:c00::6c/143...connection failed. fetchmail: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6c/143] failed: Network is unreachable. Trying to connect to 2a00:1450:4013:c00::6d/143...connection failed. fetchmail: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6d/143] failed: Network is unreachable. fetchmail: Connection errors for this poll: name 0: connection to pop.gmail.com:imap [173.194.69.109/143] failed: Connection timed out. name 1: connection to pop.gmail.com:imap [173.194.69.108/143] failed: Connection timed out. name 2: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6c/143] failed: Network is unreachable. name 3: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6d/143] failed: Network is unreachable. IMAP connection to pop.gmail.com failed: Network is unreachable fetchmail: 6.4.2 querying pop.gmail.com (protocol IMAP) at Mon Jul 12 12:48:02 2021: poll completed fetchmail: 6.4.2 querying pop.gmail.com (protocol auto) at Mon Jul 12 12:48:02 2021: poll completed fetchmail: Query status=2 (SOCKET) fetchmail: normal termination, status 2
我可以假设,fetchmail 试图强制 imap 协议而不是 pop。我完全不明白为什么要这样做。
也许我的低意识让我错过了一些东西。现在我正在开发最新版本的 Ubuntu 服务器。非常感谢您的关注,我很抱歉我的英语不好。
PS我知道不鼓励使用root帐户,但现在我只做一些尝试。当我了解如何配置 fetchmail 后,下一步是使用 postfix、dovecot 和 fetchmail 设置一个完整的邮件服务器。另外,我已经知道 getmail 的存在以及他非常简单的设置。但现在我想了解这个错误的原因。
当您从命令行运行 fetchmail 时,默认情况下它将使用该
/.fetchmailrc
文件而不是其他任何东西。要手动测试文件夹 /etc 中的配置文件“fetchmailrc”,您需要使用
-f <pathname>
or--fetchmailrc <pathname>
选项。换句话说,用