Mailing List Archive

FETCH problem using java client
Hi,

I am running a web mail client, Java based. It runs latest Javamail and JRE 1.7

This client throws an error trying to fetch a message from DBMAIL 3.1.17 using IMAP.

But same message is fetched without errors using other mail servers including Merak, MS Exchange, Dovecot.

I should also mention that the problem happens with bounced messages only, as those with subject “Delivery Status Notification (Failure)”.

The error and debug info follow:

DEBUG IMAP: mail.imap.partialfetch: false
DEBUG IMAP: mail.imap.ignorebodystructuresize: false
DEBUG IMAP: mail.imap.statuscachetimeout: 1000
DEBUG IMAP: mail.imap.appendbuffersize: -1
DEBUG IMAP: mail.imap.minidletime: 10
DEBUG IMAP: closeFoldersOnStoreFailure
DEBUG IMAP: trying to connect to host "xxx.xxx.xxx.xxx", port 143, isSSL false
* OK [CAPABILITY IMAP4 IMAP4rev1 AUTH=LOGIN AUTH=CRAM-MD5 AUTH=DIGEST-MD5] "yyyyyyyyyyyyyyyyyyyyyyyyyy"
DEBUG IMAP: AUTH: LOGIN
DEBUG IMAP: AUTH: CRAM-MD5
DEBUG IMAP: AUTH: DIGEST-MD5
DEBUG IMAP: protocolConnect login, host=xxx.xxx.xxx.xxx, user=xxxxxxxxxxxxxxxx, password=<non-null>
DEBUG IMAP: AUTHENTICATE LOGIN command trace suppressed
DEBUG IMAP: AUTHENTICATE LOGIN command result: A0 OK [.CAPABILITY IMAP4 IMAP4rev1 AUTH=DIGEST-MD5 ACL RIGHTS=texk NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE] User xxxxxxxxxxxxxxxxxx authenticated
DEBUG IMAP: AUTH: DIGEST-MD5
A1 LIST "" INBOX
* LIST (\hasnochildren) "/" "INBOX"
A1 OK LIST completed
DEBUG IMAP: connection available -- size: 1
A2 EXAMINE INBOX
* 129 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Deleted \Flagged \Draft)
* OK [PERMANENTFLAGS (\Seen \Answered \Deleted \Flagged \Draft \*)] Flags allowed.
* OK [UIDNEXT 21393358] Predicted next UID
* OK [UIDVALIDITY 2] UID value
* OK [UNSEEN 40] first unseen message
A2 OK [READ-ONLY] EXAMINE completed
A3 UID FETCH 21393357 (UID)
* 129 FETCH (UID 21393357)
A3 OK UID FETCH completed
A4 FETCH 129 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 129 FETCH (INTERNALDATE "23-Jun-2015 22:11:37 +0000" RFC822.SIZE 4049 ENVELOPE ("Tue, 23 Jun 2015 15:26:45 -0700" "Delivery Status Notification (Failure)" ((NIL NIL "postmaster" "hotmail.com")) ((NIL NIL "postmaster" "hotmail.com")) ((NIL NIL "postmaster" "hotmail.com")) ((NIL NIL "rogerio" "rogeriopereira.com")) NIL NIL NIL "<QzBxhJTAN000a0fdd@SNT004-MC1F8.hotmail.com>"))
A4 OK FETCH completed
A5 FETCH 129 (BODY.PEEK[HEADER])
* 129 FETCH (BODY[HEADER] {1627}
Received: from localhost (localhost [127.0.0.1])
by bbbbbbbbbbbbb (Postfix) with ESMTP id 0700D2FE1D
for <rogerio@rogeriopereira.com>; Tue, 23 Jun 2015 19:26:51 -0300 (BRT)
X-Spam-Flag: NO
X-Spam-Score: -1.076
X-Spam-Level:
X-Spam-Status: No, score=-1.076 tagged_above=-9999 required=3
tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, NO_RDNS_DOTCOM_HELO=0.823,
RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from xxxxxxxxxxxxxxxxxxxxx([127.0.0.1])
by localhost (xxxxxxxxxxxxxxxxx[127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id IbnzAZG86sYM for <xxxxxxxxxxxxxxxxxxxxxxx>;
Tue, 23 Jun 2015 19:26:48 -0300 (BRT)
X-SMTP-Auth: no
Received: from SNT004-OMC1S34.hotmail.com (snt004-omc1s34.hotmail.com [65.55.90.45])
by xxxxxxxxxxxxxxxxxx (Postfix) with ESMTPS id B5B5B2FE1C
for <xxxxxxxxxxxxxxxxxxxx>; Tue, 23 Jun 2015 19:26:47 -0300 (BRT)
Received: from SNT004-MC1F8.hotmail.com ([65.55.90.8])
by SNT004-OMC1S34.hotmail.com over TLS secured channel
with Microsoft SMTPSVC(7.5.7601.22751); Tue, 23 Jun 2015 15:26:45 -0700
From: postmaster@hotmail.com
To: rogerio@rogeriopereira.com
Date: Tue, 23 Jun 2015 15:26:45 -0700
MIME-Version: 1.0
X-DSNContext: 335a7efd - 4481 - 00000001 - 80040546
Message-ID: <QzBxhJTAN000a0fdd@SNT004-MC1F8.hotmail.com>
Subject: Delivery Status Notification (Failure)
X-OriginalArrivalTime: 23 Jun 2015 22:26:45.0937 (UTC)
FILETIME=[B047BA10:01D0AE03]
Return-Path:
Content-Type: multipart/report; report-type=delivery-status;
boundary="9B095B5ADSN=_01D0AA6224031AA90033C30BSNT004?MC1F8.hot"

)
A5 OK FETCH completed
A6 FETCH 129 (FLAGS)
* 129 FETCH (FLAGS ())
A6 OK FETCH completed
A7 FETCH 129 (BODYSTRUCTURE)
* 129 FETCH (BODYSTRUCTURE (("text" "plain" ("charset" "unicode-1-1-utf-7") NIL NIL "7BIT" 162 9 NIL NIL NIL NIL)("message" "delivery-status" NIL NIL NIL "7BIT" 342 NIL NIL 9 NIL NIL NIL NIL)("message" "rfc822" NIL NIL NIL "7BIT" 1454 ("Tue, 23 Jun 2015 19:24:59 -0300" "Teste" (("wwwwwwwwwwww" NIL "rogerio" "rogeriopereira.com"))(("xxxxxxxxxxxxxxxxx" NIL "rogerio" "rogeriopereira.com"))(("wwwwwwwwwwwwwww" NIL "rogerio" "rogeriopereira.com"))((NIL NIL "sfdfsdfsdfcxxcvwerw" "hotmail.com")) NIL NIL NIL "1814129309.27124.1435098299679@xxxxxxxxxxxxxxxxxxxxxxx")("text" "html" ("charset" "UTF-8") NIL NIL "7bit" 69 8 NIL NIL NIL NIL) 34 NIL NIL NIL NIL) "report" ("report-type" "delivery-status" "boundary" "9B095B5ADSN=_01D0AA6224031AA90033C30BSNT004?MC1F8.hot") NIL NIL NIL))
DEBUG IMAP: ignoring bad response, THROW:
com.sun.mail.iap.ParsingException: error in FETCH parsing, unrecognized item at index 192, starts with ""message" "rfc822" N..."
at com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:203)
at com.sun.mail.imap.protocol.FetchResponse.<init>(FetchResponse.java:92)
at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:321)
at com.sun.mail.iap.Protocol.command(Protocol.java:315)
at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1738)
at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1730)
at com.sun.mail.imap.protocol.IMAPProtocol.fetchBodyStructure(IMAPProtocol.java:1382)
at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1457)
at com.sun.mail.imap.IMAPMessage.getLineCount(IMAPMessage.java:504)
at com.naryx.tagfusion.cfm.mail.cfMailMessageData.extractMessage(Unknown Source)
at com.naryx.tagfusion.cfm.mail.cfMailMessageData.getMessage(Unknown Source)
at com.naryx.tagfusion.cfm.mail.cfIMAP.readMessage(Unknown Source)
at com.naryx.tagfusion.cfm.mail.cfIMAP.render(Unknown Source)
at com.naryx.tagfusion.cfm.tag.cfIF.render(Unknown Source)
at com.naryx.tagfusion.cfm.tag.cfTag.coreRender(Unknown Source)
at com.naryx.tagfusion.cfm.tag.cfTag.render(Unknown Source)
at com.naryx.tagfusion.cfm.file.cfFile.render(Unknown Source)
at com.naryx.tagfusion.cfm.engine.cfSession.onRequest(Unknown Source)
at com.naryx.tagfusion.cfm.engine.cfEngine.service(Unknown Source)
at com.naryx.tagfusion.cfm.cfServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1359)
at com.newatlanta.filters.SearchEngineFriendlyURLFilter.doFilter(Unknown Source)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1330)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:345)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:745)
A7 OK FETCH completed
DEBUG IMAP: IMAPProtocol noop
A8 NOOP
A8 OK NOOP completed
A9 CLOSE
A9 OK CLOSE completed
DEBUG IMAP: added an Authenticated connection -- size: 1
A10 LOGOUT
* BYE
A10 OK LOGOUT completed

The error mentions “DEBUG IMAP: ignoring bad response” in the A7 FETCH 129 (BODYSTRUCTURE) section. I guess DBMAIL is not parsing bounced emails correctly before adding it to Postgresql tables.

Do you know if it’s DBMAIL related? How to solve it?

Thanks in advance.

Rogerio