The IMAP storage thread

Hi everyone.

I wanted a thread where everyone would discuss their failed/successful attempts at using IMAP storage on Asterisk 1.4.

I know there’s a few guys here who try, including me, I’d like to know distro, version of asterisk (official or SVN latest), IMAP Server, patches applied to asterisk to make it work, version of c-client (UW-toolkit used to built), changes to UW-toolkit makefile etc.

Don’t forget to mention anything that might be event remotely significant, no matter how trivial, or how far-fetched it might seem.

As for me I’m on my n-th attempt, still very unsuccessful.

I’m always on Debian Etch.
Always build against UW imap-2006e (c-client files)

Attempt 1:

Asterisk official 1.4
Dovecot IMAP server w/ virtual SQL users
Unpatched
->Always unable to access the server

Attempt 2:

Asterisk official 1.4
Cyrus 2.1 IMAP server in Maildir format
Unpatched Asterisk
->Cyrus would barely even work, I ditched it pretty quick

Attempt 3:

Asterisk official 1.4
Courier-IMAP server in mbox format
Unpatched Asterisk
->Always unable to access the server

Attempt 4:

Asterisk official 1.4
Courier-IMAP server in Maildir format
Patched asterisk: bugs.digium.com/view.php?id=8808
Used: app_voicemail_minorfixes_take2_8808.diff
-> Same as before, unable to access server

Next up, going to try Dovecot again with the patch applied.

It’s the same error message over and over no matter the client, config, etc.

[Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:8345 mm_log: IMAP Error: Can't append to mailbox {localhost:143/imap/dude/novalidate-cert/user=dude}INBOX: invali d remote specification [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:2423 imap_store_file: Error while sending the message to {localhost:143/imap/dude/novalidate-cert/user=dude}INBOX [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:8345 mm_log: IMAP Error: Can't open mailbox {localhost:143/imap/dude/novalidate-cert/user=dude}INBOX: invalid rem ote specification [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:4632 init_mailstream: Can't connect to imap server {localhost:143/imap/dude/novalidate-cert/user=dude}INBOX [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:2538 inboxcount: IMAP mailstream is NULL [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:8345 mm_log: IMAP Error: Can't open mailbox {localhost:143/imap/dude/novalidate-cert/user=dude}INBOX: invalid rem ote specification [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:4632 init_mailstream: Can't connect to imap server {localhost:143/imap/dude/novalidate-cert/user=dude}INBOX [Jan 29 22:01:23] ERROR[3571]: app_voicemail.c:2538 inboxcount: IMAP mailstream is NULL

Any success stories around?

Retrying dovecot, still no luck, asterisk doesn’t even try to login to the server, which is kinda funny in a devastating kind of way.

It used to contact the server before I uninstalled dovecot, major whoops there.

It’s a daunting task for sure, it’s been more than a week trying already.

Hey,i’ve managed to make it work like that:

Asterisk 1.4
UW-Imap 2006e

I’ve made it without SSL support, as I’m still testing everything.
It is working, but there’s some bugs.

For the IMAP account, it’s using the OS user account, because it’s the simple way and as i said, I’m still testing ^^

I may have a solution for your problem, for the imapflags, change it to notls

imapflags=notls

It didn’t work for me when it was in “novalidate-cert”

If it still doesn’t work, try wihtout using the authuser & authpassword parameters in the voicemail.conf.

I’ve managed to make it work with Dovecot, so I can user “virtual” user account to access to the voicemail. Now I only have 1 problem left…

With dovecot & mbox format, you can’t create subfolder in folders, so you can’t create INBOX/Work, INBOX/Family…etc… And those are needed by Asterisk if you want to move your message using a phone.
I’ve looked into the code, trying to make it so it moves them to Work, Family instead of INBOX/Work…etc… But I haven’t found where to change that yet :frowning:

Then I tried with dovecot & maildir format. The problem with that is it says me it can’t access to the INBOX.Work …etc…

Do you have any solution? Does it work for you?

Yes! Success it works.

I was investigating bug #1, the duplicate messages. Somewhat odd, seems at some point I did not get two messages, but I might just be mistaken.

I put no email address in the mailbox string, but it still does it. Asterisk sends two messages regardless of the format chosen.

I’m really no expert on mail servers, so I’m dabbling. I’m using dovecot too.

I enabled SSL and the whole deal, and it’s easier to get to work with SSL than without SSL.

I guess in my case I only put messages in the inbox folder. I have no idea how to create folders for users, I should look into that.

(I use virtual users too)

I’ve tryed another installation.

I made it work with Courier-IMAP in Maildir format and using virtual users :smiley:

I still have the same problem when trying to move a voicemail of folder using a phone…But this time the error Asterisk reports is “IMAP Error: Error in IMAP command received by server.”

I’d like to try with mbox format, how do you change courier-IMAP to use mbox format instead of Maildir format?

I wouldn’t have any idea… I tried courier-imap, and I couldn’t really get it going, so I gave up on the idea. Dovecot seems like a pretty much perfect little imap server with clean and understandable config files and pretty much as full featured as the others.

Did you compile c-client with maildir support? I found something about changing the c-client makefile to enable it to work in maildir format.

Also, regarding your problem, I think asterisk is made to access IMAP through the use of a master user. If you are using imapasswd for your users this might be a cause for concern.

I prefer Dovecot also, but it doesn’t allow subfolder in mbox so I had to try something else. I tried c-client in maildir format with dovecot in maildir, but changing folder wasn’t working either :frowning:

Now I’m lost, I don’t know what to do anymore :stuck_out_tongue:

Back to dovecot for you. :smiley:

I’ve written down my experience with dovecot on Ubuntu edgy: Asterisk IMAP store for Voicemail