为何 fetchmail 突然无法工作了?

为何 fetchmail 突然无法工作了?

chmod 777 *在我的主文件夹上运行了。(我知道,我知道。我再也不会这么做了。

从此以后,fetchmail好像就断了。

我使用它通过 DAVMail 和 OWA 从 Exchange 2003 邮箱中获取邮件。

问题是,fetchmail每当我收到新邮件时,它都会抱怨“删除不匹配”。它会从 Exchange 邮箱中删除邮件,但从不转发。邮件处理过程中似乎存在问题,但我无法确定问题出在哪里。

任何帮助,将不胜感激。

以下是相关的配置文件。

~/fetchmailrc

set no bouncemail
defaults:
  antispam -1
  batchlimit 100
poll localhost with protocol imap and port 1143
user domain\\user password Password is root
no rewrite
mda "/usr/bin/procmail -f %F -d %T";

~/procmailrc

:0
* ^Subject.*ack
| expand | sed -e 's/[ ]*$//g' | sed -e 's/^/ /' > /usr/local/nagios/libexec/mail_acknowledgement

~/.forward

| "/usr/bin/procmail"

下面是我运行时的输出fetchmail -f /root/.fetchmailrc -vv

fetchmail: WARNING: Running as root is discouraged.
Old UID list from localhost: <empty>
Scratch list of UIDs: <empty>
fetchmail: 6.3.19 querying localhost (protocol IMAP) at Tue 03 Jul 2012 09:46:36 AM EDT: poll started
Trying to connect to 127.0.0.1/1143...connected.
fetchmail: IMAP< * OK [CAPABILITY IMAP4REV1 AUTH=LOGIN] IMAP4rev1 DavMail 3.9.7-1870 server ready
fetchmail: IMAP> A0001 CAPABILITY
fetchmail: IMAP< * CAPABILITY IMAP4REV1 AUTH=LOGIN
fetchmail: IMAP< A0001 OK CAPABILITY completed
fetchmail: Protocol identified as IMAP4 rev 1
fetchmail: GSSAPI error gss_inquire_cred: Unspecified GSS failure.  Minor code may provide more information
fetchmail: GSSAPI error gss_inquire_cred:
fetchmail: No suitable GSSAPI credentials found. Skipping GSSAPI authentication.
fetchmail: If you want to use GSSAPI, you need credentials first, possibly from kinit.
fetchmail: IMAP> A0002 LOGIN "domain\\user" *
fetchmail: IMAP< A0002 OK Authenticated
fetchmail: selecting or re-polling default folder
fetchmail: IMAP> A0003 SELECT "INBOX"
fetchmail: IMAP< * 1 EXISTS
fetchmail: IMAP< * 1 RECENT
fetchmail: IMAP< * OK [UIDVALIDITY 1]
fetchmail: IMAP< * OK [UIDNEXT 344]
fetchmail: IMAP< * FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded Junk)
fetchmail: IMAP< * OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded Junk)]
fetchmail: IMAP< A0003 OK [READ-WRITE] SELECT completed
fetchmail: 1 message waiting after first poll
fetchmail: IMAP> A0004 EXPUNGE
fetchmail: IMAP< A0004 OK EXPUNGE completed
fetchmail: 1 message waiting after expunge
fetchmail: IMAP> A0005 SEARCH UNSEEN
fetchmail: IMAP< * SEARCH 1
fetchmail: 1 is unseen
fetchmail: IMAP< A0005 OK SEARCH completed
fetchmail: 1 is first unseen
1 message for domain\user at localhost.
fetchmail: IMAP> A0006 FETCH 1 RFC822.SIZE
fetchmail: IMAP< * 1 FETCH (UID 343 RFC822.SIZE 1350)
fetchmail: IMAP< A0006 OK FETCH completed
fetchmail: IMAP> A0007 FETCH 1 RFC822.HEADER
fetchmail: IMAP< * 1 FETCH (UID 343 RFC822.HEADER  {1350}
reading message domain\user@localhost:1 of 1 (1350 header octets) fetchmail: about to deliver with: /usr/bin/procmail -f '[email protected]' -d 'root'
#
fetchmail: IMAP<
fetchmail: IMAP<
fetchmail: IMAP< Bonne journ=E9e..
fetchmail: IMAP<
fetchmail: IMAP< Company Name
fetchmail: IMAP< My Name
fetchmail: IMAP< IT
fetchmail: IMAP< Tel: (XXX) XXX-XXXX xXXX
fetchmail: IMAP< www.domain.com=20
fetchmail: IMAP<
fetchmail: IMAP<
fetchmail: IMAP< -----Message d'origine-----
fetchmail: IMAP< De=A0: User [mailto:[email protected]]=20
fetchmail: IMAP< Envoy=E9=A0: 2 juillet 2012 15:50
fetchmail: IMAP< =C0=A0: Informatique
fetchmail: IMAP< Objet=A0: PROBLEM: photo
fetchmail: IMAP<
fetchmail: IMAP< Notification Type: PROBLEM
fetchmail: IMAP< Author:=20
fetchmail: IMAP< Comment:=20
fetchmail: IMAP<
fetchmail: IMAP< Host: Photos
fetchmail: IMAP< Hostname: photo
fetchmail: IMAP< State: DOWN
fetchmail: IMAP< Address: XXX.XX.X.XX
fetchmail: IMAP<
fetchmail: IMAP< Date/Time: Mon Jul 2 15:49:38 EDT 2012
fetchmail: IMAP<
fetchmail: IMAP< Info: CRITICAL - XXX.XX.X.XX: rta nan, lost 100%
fetchmail: IMAP<
fetchmail: IMAP<
fetchmail: IMAP< )
fetchmail: IMAP< A0007 OK FETCH completed
fetchmail: IMAP> A0008 FETCH 1 BODY.PEEK[TEXT]
fetchmail: IMAP< * 1 FETCH (UID 343 BODY[TEXT] {539}
 (539 body octets) *******************************
fetchmail: IMAP< )
fetchmail: IMAP< A0008 OK FETCH completed
 flushed
fetchmail: IMAP> A0009 STORE 1 +FLAGS (\Seen \Deleted)
fetchmail: IMAP< * 1 FETCH (UID 343 FLAGS (\Seen \Deleted))
fetchmail: IMAP< * 1 EXPUNGE
fetchmail: IMAP< A0009 OK STORE completed
fetchmail: IMAP> A0010 EXPUNGE
fetchmail: IMAP< A0010 OK EXPUNGE completed
fetchmail: mail expunge mismatch (0 actual != 1 expected)
fetchmail: IMAP> A0011 LOGOUT
fetchmail: IMAP< * BYE Closing connection
fetchmail: IMAP< A0011 OK LOGOUT completed
fetchmail: client/server synchronization error while fetching from domain\user@localhost
fetchmail: 6.3.19 querying localhost (protocol IMAP) at Tue 03 Jul 2012 09:46:36 AM EDT: poll completed
Merged UID list from localhost: <empty>
fetchmail: Query status=7 (ERROR)
fetchmail: normal termination, status 7

答案1

如果有人碰到了这个问题,解决办法会很尴尬。

我们克隆了定期运行 fetchmail 的 Ubuntu VM。因此,cron负责获取邮件的作业在两台机器上同时运行。

这就是导致我所看到的奇怪错误的原因fetchmail,因为两个客户端在完全相同的时间获取同一封邮件。

相关内容