test for alpine-2.22's c-client and cope with API change. parts borrowed from slackware patch for PHP with alpine-2.22. Index: apps/app_voicemail.c --- apps/app_voicemail.c.orig +++ apps/app_voicemail.c @@ -60,6 +60,9 @@ #include #include #include +#if defined (HAVE_IMAP_ALPINE2_22) +char *cpystr(const char *str); /* from c-client/misc.h but that has namespace problems */ +#endif #else #include "c-client.h" #include "imap4r1.h" @@ -3305,7 +3308,11 @@ void mm_dlog(char *string) } +#if defined(HAVE_IMAP_ALPINE2_22) +void mm_login(NETMBX * mb, char *user, char **pwd, long trial) +#else void mm_login(NETMBX * mb, char *user, char *pwd, long trial) +#endif { struct ast_vm_user *vmu; @@ -3315,22 +3322,41 @@ void mm_login(NETMBX * mb, char *user, char *pwd, long /* We should only do this when necessary */ if (!ast_strlen_zero(authpassword)) { +#if defined(HAVE_IMAP_ALPINE2_22) + *pwd = cpystr(authpassword); +#else ast_copy_string(pwd, authpassword, MAILTMPLEN); +#endif } else { AST_LIST_TRAVERSE(&users, vmu, list) { if (!strcasecmp(mb->user, vmu->imapuser)) { +#if defined(HAVE_IMAP_ALPINE2_22) + *pwd = cpystr(vmu->imappassword); +#else ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN); +#endif break; } } if (!vmu) { if ((vmu = find_user_realtime_imapuser(mb->user))) { +#if defined(HAVE_IMAP_ALPINE2_22) + *pwd = cpystr(vmu->imappassword); +#else ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN); +#endif free_user(vmu); } } } } + +#if defined(HAVE_IMAP_ALPINE2_22) +void mm_login_method(NETMBX *mb, char *user, void *pwd, long trial, char *method) +{ + return; +} +#endif void mm_critical(MAILSTREAM * stream)