[Home]

Summary:ASTERISK-08569: IMAP storage does not work with c-client 2006
Reporter:Emmanuel BUU (neutrino88)Labels:
Date Opened:2007-01-12 13:10:05.000-0600Date Closed:2007-01-12 13:19:20.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Compiled app_voicemail with c-dlient 2006 as provided by Fedora Core 5 repository (uw-imap-devel-2006b-1.fc5)

1- I found out that mailbox specification as per UW c-client library was incorrectly generated when imapflag was set as empty in voicemail.conf. In that particular case, the mailbox specification was generated with a "//" in the middle and rejected by the library right away. See in additionnal info the fix I propose

2- even if this was corrected, the library itself seems to neogiciate incorrectly. It requests an AUTHENTICATE then the server reply with the challenge and for an uknown reason the lib abort the the command.


****** ADDITIONAL INFORMATION ******

Fix for incorrect mailbox specs (app_voicemail.c)

Change the function imap_mailbox_name() as follow.

static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int use
_folder)
{
       char tmp[256];

       if (box == 1) {
               ast_copy_string(vms->curbox, mbox(0), sizeof(vms->curbox));
               sprintf(vms->vmbox, "vm-%s", mbox(1));
       } else {
               ast_copy_string(vms->curbox, mbox(box), sizeof(vms->curbox));
               snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
       }

       snprintf(tmp, sizeof(tmp), "{%s:%s/imap", imapserver, imapport);

       if (strlen(authuser) > 0)
       {
               strncat(tmp, "/authuser=", sizeof(tmp));
               strncat(tmp, authuser, sizeof(tmp));
       }

       if (strlen(imapflags) > 0)
       {
               strncat(tmp, "/", sizeof(tmp));              
               strncat(tmp, imapflags, sizeof(tmp));
       }                                                    
                                                             
       strncat(tmp, "/user=", sizeof(tmp));                  
       strncat(tmp, vms->imapuser, sizeof(tmp));            
       strncat(tmp, "}", sizeof(tmp));                      
                                                             
       if(box == 0 || box == 1)                              
               sprintf(spec, "%s%s", tmp, use_folder? imapfolder: "INBOX");
       else                                                  
               sprintf(spec, "%s%s%c%s", tmp, imapfolder, delimiter, mbox(box));
}  
Logs

[Jan 12 19:42:55] DEBUG[8738]: app_voicemail.c:8593 vmstate_insert: Inserting vm_state for user:immo.traqueur, mailbox 997
[Jan 12 19:42:55] DEBUG[8738]: app_voicemail.c:4622 init_mailstream: vm_state user is:immo.traqueur
[Jan 12 19:42:55] DEBUG[8738]: app_voicemail.c:4624 init_mailstream: mailstream not set.
[Jan 12 19:42:55] DEBUG[8738]: app_voicemail.c:8344 mm_log: IMAP Info: Trying IP address [212.27.48.2]
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: * OK [CAPABILITY IMAP4REV1 X-NETSCAPE LOGIN-REFERRALS AUTH=LOGIN] imap.free.fr IMAP4rev1 2001.315/Proxad at Fri, 12 Jan 2007 19:56:18 +0100 (CET)
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: 00000000 AUTHENTICATE LOGIN
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: + VXNlciBOYW1lAA==
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: *
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: 00000000 BAD AUTHENTICATE LOGIN cancelled
[Jan 12 19:42:56] ERROR[8738]: app_voicemail.c:8351 mm_log: IMAP Error: IMAP protocol error: AUTHENTICATE LOGIN cancelled
[Jan 12 19:42:56] ERROR[8738]: app_voicemail.c:8351 mm_log: IMAP Error: IMAP Authentication cancelled
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: 00000001 LOGOUT
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: * BYE imap1-q.free.fr IMAP4rev1 server terminating connection
[Jan 12 19:42:56] NOTICE[8738]: app_voicemail.c:8359 mm_dlog: 00000001 OK LOGOUT completed
[Jan 12 19:42:56] ERROR[8738]: app_voicemail.c:4638 init_mailstream: Can't connect to imap server {imap.free.fr:143/imap/debug/user=immo.traqueur}INBOX
[Jan 12 19:42:56] ERROR[8738]: app_voicemail.c:2538 inboxcount: IMAP mailstream is NULL
Comments:By: Jason Parker (jparker) 2007-01-12 13:19:03.000-0600

I believe the patch in issue 8808 will fix this issue.  I'm going to close this for now since it's basically the same cause.