Closed (duplicate)
Project:
Mailhandler
Version:
6.x-1.8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2009 at 00:30 UTC
Updated:
4 Dec 2009 at 13:30 UTC
In Mailhandler 6.x-1.8
I didn't see any other reports on this, so it may be related to the fact that I'm using hMailServer as my mail server in a windows development environment. Other servers may simply ignore the fact that a client is trying to open an already open session.
Nonetheless, my code review reveals that there is a flaw in Mailhandler's mail retrieval logic. mailhandler_cron_retrieve() calls mailhandler_get_unread_messages(). They are both calling mailhandler_open_mailbox(). The second call to mailhandler_open_mailbox() generates errors on my mail server and the session fails.
I've attached a patch file for mailhandler.retrieve.inc which corrects the situation.
| Comment | File | Size | Author |
|---|---|---|---|
| mailhandler.retrieve.inc-20091003.patch | 1.54 KB | tsaker |
Comments
Comment #1
Ian Ward commented@tjsaker I see what you are saying. It looks like your patch will cause mailhandler_open_mailbox to be called multiple times when running via cron. Can you try the following:
Change:
to:
and see if you still get the session error? mailhandler_get_unread_messages() closes the connection it opens. I'm wondering if it's called first, since it will not be opening a second connection to the mailbox, whether this will fix the problem you're seeing. I do not know how opening multiple streams to the same mailbox is handled b/t the different OS's. Please let me know how it goes.
Comment #2
Ian Ward commentedI believe this is a dupe of http://drupal.org/node/358737 ... marking it as such.