* camel_sasl_authtype() seems to list some possible values.
*/
- /* Note that evolution does not offer this for IMAP: */
+/* Note that evolution does not offer these for IMAP: */
#define MODEST_ACCOUNT_AUTH_PLAIN "PLAIN"
+#define MODEST_ACCOUNT_AUTH_ANONYMOUS "ANONYMOUS"
-/* IMAP uses NULL instead.
+/* Caeml's IMAP uses NULL instead for "Password".
* Also, not that Evolution offers "Password" for IMAP, but "Login" for SMTP.*/
#define MODEST_ACCOUNT_AUTH_PASSWORD "LOGIN"
#define MODEST_ACCOUNT_AUTH_CRAMMD5 "CRAM-MD5"
g_return_val_if_fail (account_data, NULL);
/* sanity checks */
- if (account_data->proto == MODEST_PROTOCOL_UNKNOWN) {
+ if (account_data->proto == MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN) {
g_printerr ("modest: '%s' does not provide a protocol\n",
account_data->account_name);
return NULL;
tny_account_set_id (tny_account, account_data->account_name);
/* Proto */
- tny_account_set_proto (tny_account,
- modest_protocol_info_get_protocol_name(account_data->proto,
- MODEST_TRANSPORT_STORE_PROTOCOL));
+ const gchar* proto_name =
+ modest_protocol_info_get_transport_store_protocol_name(account_data->proto);
+ tny_account_set_proto (tny_account, proto_name);
/* mbox and maildir accounts use a URI instead of the rest: */
option_security);
}
-
const gchar* auth_mech_name = NULL;
switch (account_data->secure_auth) {
case MODEST_PROTOCOL_AUTH_NONE:
* This setting should never happen anyway. */
if (account_data->proto == MODEST_PROTOCOL_STORE_IMAP)
auth_mech_name = NULL;
+ else if (account_data->proto == MODEST_PROTOCOL_TRANSPORT_SMTP)
+ auth_mech_name = MODEST_ACCOUNT_AUTH_ANONYMOUS;
else
auth_mech_name = MODEST_ACCOUNT_AUTH_PLAIN;
break;
case MODEST_PROTOCOL_AUTH_CRAMMD5:
auth_mech_name = MODEST_ACCOUNT_AUTH_CRAMMD5;
+ break;
default:
g_warning ("%s: Unhandled secure authentication setting %d for "
- "account=%s", __FUNCTION__, account_data->secure_auth, account_data->account_name);
+ "account=%s (%s)", __FUNCTION__, account_data->secure_auth,
+ account_data->account_name, account_data->hostname);
break;
}
tny_account_set_pass_func (tny_account,
get_pass_func ? get_pass_func: get_pass_dummy);
- /* this name is what shows up in the folder view -- so for some POP/IMAP/... server
- * account, we set its name to the acount of which it is part */
+ /* This name is what shows up in the folder view -- so for some POP/IMAP/... server
+ * account, we set its name to the account of which it is part. */
if (account_data->display_name)
tny_account_set_name (tny_account, account_data->display_name);
helper->folders += tny_list_get_length (folders);
- while (!tny_iterator_is_done (iter))
- {
+ while (!tny_iterator_is_done (iter)) {
TnyFolderStats *stats;
TnyFolder *folder;
folder = TNY_FOLDER (tny_iterator_get_current (iter));
stats = tny_folder_get_stats (folder);
- if (helper->function)
+ /* initially, we sometimes get -1 from tinymail; ignore that */
+ if (helper->function && helper->function (stats) > 0)
helper->sum += helper->function (stats);
recurse_folders (TNY_FOLDER_STORE (folder), query, helper);
gint retval;
g_return_val_if_fail (TNY_IS_ACCOUNT (self), -1);
-
+
/* Create helper */
helper = g_malloc0 (sizeof (RecurseFoldersHelper));
helper->function = (TnyStatsFunc) tny_folder_stats_get_all_count;