Summary:ASTERISK-13419: [patch] per-mailbox imapfolder option
Reporter:Jack Bates (jablko)Labels:
Date Opened:2009-01-21 11:16:54.000-0600Date Closed:2009-12-02 18:46:06.000-0600
Versions:Frequency of
Environment:Attachments:( 0) patch
( 1) patch-200906201
( 2) patch-200906202
Description:[ Link Removed - See Notes ]

I recently switched from file system to IMAP voicemail storage and it worked great for most users. Mostly I have a typical IMAP setup, so the defaults worked. I just set in voicemail.conf:


- then added "imapuser" to each mailbox:

6005 => 1234,Jack Bates,ms419@freezone.co.uk,,imapuser=jbates

One challenge was my general delivery mailbox, which I wanted stored in a shared IMAP mailbox. I tried to configure that as follows:

6000 => 1234,House,house@campcoop.com,,imapfolder=shared.house|imapuser=administrator

- but I got these errors:

[Jan  4 15:23:32] ERROR[3270] app_voicemail_imap.c: Error while sending the mess
age to {localhost:143/imap/authuser=administrator/user=administrator}INBOX

As I discovered, this was because Asterisk tried to store in the administrator user's INBOX, and my administrator user does not have an IMAP mailbox. In fact I wanted the message stored in the "shared.house" shared mailbox.

After a look at app_voicemail.c, I realized my problem was that "imapfolder" is a per-context option, not a per-mailbox option. However I want to set "imapfolder" for only one mailbox - the default, "INBOX", works otherwise.

So I created the linked patch to make "imapfolder" a per-mailbox option. Now the general delivery mailbox successfully stores messages in {localhost:143/imap/authuser=administrator/user=administrator}shared.house

To create this patch, I basically copied the code for "imapuser", which is a per-mailbox option, for "imapfolder"
Comments:By: Sean Bright (seanbright) 2009-01-22 09:30:37.000-0600

Thanks for the patch.

In order for us to review it for inclusion, you will need to upload the patch as an attachment to the bug after signing the license agreement.

Also, new features like this need to be coded against Asterisk trunk and not the 1.4 branch to be accepted.

By: Jack Bates (jablko) 2009-01-24 18:18:41.000-0600

Thanks, I have now signed the license agreement. I also updated the patch to Asterisk trunk, and attached it.

By: Tilghman Lesher (tilghman) 2009-02-20 18:08:09.000-0600

The code is far from sufficient.  You've missed several places where changing the folder would make a huge difference.  For example:

1) When selecting a mailbox from VoicemailMain, you will be unable to go back to the inbox, once left, because the mbox() function doesn't handle this change.

2) When checking the number of new messages for MWI, it does not check the set folder.  See inboxcount2().

By: Leif Madsen (lmadsen) 2009-04-03 09:38:58

jablko:  any update on this?

By: Leif Madsen (lmadsen) 2009-05-27 12:05:20

Closing due to lack of response from the reporter. Is a shame too, because this feature could have been pretty useful.

Please reopen the issue if you have the ability to move this issue forward. Thanks!

By: Jack Bates (jablko) 2009-06-20 22:12:12

I updated the mbox() signature to include ast_vm_user, and use vmu->imapfolder

I updated inboxcount2() to call find_user() and use vmu->imapfolder

By: Leif Madsen (lmadsen) 2009-06-22 09:32:17

Think you could provide an updated patch for review?

By: Leif Madsen (lmadsen) 2009-06-22 09:32:36

Which you just did... oops! :)  Thanks!

By: Digium Subversion (svnbot) 2009-12-02 18:45:40.000-0600

Repository: asterisk
Revision: 232700

U   trunk/CHANGES
U   trunk/apps/app_voicemail.c
U   trunk/configs/voicemail.conf.sample

r232700 | jpeeler | 2009-12-02 18:45:39 -0600 (Wed, 02 Dec 2009) | 10 lines

Extend voicemail to allow IMAP folders to be specified per mailbox.

Previously only possible per context, new option called imapfolder.

(closes issue ASTERISK-13419)
Reported by: jablko
     patch-200906202 uploaded by jablko (license 675)



By: Digium Subversion (svnbot) 2009-12-02 18:46:04.000-0600

Repository: asterisk
Revision: 232701

_U  branches/1.6.2/

r232701 | jpeeler | 2009-12-02 18:46:04 -0600 (Wed, 02 Dec 2009) | 15 lines

Blocked revisions 232700 via svnmerge

 r232700 | jpeeler | 2009-12-02 18:38:03 -0600 (Wed, 02 Dec 2009) | 10 lines
 Extend voicemail to allow IMAP folders to be specified per mailbox.
 Previously only possible per context, new option called imapfolder.
 (closes issue ASTERISK-13419)
 Reported by: jablko
       patch-200906202 uploaded by jablko (license 675)