I thought I would give the new IMAP support a spin on my home server, but without much luck so far. Asterisk 1.4.0 Dovecot 0.99.14 Maildir format C-client 2006d The imap server is also the Asterisk server, so connections are on the localhost. The error posted to the logs is: IMAP Error: Can't open mailbox {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX: invalid remote specification Digging in the code and the c-client documentation the '//' is where additional flags would go. I've tried a number of the flags supported by the c-client library, but the results are the same. Has anyone managed to get IMAP working in Asterisk with Dovecotas the backend? Thanks, Dan
Dan Austin wrote:> I thought I would give the new IMAP support a spin on my home > server, but without much luck so far. > > Asterisk 1.4.0 > Dovecot 0.99.14 > Maildir format > C-client 2006d > > The imap server is also the Asterisk server, so connections are > on the localhost. > > The error posted to the logs is: > IMAP Error: Can't open mailbox > {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX: invalid remote > specification > > Digging in the code and the c-client documentation the '//' is where > additional flags would go. I've tried a number of the flags supported > by the c-client library, but the results are the same. > > Has anyone managed to get IMAP working in Asterisk with Dovecotas the > backend? > >I've been attempting the same with Cyrus and get the same results. The interesting thing is if I take the same string (like {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX) and plug it into the 'mtest' command from the c-client package, it works OK. I have not tried this with the production release with Asterisk. Only beta's 1-4. Mark
As an FYI, this has absolutely NOTHING AT ALL to do with Asterisk. Asterisk is a PBX application. Dovcot is an email application. They have nothing to do with each other. Asterisk is not a Linux distribution or operating system. I suggest that you ask your question on a more appropriate mailing list, but it seems as though you are so thourougly confused as to what is what, that you should probably pick up a beginners book on Linux and go from there. I know this may sound harsh, but trust me: you will be much better off in the long run if you educate yourself somewhat. To give you an idea on how far off you are, it would be like going into a car repair shop and asking about a furnace problem. While someone there may be able to help you, you went to the wrong place. On Wed, Dec 27, 2006 at 10:44:10AM -0800, Dan Austin said:> I thought I would give the new IMAP support a spin on my home > server, but without much luck so far. > > Asterisk 1.4.0 > Dovecot 0.99.14 > Maildir format > C-client 2006d > > The imap server is also the Asterisk server, so connections are > on the localhost. > > The error posted to the logs is: > IMAP Error: Can't open mailbox > {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX: invalid remote > specification > > Digging in the code and the c-client documentation the '//' is where > additional flags would go. I've tried a number of the flags supported > by the c-client library, but the results are the same. > > Has anyone managed to get IMAP working in Asterisk with Dovecotas the > backend? > > Thanks, > Dan > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- Walt Reed wreed@vinq.com Office: 207-753-7333 Cell: 207-577-0699 http://www.vinq.com
Mark wrote:> I've been attempting the same with Cyrus and get the same results.The> interesting thing is if I take the same string (like > {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX) and plug it > into the 'mtest' command from the c-client package, it works OK. Ihave> not tried this with the production release with Asterisk. Only beta's1-4. Thanks. I had not uncovered the mtest tool, and that was a great hint. It fails with: (127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX, Works up until certificate validation with (127.0.0.1:143/imap/authuser=root/user=dan_austin}INBOX And succeeds with: (127.0.0.1:143/imap/authuser=root/novalidate-cert/user=dan_austin}INBOX I had tried imapflags=novalidate-cert, but I only reloaded the voicemail Module. Perhaps a full restart is required, which I will try this afternoon. Dan
On Wed, Dec 27, 2006 at 10:44:10AM -0800, Dan Austin wrote:> I thought I would give the new IMAP support a spin on my home > server, but without much luck so far. > > Asterisk 1.4.0 > Dovecot 0.99.14 > Maildir format > C-client 2006dNot that I can be of much help, but: what is your MAILBOX env. set to in dovecot.conf?> > The imap server is also the Asterisk server, so connections are > on the localhost. > > The error posted to the logs is: > IMAP Error: Can't open mailbox > {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX: invalid remote > specificationWhat exactly passes on the wire? Can you get a dump of the session? I have a feeling that the imap client is supposed to take this string and interpert it into some parameters.> > Digging in the code and the c-client documentation the '//' is where > additional flags would go. I've tried a number of the flags supported > by the c-client library, but the results are the same. > > Has anyone managed to get IMAP working in Asterisk with Dovecotas the > backend?One useful tool dovecot borrowd from uw-imapd is "pre-authentication": you can use the binaries in /usr/libexec/dovecot to start an imap (or pop3) session with the permission of the relevant user. authuser=root ? -- Tzafrir Cohen icq#16849755 jabber:tzafrir@jabber.org +972-50-7952406 mailto:tzafrir.cohen@xorcom.com http://www.xorcom.com iax:guest@local.xorcom.com/tzafrir
Dan, I have IMAP support working now with Courier IMAP. Since Courier (and probably Dovecot) do not support a single authuser connection that may access any mailbox, you have to omit the 'authuser' and 'authpassword' settings in voicemail.conf and then add the username/password login per extension... e.g. [general] ... imapserver=localhost imapport=143 imapflags=novalidate-cert expungeonhangup=yes ... [default] 1234 => 1234,Fred,fred@blah.com,,imapuser=fred|imappassword=fredspasswd 4321 => 4321,Bill,bill@blah.com,,imapuser=bill|imappassword=billspasswd I couldn't get Realtime voicemail support working using the imapuser or imappassword - only via the flat-file, although I have a patch that I am testing that will allow the imapuser and imappassword settings to be retrieved from Realtime. The key thing to remember is that you MUST remove any authuser/authpassword setting in voicemail.conf, otherwise it doesn't even look for the imapuser/imappassword settings per user. Cheers, Ray Dan Austin wrote:> I thought I would give the new IMAP support a spin on my home > server, but without much luck so far. > > Asterisk 1.4.0 > Dovecot 0.99.14 > Maildir format > C-client 2006d > > The imap server is also the Asterisk server, so connections are > on the localhost. > > The error posted to the logs is: > IMAP Error: Can't open mailbox > {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX: invalid remote > specification > > Digging in the code and the c-client documentation the '//' is where > additional flags would go. I've tried a number of the flags supported > by the c-client library, but the results are the same. > > Has anyone managed to get IMAP working in Asterisk with Dovecotas the > backend? > > Thanks, > Dan > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users----------------------------------------------------------------------------------------------- This message and any attachments contain privileged and confidential information. If you are not the intended recipient of this message, you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error please notify the sender immediately via email and then destroy this message and any attachments.
Walt wrote:> Dan, Please accept my sincerest appology. I had my head thoroughly upmy> back orifice. I haven't kept up with the new IMAP feature in 1.4....Don't sweat it... I saw your first post before going out for the day with the family, and couldn't figure out how it wasn't related to Asterisk. Glad I waited to respond until after I got back...> I'll go back in my corner now.... :-)Thanks, Dan
Tzafrir wrote:> On Wed, Dec 27, 2006 at 10:44:10AM -0800, Dan Austin wrote: >> I thought I would give the new IMAP support a spin on my home >> server, but without much luck so far. >> >> Asterisk 1.4.0 >> Dovecot 0.99.14 >> Maildir format >> C-client 2006d> Not that I can be of much help, but:> what is your MAILBOX env. set to in dovecot.conf?No customization at all. The MailDir folders are in my home directory (more below)> >> The imap server is also the Asterisk server, so connections are >> on the localhost. > >> The error posted to the logs is: >> IMAP Error: Can't open mailbox >> {127.0.0.1:143/imap/authuser=root//user=dan_austin}INBOX: invalidremote>> specification> What exactly passes on the wire? Can you get a dump of the session?I am connecting over the localhost loopback, I might be able to get a dump, I've honestly never tried a capture against 127.0.0.1> I have a feeling that the imap client is supposed to take this string > and interpert it into some parameters.Yes, and I think I found the culprit.> >> Digging in the code and the c-client documentation the '//' is where >> additional flags would go. I've tried a number of the flagssupported>> by the c-client library, but the results are the same. > >> Has anyone managed to get IMAP working in Asterisk with Dovecotas the >> backend?With the mtest tool in the c-client package, I found that dovecot does not like the '//' in the connection string. So imapflags is not really optional against Dovecot, which has an easy work-around. I'd Guess that the code in app_voicemail should either use a sane default for the imapflags or conditionally not include the second '/' if the option is not set.> One useful tool dovecot borrowd from uw-imapd is "pre-authentication": > you can use the binaries in /usr/libexec/dovecot to start an imap (or > Pop3) session with the permission of the relevant user.> authuser=root ?Yeah, in the real world that would be exceedingly stupid. On the other hand this is basically a single user system with not much interesting on it. Once it is known to work with the all-powerful root, I can then focus on a dedicated, less privileged account... Thanks, Dan
Tzafrir wrote:> On Thu, Dec 28, 2006 at 12:35:57PM +1300, Ray Jackson wrote: >> Dan, >> >> I have IMAP support working now with Courier IMAP. Since Courier(and>> probably Dovecot) do not support a single authuser connection thatmay>> access any mailbox, you have to omit the 'authuser' and'authpassword'>> settings in voicemail.conf and then add the username/password loginper>> extension... e.g.> Are you sure that this is an explicit support in the mail server?> Here's what Mark Crispin (the author of both UW-imapd and c-client) > wrote recently:>| > Does UW-IMAP have an admin user? If so, where is it configured? >| >| It's hidden in the release notes file. >| >| Any user who is in a UNIX group called "mailadm" has administrator >| rights in UW imapd and ipop3d. "Administrator rights" are the rightto>| log in as any other user. >| >| For c-client based client programs (mailutil, Pine, Alpine, etc.),the>| /authuser flag is used by the mail administrator. For example the >| mailbox name specifier: >| >| {imap.example.com/authuser=fred/user=joe}INBOX >| >| will open a connection to imap.example.com and log in as user >| joe using user fred's password, and then open joe's INBOX. Thisassumes>| that user fred is in group mailadm on the imap.example.com.Fedora does not have a mailadm group, or at least did not when I installed this system, but this was yet another good clue.> So can you do this trick manually? authenticate as one user and read > another user's mailbox?> Here's an example with root and pre-authentication. I figure that some > tricks with pam and such will get you further:> root@server# MAIL=maildir:/home/tzafrir/Maildir /usr/lib/dovecot/imap > * PREAUTH [CAPABILITY IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND > * UNSELECT LITERAL+ IDLE CHILDREN LISTEXT LIST-SUBSCRIBED NAMESPACE] > * Logged in as root > 1 list "" "*" > * LIST (\HasNoChildren) "." INBOX > 1 OK List completed. > 2 select INBOX > * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) > * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] > * Flags permitted. > * 0 EXISTS > * 0 RECENT > * OK [UIDVALIDITY 1161851409] UIDs valid > * OK [UIDNEXT 1] Predicted next UID > 2 OK [READ-WRITE] Select completed. > * logout > * BYE Logging out > * OK Logout completed.I played around with mtest in the c-client package somemore and found that Dovecot does not permit root logons period. So I added a basic Unprivilaged account and set the authuser/authpassword in voicemail.conf to use that account. Now it works, except maybe the expunge bit, which is likely a config issue.> This is dovecot 0.99.14 on Debian Sarge. Note that I actually don'tuse> that imap mailbox normally.Thanks to everyone for the help. I'm looking forward to some of the IMAP enhancements listed in the bugtracker. My mother-in-law has an extension on my system, but no mailbox, so I would love to have her extension use legacy VM and my wife and I get the new IMAP storage. Dan