Lines Matching refs:storage
16 #include "imapc-storage.h"
86 struct imapc_storage *storage;
89 pool = pool_alloconly_create("imapc storage", 2048);
90 storage = p_new(pool, struct imapc_storage, 1);
91 storage->storage = imapc_storage;
92 storage->storage.pool = pool;
93 storage->root_ioloop = current_ioloop;
94 return &storage->storage;
97 void imapc_copy_error_from_reply(struct imapc_storage *storage,
104 mail_storage_set_error(&storage->storage, error,
107 mail_storage_set_error(&storage->storage, default_error,
139 imapc_client_run(mbox->storage->client->client);
140 } while (mbox->storage->reopen_count > 0 ||
158 mail_storage_set_internal_error(&ctx->client->_storage->storage);
161 mail_storage_set_critical(&ctx->client->_storage->storage,
178 imapc_simple_context_init(&sctx, mbox->storage->client);
244 /* We need to set the error to either storage or to list, depending on
245 whether the caller is from mail-storage.h API or mailbox-list.h API.
250 mail_storage_set_internal_error(&client->_storage->storage);
252 mail_storage_set_error(&client->_storage->storage,
391 struct imapc_storage *storage = IMAPC_STORAGE(_storage);
394 storage->set = mail_namespace_get_driver_settings(ns, _storage);
401 storage->set->imapc_ssl,
402 storage->set->imapc_ssl_verify ? "(verify)" : "",
403 storage->set->imapc_user,
404 storage->set->imapc_master_user,
405 storage->set->imapc_password,
406 storage->set->imapc_host,
407 storage->set->imapc_port,
408 storage->set->imapc_list_prefix,
409 storage->set->imapc_sasl_mechanisms,
410 storage->set->imapc_features,
411 storage->set->imapc_rawlog_dir,
412 storage->set->imapc_cmd_timeout,
413 storage->set->imapc_max_idle_time,
414 (size_t) storage->set->imapc_max_line_length,
415 storage->set->pop3_deleted_flag,
420 storage->client = imapc_list->client;
421 storage->client->refcount++;
423 if (imapc_storage_client_create(ns, storage->set, _storage->set,
424 &storage->client, error_r) < 0)
427 storage->client->_storage = storage;
428 p_array_init(&storage->remote_namespaces, _storage->pool, 4);
429 if (IMAPC_HAS_FEATURE(storage, IMAPC_FEATURE_FETCH_BODYSTRUCTURE)) {
434 imapc_storage_client_register_untagged(storage->client, "STATUS",
436 imapc_storage_client_register_untagged(storage->client, "NAMESPACE",
444 struct imapc_storage *storage = IMAPC_STORAGE(_storage);
446 storage->client->destroying = TRUE;
450 imapc_client_logout(storage->client->client);
452 imapc_storage_client_unref(&storage->client);
477 imapc_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
487 mbox->box.storage = storage;
493 mbox->storage = IMAPC_STORAGE(storage);
530 mail_storage_copy_list_error(box->storage, box->list);
534 mail_storage_copy_list_error(box->storage, box->list);
578 i_assert(mbox->storage->reopen_count > 0);
579 mbox->storage->reopen_count--;
594 imapc_client_stop(mbox->storage->client->client);
630 mbox->storage->reopen_count++;
651 imapc_copy_error_from_reply(ctx->mbox->storage,
654 } else if (imapc_storage_client_handle_auth_failure(ctx->mbox->storage->client)) {
658 mail_storage_set_internal_error(ctx->mbox->box.storage);
664 imapc_client_stop(ctx->mbox->storage->client->client);
670 if (imapc_storage_client_handle_auth_failure(mbox->storage->client))
673 return imapc_client_get_capabilities(mbox->storage->client->client,
707 imapc_client_mailbox_open(mbox->storage->client->client, mbox);
752 mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
811 imapc_simple_context_init(&sctx, mbox->storage->client);
812 cmd = imapc_client_cmd(mbox->storage->client->client,
825 mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
834 struct imapc_storage *storage = client->_storage;
845 if (storage->cur_status_box == NULL)
847 if (strcmp(storage->cur_status_box->box.name, name) == 0) {
849 } else if (strcasecmp(storage->cur_status_box->box.name, "INBOX") == 0 &&
856 status = storage->cur_status;
874 imapc_mailbox_has_modseqs(storage->cur_status_box))
882 struct imapc_storage *storage = client->_storage;
893 array_clear(&storage->remote_namespaces);
906 ns = array_append_space(&storage->remote_namespaces);
907 ns->prefix = p_strdup(storage->storage.pool, prefix);
977 imapc_simple_context_init(&sctx, mbox->storage->client);
978 mbox->storage->cur_status_box = mbox;
979 mbox->storage->cur_status = status_r;
980 cmd = imapc_client_cmd(mbox->storage->client->client,
986 mbox->storage->cur_status_box = NULL;
987 mbox->storage->cur_status = NULL;
1026 struct imapc_storage *storage = mbox->storage;
1030 if (storage->namespaces_requested)
1040 imapc_simple_context_init(&sctx, storage->client);
1041 cmd = imapc_client_cmd(storage->client->client,
1049 storage->namespaces_requested = TRUE;
1054 imapc_namespace_find_mailbox(struct imapc_storage *storage, const char *name)
1059 array_foreach(&storage->remote_namespaces, ns) {
1088 ns = imapc_namespace_find_mailbox(mbox->storage, box->name);
1106 struct imapc_storage *storage = context;
1111 imapc_copy_error_from_reply(storage, MAIL_ERROR_PARAMS, reply);
1113 mail_storage_set_internal_error(&storage->storage);
1115 mail_storage_set_critical(&storage->storage,
1125 imapc_noop_callback, mbox->storage);
1135 imapc_noop_callback(reply, mbox->box.storage);
1143 const struct mail_storage_settings *set = box->storage->set;
1162 i_assert(!imapc_client_is_running(mbox->storage->client->client));