{"issue":{"user":{"id":58338,"login":"ressy","url":"https://api.github.com/users/ressy","gravatar_id":"f39e5a973a830b9cbcef1fab291f0af0","avatar_url":"https://secure.gravatar.com/avatar/f39e5a973a830b9cbcef1fab291f0af0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"milestone":null,"created_at":"2011-12-14T17:59:48Z","title":"Another become_daemon() issue with Exchange 2010","updated_at":"2011-12-20T22:40:26Z","labels":[],"state":"open","id":2555617,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"html_url":"https://github.com/lefcha/imapfilter/issues/22","closed_at":null,"number":22,"body":"This has actually been happening since my server was upgraded from Exchange 2007 to 2010 a few months back, and I suspect it's a problem on that end-- but I'm hoping that becaome_daemon() can help work around it.  Ever since the upgrade Exchange will occasionally give a strange response to a regular query.  When I connect through DavMail Gateway (Exchange <-> IMAP adapter daemon) it would look like this:\r\n\r\n```\r\nsending command (4):\r\n\r\n125C SELECT \"INBOX\"\r\n\r\ngetting response (4):\r\n\r\n* BYE Closing connection\r\n```\r\n\r\nAnd connecting straight to the Exchange server (thinking maybe something was odd with DavMail) doesn't even give the BYE:\r\n\r\n```\r\nsending command (5):\r\n\r\nF9DC STATUS \"INBOX\" (MESSAGES RECENT UNSEEN UIDNEXT)\r\n```\r\n\r\n(That's the last line in the debug file; no visible response.)  Now that I'm using 2.4.1 (thanks again) I can see some things going on in the logfile too, some of each of these errors randomly when connecting to Exchange:\r\n\r\n```\r\nMon Dec 12 23:59:07 2011: IMAP (6): 29B5 NO System error (Failure)\r\n```\r\n```\r\nTue Dec 13 23:28:11 2011: reading data; EOF in violation of the protocol\r\n```\r\n\r\nPossibly it's closing the connection unexpectedly, confusing imapfilter?  I was hoping is that the pcall() in become_daemon() would ignore whatever this is and continue to the next cycle of filtering, but the program exits completely when this happens and needs to be restarted on the command line.  Any thoughts about what this is and/or how I can catch the error in become_daemon when it occurs?  Thanks!\r\n\r\nP.S.  Is the mailing list still active?  Just let me know if this would be more appropriate there, particularly since I think it's more likely an Exchange bug than an imapfilter one.","url":"https://api.github.com/repos/lefcha/imapfilter/issues/22","comments":4,"assignee":null},"comment":{"user":{"id":640819,"login":"lefcha","url":"https://api.github.com/users/lefcha","gravatar_id":"e67d3e3d9fc1385b9b1e148d377576cc","avatar_url":"https://secure.gravatar.com/avatar/e67d3e3d9fc1385b9b1e148d377576cc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-20T22:40:26Z","updated_at":"2011-12-20T22:40:26Z","id":3226619,"body":"The `EOF in violation of the protocol` error seems to be an issue of the server, possibly because at some point it thinks that the client has closed the connection, either due to inactivity and a small timeout on its side, or perhaps because of connection problem, or even a bug.\r\n\r\nNow in this case where you don't get any error, it's hard to guess what might be wrong. Considering your configuration file, you might want to set the `options.timeout` to a value, for example `60`, and then try to reproduce again...\r\n\r\nIn case of such an error, it is very hard for imapfilter to continue its operation, because when the connection was closed by the server, imapfilter has to always remember its state and try to reconnect and pick up from where it was.  It would be best if it connected again and started over from the beginning, and I guess this can be done by executing imapfilter again (eg. through some kind of loop in a script) when this happens.\r\n\r\nI guess I could also make imapfilter to return some error value that could then be checked by the user from inside the configuration, but most users wouldn't expect that, and possible unpredictable things could happen then.  I will have to consider what I can provide and how to handle such cases...","url":"https://api.github.com/repos/lefcha/imapfilter/issues/comments/3226619"},"action":"created"}