fetchmail 将邮件存储在哪里?

fetchmail 将邮件存储在哪里?

试图找到下载消息 Gmail存储. 没有邮件:

nicholas@mordor:~$ 
nicholas@mordor:~$ ll /var/mail/nicholas 
-rw------- 1 nicholas mail 0 Nov 27 15:52 /var/mail/nicholas
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:~$ cat ~/Maildir
cat: /home/nicholas/Maildir: No such file or directory
nicholas@mordor:~$ 
nicholas@mordor:~$ cat ~/MailDir
cat: /home/nicholas/MailDir: No such file or directory
nicholas@mordor:~$ 

文件.fetchmailrc

set postmaster "saunders"
set daemon 60
set invisible
set postmaster administrator
set syslog
set logfile /var/log/fetchmail.log


set daemon 600
poll pop.gmail.com with proto POP3
   user '[email protected]' there with password 'xxx' is local_user here options ssl fetchlimit 400

来自日志:

fetchmail: 357 messages for [email protected] at pop.gmail.com (16640206 octets).

但我没有看到它存储下载的消息在哪里。

我应该将grep日志文件用于什么用途?

描述:Ubuntu 22.04 LTS

日志显示:

fetchmail: awakened by signal 10
fetchmail: awakened at Fri 15 Dec 2023 05:05:56 AM
fetchmail: restarting fetchmail (/home/nicholas/.fetchmailrc changed)
fetchmail: starting fetchmail 6.4.27 daemon
fetchmail: 6.4.27 querying pop.gmail.com (protocol POP3) at Fri 15 Dec 2023 05:05:56 AM: poll started
fetchmail: Trying to connect to 142.250.107.109/995...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: pop.gmail.com
fetchmail: Subject Alternative Name: pop.gmail.com
fetchmail: pop.gmail.com key fingerprint: 4E:0E:B7:ED:C2:8E:3A:A4:AB:B8:1B:ED:80:44:C6:42
fetchmail: SSL/TLS: using protocol TLSv1.3, cipher TLS_AES_256_GCM_SHA384, 256/256 secret/processed bits
fetchmail: POP3< +OK Gpop ready for requests from 172.103.152.184 gy19mb186143720ivb
fetchmail: POP3> CAPA
fetchmail: POP3< +OK Capability list follows
fetchmail: POP3< USER
fetchmail: POP3< RESP-CODES
fetchmail: POP3< EXPIRE 0
fetchmail: POP3< LOGIN-DELAY 300
fetchmail: POP3< TOP
fetchmail: POP3< UIDL
fetchmail: POP3< X-GOOGLE-RICO
fetchmail: POP3< SASL PLAIN XOAUTH2 OAUTHBEARER
fetchmail: POP3< .
fetchmail: POP3> USER [email protected]
fetchmail: POP3< +OK send PASS
fetchmail: POP3> PASS *
fetchmail: POP3< +OK Welcome.
fetchmail: POP3> STAT
fetchmail: POP3< +OK 357 16640206
fetchmail: POP3> LAST
fetchmail: POP3< -ERR Not supported
fetchmail: Not supported
fetchmail: POP3> UIDL
fetchmail: POP3< +OK
fetchmail: POP3< 1 GmailId102335023040492b
fetchmail: POP3< 2 GmailId1026101358f988a8
fetchmail: POP3< 3 GmailId102713517873dd8a
fetchmail: POP3< 4 GmailId1027142d4a18d59d
fetchmail: POP3< 5 GmailId10279b34b9241ac3

没有提及消息存储的位置。

也可以看看:

https://stelfox.net/blog/2013/11/backing-up-gmail-with-fetchmail/

所以我正在看procmail。

答案1

获取邮件程序可能会更好地工作,因为它支持直接传送到 Maildir 或 mbox 文件夹 - 并且还具有--delete选项。(流行是另一个不错的选择;但它仅限于 POP。)

默认情况下,Fetchmail 遵循将邮件传递外包给另一个程序的 50 年传统 - 它通过本地安装的邮件传输代理(例如 Postfix、Exim 或 Sendmail)传递消息,然后可能将消息放在 /var/mail 或有时是 ~/Mail... 中,或者将存储外包给另一个程序,即邮件传递代理(例如 Procmail、Maildrop 或 Sieve)。

Fetchmail 与邮件传输代理通信的具体机制是/usr/sbin/sendmail,有时是/usr/lib/sendmail。如果您有此程序(无论它随哪个软件附带,它始终被命名为“sendmail”),请使用dpkg -S /usr/sbin/sendmail查找哪个软件包拥有它,然后检查相应服务的系统日志。可能是该服务未运行,因此邮件被排队并被遗忘。

(话虽如此,大多数用户费心安装 Postfix 通常会做完全相反的配置;它们禁用所有本地存储并路由所有消息他们的个人 Gmail...)

但是完全跳过 MTA 并让 Fetchmail 直接调用 procmail/maildrop 将邮件投递到您的 ~/Mail 中会更容易;为此,请指定以下选项mda

~/.fetchmailrc
默认值 #mda “/usr/bin/procmail” mda“/usr/bin/maildrop”

Procmail 使用一种神秘但广泛记录的过滤格式:

〜/ .procmailrc
LOGFILE=$HOME/.cache/procmail.log VERBOSE=on MAILDIR=$HOME/邮件 默认值=$MAILDIR/ :0 $默认

Courier Maildrop 是轻微地更加现代,其配置如下:

〜/ .mailfilter
日志文件“$HOME/.cache/mailfilter.log” DEFAULT="$HOME/邮件" # 如果 (/^List-Id:/) # 到 $DEFAULT/.Lists/ 到 $DEFAULT

相关内容