我需要使用 fetchmail 从邮件帐户下载所有邮件。
当我尝试使用 POP3 时,我可以以这种格式正确下载所有邮件:
[root@srv root]# ls /home/mail_import/MAIL_USER/new/
1453828024.7837_0.srv
1453828029.7843_0.srv
但是pop3协议不允许选择文件夹,所以我需要使用IMAP。
使用 IMAP 时无法单独下载邮件。我试过了,我有一个包含所有邮件的文件。
例如:
[root@srv home]# stat /home/mail_import/MAIL_USER/teste
File: ‘/home/mail_import/MAIL_USER/teste’
[root@srv home]# head /home/mail_import/MAIL_USER/teste
From root@SRV Tue Jan 26 18:56:31 2016
Return-path: <root@SRV >
Envelope-to: MAIL_USER@SRV
Delivery-date: Wed, 02 Dec 2015 15:47:00 -0500
我需要使用 imap 将所有邮件下载到单独的文件中,例如 pop3。
我.fetchmailrc
的是:
set bouncemail
set no spambounce
set softbounce
set properties ""
defaults:
antispam -1
batchlimit 100
poll DOMAIN with proto IMAP
user 'USER' there with password 'PASS' is 'MAIL' here
options keep fetchall ssl mda "/usr/bin/procmail -f %F -d %T";
folder INBOX
我.procmailrc
的是:
MAILDIR=/home/mail_import/MAIL_ACCOUNT
DEFAULT=$MAILDIR/INBOX
LOGFILE=/var/log/procmail
LOCKFILE=$MAILDIR/.default.lock
VERBOSE=on
:0 fhw
|formail
#
## Any other rules the user wishes to either include with INCLUDERC,
## or hardcode into this file, would go here.
## --------------------------------------------------------------------------
## If we're here, the mail didn't match any other rules, so deliver normally.
:0:
$DEFAULT
## If that fails, report an error and throw the mail away.
EXITCODE=75
:0
/dev/null
有一些正确的选项可以分别使用 IMAP 和 POP3 下载电子邮件吗?