On Fri, 2002-12-13 at 01:36, Dave Kelly wrote:
> Hello
> 
> In trying to understand the camel provider model I have a few questions:
> 
> 0) How can I get some debugging output out of a camel provider ? printf, 
> fprintf and g_print all seem to have no effect.

As Jeff said, just run evolution-mail in a separate terminal.  Usually
in gdb helps too (you're probably going to get a lot of crashes and
stuff).

> 1) I am writing a provider for a remote store. When setting up a new 
> account using the config druid, an attempt is made to log on to the 
> remote store but it does not seem possible to be able to prompt for a 
> password. I have lifted the following code out of the IMAP provider:
> 
> prompt = g_strdup_printf (_("%sPlease enter the IMAP "
>                       "password for %s@%s"),
>                     errbuf ? errbuf : "",
>                     service->url->user,
>                     service->url->host);
>          service->url->passwd =
>             camel_session_get_password (
>                session, prompt, TRUE,
>                service, "password", ex);
>          g_free (prompt);
>          g_free (errbuf);
> 
> 
> This is never displayed in the druid.
> 
> The issue I have here is that, on my remote store, it is possible to 
> lock an account after a number of unsuccessful login attempts. If the 
> druid fails to login, which it always does, this will increment the 
> failed login count on the server.
> 
> I'd like to be able to drop out of the routine if the call is being made 
> from the druid. I thought that CAMEL_IS_SESSION would solve this as 
> that's one of the assertions in camel_session_get_password but adding a 
> check for this has no effect.

No, you dont need to do any of that.  If we are in 'non interactive'
mode, which is the state the druid runs, then any calls like
get_password() just behave exactly as if the user had pressed 'cancel'.

The druid does some pre-checks before it tries to connect for real, for
things like authentication methods.

Since you need to cater for this case anyway (and presumably not try to
connect), it should be a transparent process.

camel_session_get_password() will return NULL (and i think set the
exception to USER_CANCEL?), so if that happens, just assume it was a
user cancel.

> 2) What is the flow of calls to a provider ? I have set up a call to the 
> get_folder_info method of a store class so that it immediately returns 
> an exception but, probably related to question (0), I am seeing no 
> output. I would like to know when, in the process of using the mail 
> client, each method of the store and folder classes is called.

Hmm, yeah this definetly needs some documentation ... :-/

But basically once it is connected (and not, if it is an offline capable
store), it will do a get_folder_info().  You need to get past 0 and 1
above before it'll get there.

Then the store needs to emit various events
folder_created/deleted/renamed when things change, or new folders become
available.  These are so the display updates automagically.

But ... the code can't really use get_folder_info() to initialise
anything.  e.g. you could get_folder() at any time after connection is
established, or any other calls.




_______________________________________________
evolution-hackers maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/evolution-hackers

Reply via email to