删除 procmail 后,我正在寻找 fetchmail 存储消息的位置:
nicholas@mordor:~$
nicholas@mordor:~$ tail -f /var/log/fetchmail.log
fetchmail: IMAP< A0003 OK [READ-WRITE] INBOX selected. (Success)
fetchmail: IMAP> A0004 SEARCH UNSEEN UNDELETED
fetchmail: IMAP< * SEARCH
fetchmail: IMAP< A0004 OK SEARCH completed (Success)
fetchmail: 36 messages (36 seen) for [email protected] at imap.gmail.com.
fetchmail: IMAP> A0005 LOGOUT
fetchmail: IMAP< * BYE LOGOUT Requested
fetchmail: IMAP< A0005 OK 73 good day (Success)
fetchmail: 6.4.27 querying imap.gmail.com (protocol IMAP) at Sat 16 Dec 2023 10:31:13 AM: poll completed
fetchmail: sleeping at Sat 16 Dec 2023 10:31:13 AM for 600 seconds
fetchmail: awakened by signal 10
fetchmail: awakened at Sat 16 Dec 2023 10:31:35 AM
fetchmail: 6.4.27 querying imap.gmail.com (protocol IMAP) at Sat 16 Dec 2023 10:31:35 AM: poll started
fetchmail: Trying to connect to 172.253.117.108/993...connected.
fetchmail: Loaded OpenSSL library 0x30000020 newer than headers 0x30000010, trying to continue.
fetchmail: Server certificate:
fetchmail: Issuer Organization: Google Trust Services LLC
fetchmail: Issuer CommonName: GTS CA 1C3
fetchmail: Subject CommonName: imap.gmail.com
fetchmail: Subject Alternative Name: imap.gmail.com
fetchmail: imap.gmail.com key fingerprint: F2:9D:84:CE:C0:26:90:FF:CF:0D:0E:93:86:49:55:F6
fetchmail: SSL/TLS: using protocol TLSv1.3, cipher TLS_AES_256_GCM_SHA384, 256/256 secret/processed bits
fetchmail: IMAP< * OK Gimap ready for requests from 172.103.152.184 il18mb33861268pjb
fetchmail: IMAP> A0001 CAPABILITY
fetchmail: IMAP< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER
fetchmail: will idle after poll
fetchmail: IMAP< A0001 OK Thats all she wrote! il18mb33861268pjb
fetchmail: IMAP> A0002 LOGIN "[email protected]" *
fetchmail: IMAP< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
fetchmail: will idle after poll
fetchmail: IMAP< A0002 OK [email protected] authenticated (Success)
fetchmail: IMAP> A0003 SELECT "INBOX"
fetchmail: IMAP< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded $Junk $MDNSent $NotJunk $NotPhishing $Phishing $has_cal $label1 $label2 $label3 $label4 $label5 Junk NonJunk receipt-handled)
fetchmail: IMAP< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded $Junk $MDNSent $NotJunk $NotPhishing $Phishing $has_cal $label1 $label2 $label3 $label4 $label5 Junk NonJunk receipt-handled \*)] Flags permitted.
fetchmail: IMAP< * OK [UIDVALIDITY 2] UIDs valid.
fetchmail: IMAP< * 36 EXISTS
fetchmail: IMAP< * 0 RECENT
fetchmail: IMAP< * OK [UIDNEXT 23505] Predicted next UID.
fetchmail: IMAP< * OK [HIGHESTMODSEQ 16033009]
fetchmail: IMAP< A0003 OK [READ-WRITE] INBOX selected. (Success)
fetchmail: IMAP> A0004 SEARCH UNSEEN UNDELETED
fetchmail: IMAP< * SEARCH
fetchmail: IMAP< A0004 OK SEARCH completed (Success)
fetchmail: 36 messages (36 seen) for [email protected] at imap.gmail.com.
fetchmail: IMAP> A0005 LOGOUT
fetchmail: IMAP< * BYE LOGOUT Requested
fetchmail: IMAP< A0005 OK 73 good day (Success)
fetchmail: 6.4.27 querying imap.gmail.com (protocol IMAP) at Sat 16 Dec 2023 10:31:35 AM: poll completed
fetchmail: sleeping at Sat 16 Dec 2023 10:31:35 AM for 600 seconds
没有任何预期的结果:
nicholas@mordor:~$
nicholas@mordor:~$ ll /var/spool/mail/nicholas
-rw------- 1 nicholas mail 0 Nov 27 15:52 /var/spool/mail/nicholas
nicholas@mordor:~$
nicholas@mordor:~$ ll /var/mail/nicholas
-rw------- 1 nicholas mail 0 Nov 27 15:52 /var/mail/nicholas
nicholas@mordor:~$
当我使用 Alpine 电子邮件客户端时,我的主目录中的“邮件”下有一些邮件,但没有一个 mbox 文件具有与 fetchmail 活动相匹配的最新活动。
Fetchmail 配置为:
nicholas@mordor:~$
nicholas@mordor:~$ cat .fetchmailrc
set postmaster "saunders"
set daemon 60
set invisible
set postmaster administrator
set syslog
set logfile /var/log/fetchmail.log
set daemon 600
poll imap.gmail.com with proto IMAP
user '[email protected]' there with password 'xxx' is local_user here options ssl fetchlimit 1
keep
# folder "fetching"
nicholas@mordor:~$
fetchmail 的限制是知道邮件的存储位置。
轮询“imap.gmail.com”是否正确?使用 Alpine 用作 2FA 解决方法的“app”密码。没有密码问题,只需确认配置即可。
可以将 fetchmail 配置为显式使用特定目录或文件夹吗?
没有什么在“~/.fetchids”中。
端口 25 上没有任何监听。
日志显示:
fetchmail: awakened by signal 10
fetchmail: restarting fetchmail (/home/nicholas/.fetchmailrc changed)
fetchmail: starting fetchmail 6.4.27 daemon
fetchmail: 31 messages (31 seen) for [email protected] at imap.gmail.com.
fetchmail: 31 messages (31 seen) for [email protected] at imap.gmail.com.
fetchmail: restarting fetchmail (/home/nicholas/.fetchmailrc changed)
fetchmail: starting fetchmail 6.4.27 daemon
fetchmail: 31 messages (31 seen) for [email protected] at imap.gmail.com.
fetchmail: 31 messages (31 seen) for [email protected] at imap.gmail.com.
fetchmail: awakened by signal 10
fetchmail: 32 messages (31 seen) for [email protected] at imap.gmail.com.
fetchmail: reading message [email protected]@imap.gmail.com:32 of 32 (613 header octets) (log message incomplete)
fetchmail: Connection errors for this poll:
name 0: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused.
fetchmail: SMTP connect to localhost failed
fetchmail: SMTP transaction error while fetching from [email protected]@imap.gmail.com and delivering to SMTP host localhost
fetchmail: Query status=10 (SMTP)
fetchmail: 32 messages (31 seen) for [email protected] at imap.gmail.com.
fetchmail: reading message [email protected]@imap.gmail.com:32 of 32 (613 header octets) (log message incomplete)
fetchmail: Connection errors for this poll:
name 0: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused.
fetchmail: SMTP connect to localhost failed
fetchmail: SMTP transaction error while fetching from [email protected]@imap.gmail.com and delivering to SMTP host localhost
fetchmail: Query status=10 (SMTP)
只是想抓取一条消息并将其存储在本地。我可以更改 fetchmail 配置,但犹豫是否开始下载太多电子邮件,直到我弄清楚它保存的电子邮件的存储位置。
nicholas@mordor:~$
nicholas@mordor:~$ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
nicholas@mordor:~$
nicholas@mordor:~$ hostname -f
mordor.saundersconsulting.tech
nicholas@mordor:~$
nicholas@mordor:~$ telnet mordor.saundersconsulting.tech 25
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
nicholas@mordor:~$
答案1
查看日志文件,您没有成功使用 SMTP 传送邮件:
fetchmail: Connection errors for this poll: name 0: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused. fetchmail: SMTP connect to localhost failed fetchmail: SMTP transaction error while fetching from [email protected]@imap.gmail.com and delivering to SMTP host localhost
所以这就是为什么你什么也看不到的原因。
启动本地 MTA 或配置fetchmail
为直接在本地传送