我正在尝试使用 Google 帐户fetchmail
进行配置。procmail
这是我的$HOME/.fetchmailrc
:
poll imap.gmail.com protocol IMAP
user "<email>" is jviotti here
password '<password>'
folder 'Inbox'
keep
ssl
mda 'procmail'
这是我的$HOME/.procmailrc
:
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/$LOGNAME/
LOGFILE=$MAILDIR/log/procmail
VERBOSE=on
在为每条下载的消息procmail
运行时,我会收到以下错误:fetchmail -a -v
fetchmail: IMAP> A0005 FETCH 1 RFC822.HEADER
fetchmail: IMAP< * 1 FETCH (RFC822.HEADER {2865}
reading message <email>@gmail-imap.l.google.com:1 of 22 (2865 header octets) #
fetchmail: IMAP< )
fetchmail: IMAP< A0005 OK Success
fetchmail: IMAP> A0006 FETCH 1 BODY.PEEK[TEXT]
fetchmail: IMAP< * 1 FETCH (BODY[TEXT] {3983}
(3983 body octets) *******************************.************************.***********.*****
fetchmail: IMAP< )
fetchmail: IMAP< A0006 OK Success
procmail: Couldn't create "/var/mail/jviotti"
not flushed
fetchmail: IMAP> A0007 STORE 1 +FLAGS (\Seen)
fetchmail: IMAP< A0007 OK Success
注意procmail: Couldn't create "/var/mail/jviotti" not flushed
。出于某种原因,procmail
坚持写信给/var/mail
即使MAILDIR=$HOME/Mail
和DEFAULT=$MAILDIR/$LOGNAME/
。
为什么会这样?
通过查看procmailrc
手册页,我发现ORGMAIL
默认为/var/mail/$LOGNAME
,并且DEFAULT
默认为ORGMAIL
:
ORGMAIL /var/mail/$LOGNAME
(Unless -m has been specified, in which case it is unset)
DEFAULT $ORGMAIL
但是,即使在设置ORGMAIL
为其他内容后$HOME/.procmailrc
,我也会收到相同的错误/警告。
请注意,即使我收到此错误,我的邮件也已正确下载到$HOME/Mail
.
编辑:查看procmail -v
. 出于某种原因,它仍然将我的系统邮箱设置为 /var/mail/jviotti。
$ procmail -v
procmail v3.22 2001/09/10
Copyright (c) 1990-2001, Stephen R. van den Berg <[email protected]>
Copyright (c) 1997-2001, Philip A. Guenther <[email protected]>
Submit questions/answers to the procmail-related mailinglist by sending to:
<[email protected]>
And of course, subscription and information requests for this list to:
<[email protected]>
Locking strategies: dotlocking, flock()
Default rcfile: $HOME/.procmailrc
Your system mailbox: /var/mail/jviotti
编辑 2:请参阅以下内容man procmail
:
如果在命令行上没有指定 rcfiles 和 -p,procmail 将在读取 $HOME/.procmailrc 之前解释来自 /etc/procmailrc(如果存在)的命令。创建 /etc/procmailrc 时必须小心,因为如果情况允许,它将以 root 权限执行(当然与 $HOME/.procmailrc 文件相反)。
这里说在读取我的主配置之前,它将从 读取/etc/procmailrc
,但是该文件在我的系统上不存在,即使通过显式传递-p
(指向我的主配置),系统邮箱仍然是/var/mail/jviotti
.
手册页还说:
如果没有找到 rcfile,或者 rcfile 的处理结束,procmail 会将邮件存储在默认的系统邮箱中。
“落到尽头”是什么意思?
这是 Procmail 日志文件中来自一条传入消息的输出:
procmail: [49293] Tue Dec 13 14:29:20 2016
procmail: Assigning "LASTFOLDER=/Users/jviotti/Mail/jviotti/new/1481653760.49293_2.jviotti-rmbp.local"
procmail: Notified comsat: "jviotti@0:/Users/jviotti/Mail/jviotti/new/1481653760.49293_2.jviotti-rmbp.local"
From jviotti Tue Dec 13 14:29:20 2016
Subject: Re: [resin-io/etcher] chore: add support for snapshot builds (#968)
Folder: /Users/jviotti/Mail/jviotti/new/1481653760.49293_2.jviotti-r 8015