Fetchmail 的简单使用

Fetchmail 的简单使用

我正在尝试使用 备份我的电子邮件收件箱Fetchmail。因此,在安装软件包后,我创建了一个.fetchmailrc

poll SERVER_ADDRESS with proto POP3 and options no dns
user 'MY_ADDRESS' there with password 'MY_PASSWORD' is 'MY_CURRENT_ACCOUNT_USERNAME' here options ssl

然后,我启动了Fetchmail

$> fetchmail -vk

并得到了一个很好的答案:

fetchmail: POP3> LIST 1
fetchmail: POP3< +OK 1 6533
fetchmail: POP3> RETR 1
fetchmail: POP3< +OK 6533 octets

问题是,Fetchmail需要 MTA 来完成电子邮件的获取:

fetchmail: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused.
fetchmail: SMTP connect to localhost failed
fetchmail: POP3> QUIT

因此我安装了Postfix。 并对其进行了配置,但现在,该过程在此之后冻结了:

Trying to connect to 127.0.0.1/25...connected.

以下是我的main.cf

myhostname = sultan
inet_protocols = all
biff = no
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
inet_interfaces = MY_IP 127.0.0.1 ::1
mydestination = $myhostname, localhost.$mydomain
defer_transports =
mynetworks = MY_IP
disable_dns_lookups = no
relayhost =
content_filter =
mailbox_command = /usr/bin/procmail
mailbox_transport =
strict_8bitmime = no
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/access,
                            permit_mynetworks,
                            reject_invalid_hostname,
                            reject_non_fqdn_hostname,
                            reject_non_fqdn_sender,
                            reject_unauth_pipelining,
                            reject_unknown_client,
                            reject_unknown_hostname,
                            reject_unknown_sender_domain
smtpd_client_restrictions =
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,
                          reject_unknown_client,
                          reject_invalid_hostname,
                          reject_unauth_pipelining,
                          reject_unknown_hostname,

任何想法?

谢谢。

答案1

这样做更容易获取邮件不需要 smtp 服务器等。

getmail 是一个邮件检索器,旨在允许您将邮件从各个邮件服务器上的一个或多个邮件帐户获取到本地机器上,以最少的麻烦进行阅读。getmail 的设计目标是安全、灵活、可靠且易于使用。getmail 旨在取代其他邮件检索器,例如 fetchmail。

http://pyropus.ca/software/getmail/

getmailrc 配置示例:

[retriever]
type = SimplePOP3SSLRetriever
server = pop3.example.com
username = account_name
password = my_mail_password

[destination]
type = Maildir
path = ~/Maildir/

相关内容