Re: What is the proper way to monitor a folder from an email server?



En 26/06/10 04:32, Steve Rosen escribiu:
> Hi All,
> 
> First, I'd like to thank everyone that has helped me to
> work through some of the issues I had while trying to
> develop a console-based application that uses the Tinymail
> library - I now have everything working relatively well.
> 
> However, I've bumped into a few topics that maybe someone
> can offer some advice about.
> 
> The first topic has to do with the proper way to monitor
> the folder from an email server - and is related to getting
> re-connected to an email server after getting a disconnect
> notification event from the Tinymail library.  What do I
> need to do? I have a TnyConsoleMsgMonitor object that is
> created with a constructor that takes 3 callback methods
> (one for new headers, one for removed headers, and one
> to receive email message bodies) - do I just destroy this
> object and then create a new one?  Or, is there something
> that this object can do to get itself re-connected to
> the email server, without the higher-level application
> that created the TnyConsoleMsgMonitor object even knowing
> that there was a disconnect, followed by a re-connect?
> Or, do I simply call the "tny_folder_refresh_async" method
> again?

Connection/disconnection messages can be easily tracked with the
TnyAccount object that has some signals to notify about that. You also
have the TnyConnectionPolicy object that allows you to define general
policies when connection/disconnection events happen.

> The second topic is actually concerned with that method
> I just referred to - "tny_folder_refresh_async" - should
> that get called periodically?  I seemed to have empirically
> determined that I needed to call it at least twice - once
> to get the initial set of headers in some folder - but then
> I seemed to need to call it one more time (about 10 or 20
> seconds later), to make sure I called back when a folder
> changed on the email server - due to either new message(s)
> that have arrived, or some existing message(s) that were
> removed from the folder being monitored.

You shouldn't need to call it twice, I don't see any reason for that.
What do you expect from it?

> Also, related to the my second topic above, it seems that
> imap accounts seem to notify you when a folder has changed,
> but a pop account does not - does this mean I just need to
> call the "tny_folder_refresh_async" method periodically
> (like every 10 or 20 seconds) to get any changes to a pop
> account?

Yes. POP accounts work like this: connect, do something, disconnect, so
whatever you want to do you have to ask the server.

> One last topic that I'd like to ask everyone about - and
> this concerns SSL, which you need for connecting to various
> email servers (like Gmail imap accounts, for example) -
> I currently configure the camel-lite library with SSL,
> specifying openssl:
> 
>    ./configure --with-ssl=openssl
> 
> And, I see the warning message that says openssl is not
> fully tested and supported, and NSS is recommended instead.
> Can you tell me what some of the issues currently might
> be with specifying openssl?  Are the connections unstable?
> Is that part of the issues that I described above in my
> other topics?  Any input and/or advice would be appreciated
> here...

I don't remember any specific issue, we had some back in 2006 and that's
why we moved to mozilla libraries. That's why we recommend nss because
is the one we have been using since then.

BR


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]