Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 103809) +++ apps/app_voicemail.c (working copy) @@ -3474,11 +3474,20 @@ /* simple. huh? */ long res; char sequence[10]; + char mailbox[256]; /* if save to Old folder, just leave in INBOX */ if (box == 1) return 10; /* get the real IMAP message number for this message */ snprintf(sequence, sizeof(sequence), "%ld", vms->msgArray[msg]); + /* Create the folder if it don't exist */ + imap_mailbox_name(mailbox, sizeof(mailbox), vms, box, 1); /* Get the full mailbox name */ + ast_debug(5, "Checking if folder exists: %s\n",mailbox); + if (mail_create(vms->mailstream, mailbox) == NIL) + ast_debug(5, "Folder exists.\n"); + else + ast_log(LOG_NOTICE, "Folder %s created!\n",mbox(box)); + ast_debug(3, "Copying sequence %s to mailbox %s\n", sequence, mbox(box)); res = mail_copy(vms->mailstream, sequence, (char *)mbox(box)); if (res == 1) return 0; @@ -9454,6 +9465,20 @@ void mm_notify(MAILSTREAM * stream, char *string, long errflg) { + ast_debug(5, "Entering NOTIFY callback, errflag is %ld, string is %s\n", errflg, string); + if (!errflg && (string[0] == '[') && + ((string[1] == 'T') || (string[1] == 't')) && + ((string[2] == 'R') || (string[2] == 'r')) && + ((string[3] == 'Y') || (string[3] == 'y')) && + ((string[4] == 'C') || (string[4] == 'c')) && + ((string[5] == 'R') || (string[5] == 'r')) && + ((string[6] == 'E') || (string[6] == 'e')) && + ((string[7] == 'A') || (string[7] == 'a')) && + ((string[8] == 'T') || (string[8] == 't')) && + ((string[9] == 'E') || (string[9] == 'e')) && + (string[10] == ']')) { + ast_log(LOG_NOTICE, "Trycreate notification handled.\n"); + } mm_log (string, errflg); }