Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET IMAP

 AfterLogic Forum : MailBee.NET IMAP
Subject Topic: Thread always running Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 02 July 2009 at 9:48am | IP Logged Quote zedekiah

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 View zedekiah's Profile Search for other posts by zedekiah
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 02 July 2009 at 10:06am | IP Logged Quote Alex

You can use Imap.Idle method (if your IMAP server supports IDLE extension).

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 06 July 2009 at 4:02am | IP Logged Quote zedekiah

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 View zedekiah's Profile Search for other posts by zedekiah
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 06 July 2009 at 4:06am | IP Logged Quote zedekiah

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 View zedekiah's Profile Search for other posts by zedekiah
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 06 July 2009 at 4:22am | IP Logged Quote Andrew

Please find a working sample which demonstrates using IDLE here.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 06 July 2009 at 4:41am | IP Logged Quote zedekiah

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 View zedekiah's Profile Search for other posts by zedekiah
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 06 July 2009 at 4:52am | IP Logged Quote Andrew

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 View Andrew's Profile Search for other posts by Andrew
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 06 July 2009 at 5:24am | IP Logged Quote zedekiah

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 View zedekiah's Profile Search for other posts by zedekiah
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 06 July 2009 at 5:25am | IP Logged Quote zedekiah

I only have one mailserver -dovecot running on unix os.
Back to Top View zedekiah's Profile Search for other posts by zedekiah
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 06 July 2009 at 5:50am | IP Logged Quote zedekiah

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 View zedekiah's Profile Search for other posts by zedekiah
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide