Summary:ASTERISK-11477: Autocreate IMAP folders that don't exist
Reporter:James Rothenberger (jaroth)Labels:
Date Opened:2008-02-19 15:30:38.000-0600Date Closed:2008-02-19 18:46:14.000-0600
Versions:Frequency of
Environment:Attachments:( 0) createfolder.patch
Description:When saving messages to alternate folders (Friends, Family, Work, etc.), if the IMAP folders do not exist, they are now created automatically.  This code has been tested with Cyrus IMAP.
Comments:By: James Rothenberger (jaroth) 2008-02-19 15:31:08.000-0600

Patch included.

By: Mark Michelson (mmichelson) 2008-02-19 18:37:56.000-0600

The patch is fine, but I'm going to remove the bulk of the mm_notify callback addition that was made for this since the notice message that may be printed is not very useful.

Also, for future reference, if you want a case-insensitive comparison of the first x characters of a string, just use strncasecmp. It's more compact than comparing each individual character, it's less prone to typos, and it also is safer than the method you used (consider the case where the string passed in is less than 10 characters long).

Thanks for the patch!

By: Digium Subversion (svnbot) 2008-02-19 18:46:13.000-0600

Repository: asterisk
Revision: 103833

U   trunk/apps/app_voicemail.c

r103833 | mmichelson | 2008-02-19 18:46:10 -0600 (Tue, 19 Feb 2008) | 11 lines

When using IMAP storage, if the folder you attempt to save to does not exist,
create it first.

(closes issue ASTERISK-11477)
Reported by: jaroth
     createfolder.patch uploaded by jaroth (license 50)
Tested by: jaroth