Skip to content

Commit

Permalink
lib-storage: Return correct root path for PATH_TYPE_ALT_MAILBOX
Browse files Browse the repository at this point in the history
mailbox_list_set_get_root_path(..., MAILBOX_LIST_PATH_TYPE_ALT_MAILBOX, ...)
must return one of three values:

1. if there is no alt storage, return NULL
2. if there is alt storage and MAILBOXDIR is set,
	return ${alt_dir}/${mailbox_dir_name}
3. if there is alt storage but MAILBOXDIR is not set, return ${alt_dir}

Case number 3 was broken, and it mistakenly returned ${root_dir} - in other
words, it behaved as MAILBOX_LIST_PATH_TYPE_MAILBOX.

This correction changes the behavior, but this shouldn't cause
incompatibilities since:

1. it affects only storages that support alternate storage
2. it affects only configurations that use empty MAILBOXDIR

The only storage that supports alternate storage setting is dbox but dbox
defaults to MAILBOXDIR=mailboxes.  Additionally, it appears to be impossible
to override it to an empty string (setting it to an empty strings causes
dbox to override it with the default - "mailboxes").  Therefore, nobody
should be affected by this change.
  • Loading branch information
Josef 'Jeff' Sipek authored and sirainen committed May 15, 2018
1 parent 786bbdb commit a1f8998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-storage/mailbox-list.c
Expand Up @@ -1442,7 +1442,7 @@ bool mailbox_list_set_get_root_path(const struct mailbox_list_settings *set,
break;
case MAILBOX_LIST_PATH_TYPE_ALT_MAILBOX:
if (*set->mailbox_dir_name == '\0')
path = set->root_dir;
path = set->alt_dir;
else if (set->alt_dir != NULL) {
path = t_strconcat(set->alt_dir, "/",
set->mailbox_dir_name, NULL);
Expand Down

0 comments on commit a1f8998

Please sign in to comment.