const char *path;
gid_t dir_gid;
const char *origin, *dir_origin;
+ string_t *vname;
- if (name != NULL)
+ if (name != NULL) {
box->name = p_strdup(box->pool, name);
- else {
+ vname = t_str_new(128);
+ mail_namespace_get_vname(box->storage->user->namespaces,
+ vname, name);
+ box->vname = p_strdup(box->pool, str_c(vname));
+ } else {
i_assert(input != NULL);
box->name = "(read-only input stream)";
+ box->vname = box->name;
}
if (input != NULL) {
/* mailbox's MAILBOX_LIST_PATH_TYPE_MAILBOX */
const char *path;
+ /* mailbox's virtual name (from mail_namespace_get_vname()) */
+ const char *vname;
struct istream *input;
enum mailbox_flags flags;
unsigned int transaction_count;
return box->name;
}
+const char *mailbox_get_vname(const struct mailbox *box)
+{
+ return box->vname;
+}
+
bool mailbox_is_readonly(struct mailbox *box)
{
return box->v.is_readonly(box);
/* Returns name of given mailbox */
const char *mailbox_get_name(const struct mailbox *box) ATTR_PURE;
+/* Returns the virtual name of the given mailbox. This is the same as using
+ mail_namespace_get_vname(). */
+const char *mailbox_get_vname(const struct mailbox *box) ATTR_PURE;
/* Returns TRUE if mailbox is read-only. */
bool mailbox_is_readonly(struct mailbox *box);