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



Hi,

I haven't received any replies to this request for information - can
anyone possibly help to answer it?

Thank you,
Steve Rosen

Steve Rosen wrote:
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?

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.

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?

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...

Thank you,
Steve Rosen




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