Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 130693) +++ apps/app_voicemail.c (working copy) @@ -125,6 +125,7 @@ static char imapport[8]; static char imapflags[128]; static char imapfolder[64]; +static char imapparentfolder[64] = "\0"; static char greetingfolder[64]; static char authuser[32]; static char authpassword[42]; @@ -5944,8 +5945,14 @@ snprintf(spec, len, "%s%s", tmp, use_folder? imapfolder: "INBOX"); else if (box == GREETINGS_FOLDER) snprintf(spec, len, "%s%s", tmp, greetingfolder); - else - snprintf(spec, len, "%s%s%c%s", tmp, imapfolder, delimiter, mbox(box)); + else /* Other folders such as Friends, Family, etc... */ + /* Other Cyrus folders to NOT start with INBOX/ <-delimiter */ + if (!ast_strlen_zero(imapparentfolder)) { + /* imapparentfolder would typically be set to INBOX */ + snprintf(spec, len, "%s%s%c%s", tmp, imapparentfolder, delimiter, mbox(box)); + } else { + snprintf(spec, len, "%s%s", tmp, mbox(box)); + } } static int init_mailstream(struct vm_state *vms, int box) @@ -9447,6 +9454,7 @@ ucfg = ast_config_load("users.conf", config_flags); } + ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder)); /* set audio control prompts */ strcpy(listen_control_forward_key,DEFAULT_LISTEN_CONTROL_FORWARD_KEY); strcpy(listen_control_reverse_key,DEFAULT_LISTEN_CONTROL_REVERSE_KEY); @@ -9601,6 +9609,9 @@ } else { ast_copy_string(imapfolder,"INBOX", sizeof(imapfolder)); } + if ((val = ast_variable_retrieve(cfg, "general", "imapparentfolder"))) { + ast_copy_string(imapparentfolder, val, sizeof(imapparentfolder)); + } if ((val = ast_variable_retrieve(cfg, "general", "imapgreetings"))) { imapgreetings = ast_true(val); } else { Index: configs/voicemail.conf.sample =================================================================== --- configs/voicemail.conf.sample (revision 130693) +++ configs/voicemail.conf.sample (working copy) @@ -156,6 +156,11 @@ ; If imapgreetings=yes, then specify which folder to store your greetings in. If ; you do not specify a folder, then INBOX will be used ;greetingsfolder=INBOX +; Some IMAP server implementations store folders under INBOX instead of +; using a top level folder (ex. INBOX/Friends). In this case, user +; imapparentfolder to set the parent folder. For example, Cyrus IMAP does +; NOT use INBOX as the parent. +imapparentfolder=INBOX ; ; Users may be located in different timezones, or may have different ; message announcements for their introductory message when they enter