Author |
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 02 July 2009 at 9:48am | IP Logged
|
|
|
we have a mail thread running every 5 minutes to check to see if there are any new messages. Is there a way to have a callback set up with the imap mailserver so we can process the mail message in real time?
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 02 July 2009 at 10:06am | IP Logged
|
|
|
You can use Imap.Idle method (if your IMAP server supports IDLE extension).
Regards,
Alex
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 06 July 2009 at 4:02am | IP Logged
|
|
|
I am not getting a message back from the mailserver when e.statusid="RECENT". It tries to endidle() but imp_MessageStatus() did not get a callback from the mailserver to stop idling. I tried calling stopidle() on my own but it still throws an error. Apparently it is something the mailserver must do.
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 06 July 2009 at 4:06am | IP Logged
|
|
|
The exact error message on line 44 of form1.cs is
{"The server has responded with negative reply. The server responded: * NO Mailbox is locked, will abort in 122 seconds."}
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 06 July 2009 at 4:22am | IP Logged
|
|
|
Please find a working sample which demonstrates using IDLE here.
Best regards,
Andrew
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 06 July 2009 at 4:41am | IP Logged
|
|
|
That is what I am using. I notice sometimes the mail server does send a message, e.statusid="EXISTS" or e.statusId="RECENT" and sometimes it does not. WIthout a message being sent, the callback to process the message abends.
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 06 July 2009 at 4:52am | IP Logged
|
|
|
Does it happen with any IMAP server or with certain one? The sample we provided you with works fine for many of our customers. That seems to be an issue of certain IMAP server.
What's if enclose the callback to process to a try/catch block to prevent the abend?
Best regards,
Andrew
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 06 July 2009 at 5:24am | IP Logged
|
|
|
Apparently the MailServer is supposed to know that the client is in idle mode and is supposed to lock the mailbox before allowing the client to process the message with the async callback method. The error is that the mailbox is not locked so you cannot call imp.EndIdle();
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 06 July 2009 at 5:25am | IP Logged
|
|
|
I only have one mailserver -dovecot running on unix os.
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 06 July 2009 at 5:50am | IP Logged
|
|
|
Andrew,
You were right I put in try/catch and it kicked off properly. I had actually done some things wrong myself, as I combined the IdleSample with the IMAPDemo2 sample.
|
Back to Top |
|
|