CVS update: php3/functions

From: Date: Fri, 02 Jul 1999 21:05:17 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-8022@lists.php.net to get a copy of this message
Date: Friday July 2, 1999 @ 17:05 Author: musone Update of /repository/php3/functions In directory php:/tmp/cvs-serv1889 Modified Files: imap.c imap.h Log Message: ===== Chuck Hagenbuch ===== - the \\Draft flag is included in the flags returned by imap_header, etc. - there are two new list functions, imap_getmailboxes() and imap_getsubscribed(). These return arrays of objects, and the objects contain the name of the mailbox, the hierarchy delimiter for that part of the namespace, and the mailbox attributes. These flags are essential for figuring out anything much about mailboxes. - there is a new constant, SA_ALL, that can be passed to imap_status in order to populate all the members of the returned object. - there are now imap_errors() and imap_last_error() functions. imap_errors returns an array containing all of the errors since the page started or since imap_errors() was last called. imap_errors() clears the error stack when it's called. imap_last_error() simply returns the last error that occurred; it does NOT clear the error stack. - imap_alerts() behaves exactly like imap_errors() wrt behavior, but it acts on the alert list. Previously [ALERT] messages were not accessible from PHP; the IMAP spec requires that be passed onto the user. This function allows the script author the option of doing so. Finally, I tried to write an end_request function that would output any errors and alerts that hadn't been gotten with imap_errors/imap_alerts() (alerts at E_NOTICE level, errors at their original level), but imap_end_request() doesn't seem to get called. Is output not allowed from the end_request() function? =========== ===== Andrew Skalski ===== - Added preliminary support for persistent IMAP connections (through the imap_popen() API call). However, this requires a custom patch to the IMAP server, since IMAP only allows one login per connection. - Added status queries for SA_QUOTA and SA_QUOTA_ALL if they are supported. =========== Index: php3/functions/imap.c diff -u php3/functions/imap.c:1.56 php3/functions/imap.c:1.57 --- php3/functions/imap.c:1.56 Tue Mar 30 06:25:04 1999 +++ php3/functions/imap.c Fri Jul 2 17:05:17 1999 @@ -29,9 +29,11 @@ | Kaj-Michael Lang <milang@tal.org> | | Antoni Pamies Olive <toni@readysoft.net> | | Rasmus Lerdorf <rasmus@lerdorf.on.ca> | + | Chuck Hagenbuch <chagenbu@wso.williams.edu> | + | Andrew Skalski <askalski@chekinc.com> | +----------------------------------------------------------------------+ */ -/* $Id: imap.c,v 1.56 1999/03/30 11:25:04 rasmus Exp $ */ +/* $Id: imap.c,v 1.57 1999/07/02 21:05:17 musone Exp $ */ #define IMAP41 @@ -82,11 +84,6 @@ #define PHP_EXPUNGE 32768 -/* - * this array should be set up as: - * {"PHPScriptFunctionName",dllFunctionName,1} - */ - /* type casts left out, put here to remove warnings in msvc */ @@ -102,12 +99,41 @@ typedef struct php3_imap_le_struct { MAILSTREAM *imap_stream; long flags; +#ifdef OP_RELOGIN + /* AJS: busy flag for persistent connections */ + unsigned char busy; +#endif } pils; +typedef struct php3_imap_mailbox_struct { + SIZEDTEXT text; + DTYPE delimiter; + long attributes; + struct php3_imap_mailbox_struct *next; +} FOBJECTLIST; + +typedef struct php3_imap_error_struct { + SIZEDTEXT text; + long errflg; + struct php3_imap_error_struct *next; +} ERRORLIST; + + MAILSTREAM *mail_close_it (pils *imap_le_struct); +#ifdef OP_RELOGIN +/* AJS: close persistent connection */ +MAILSTREAM *mail_phalfclose_it (pils *imap_le_struct); +MAILSTREAM *mail_pclose_it (pils *imap_le_struct); +#endif +/* + * this array should be set up as: + * {"PHPScriptFunctionName",dllFunctionName,1} + */ + function_entry imap_functions[] = { {"imap_open", php3_imap_open, NULL}, + {"imap_popen", php3_imap_popen, NULL}, {"imap_reopen", php3_imap_reopen, NULL}, {"imap_num_msg", php3_imap_num_msg, NULL}, {"imap_num_recent", php3_imap_num_recent, NULL}, @@ -128,8 +154,10 @@ {"imap_renamemailbox", php3_imap_renamemailbox, NULL}, {"imap_deletemailbox", php3_imap_deletemailbox, NULL}, {"imap_listmailbox", php3_imap_list, NULL}, + {"imap_getmailboxes", php3_imap_list_full, NULL}, {"imap_scanmailbox", php3_imap_listscan, NULL}, {"imap_listsubscribed", php3_imap_lsub, NULL}, + {"imap_getsubscribed", php3_imap_lsub_full, NULL}, {"imap_subscribe", php3_imap_subscribe, NULL}, {"imap_unsubscribe", php3_imap_unsubscribe, NULL}, {"imap_append", php3_imap_append, NULL}, @@ -157,12 +185,20 @@ {"imap_bodystruct", php3_imap_bodystruct, NULL}, {"imap_fetch_overview", php3_imap_fetch_overview, NULL}, {"imap_mail_compose", php3_imap_mail_compose, NULL}, + {"imap_alerts", php3_imap_alerts, NULL}, + {"imap_errors", php3_imap_errors, NULL}, + {"imap_last_error", php3_imap_last_error, NULL}, {NULL, NULL, NULL} }; +#ifdef OP_RELOGIN +#define IS_STREAM(ind_type) ((ind_type)==le_imap || (ind_type)==le_pimap) +#else +#define IS_STREAM(ind_type) ((ind_type)==le_imap) +#endif php3_module_entry php3_imap_module_entry = { - IMAPVER, imap_functions, imap_init, NULL, NULL, NULL,imap_info, 0, 0, 0, NULL + IMAPVER, imap_functions, imap_init, NULL, imap_init_request, imap_end_request, imap_info, 0, 0, 0, NULL }; @@ -170,22 +206,43 @@ DLEXPORT php3_module_entry *get_module(void) { return &php3_imap_module_entry; } #endif +/* Determines how mm_list() and mm_lsub() are to return their results. */ +typedef enum { + FLIST_ARRAY, + FLIST_OBJECT +} folderlist_style_t; + /* I beleive since this global is used ONLY within this module, and nothing will link to this module, we can use the simple thread local storage */ int le_imap; +#ifdef OP_RELOGIN +/* AJS: persistent connection type */ +int le_pimap; +#endif char imap_user[80]=""; char imap_password[80]=""; STRINGLIST *imap_folders=NIL; STRINGLIST *imap_sfolders=NIL; +STRINGLIST *imap_alertstack=NIL; +ERRORLIST *imap_errorstack=NIL; +FOBJECTLIST *imap_folder_objects=NIL; +FOBJECTLIST *imap_sfolder_objects=NIL; +folderlist_style_t folderlist_style = FLIST_ARRAY; long status_flags; unsigned long status_messages; unsigned long status_recent; unsigned long status_unseen; unsigned long status_uidnext; unsigned long status_uidvalidity; +#ifdef SA_QUOTA +unsigned long status_quota; +#endif +#ifdef SA_QUOTA_ALL +unsigned long status_quota_all; +#endif MAILSTREAM *mail_close_it (pils *imap_le_struct) { @@ -195,6 +252,34 @@ return ret; } +#ifdef OP_RELOGIN +/* AJS: stream close functions for persistent connections */ +MAILSTREAM *mail_phalfclose_it (pils *imap_le_struct) +{ + /* Close this user's session, putting the stream back + * into AUTHENTICATE state. (Note that IMAP does not + * support this behavior... yet) + */ + imap_le_struct->busy = 0; + return mail_close_full( + imap_le_struct->imap_stream, + imap_le_struct->flags | CL_HALF); +} + +MAILSTREAM *mail_pclose_it (pils *imap_le_struct) +{ + /* Standard stream close, except that the imap_le_struct + * is free()'d rather than efree()'d. + */ + MAILSTREAM *ret; + ret = mail_close_full( + imap_le_struct->imap_stream, + imap_le_struct->flags); + free(imap_le_struct); + return ret; +} +#endif + inline int add_assoc_object(pval *arg, char *key, pval tmp) { return _php3_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(pval), NULL); @@ -206,6 +291,88 @@ } +/* Mail instantiate FOBJECTLIST + * Returns: new FOBJECTLIST list + * Author: CJH + */ +FOBJECTLIST *mail_newfolderobjectlist (void) { + return (FOBJECTLIST *) memset(fs_get(sizeof(FOBJECTLIST)),0, + sizeof(FOBJECTLIST)); +} + + +/* Mail garbage collect FOBJECTLIST + * Accepts: pointer to FOBJECTLIST pointer + * Author: CJH + */ +void mail_free_foblist (FOBJECTLIST **foblist) +{ + if (*foblist) { /* only free if exists */ + if ((*foblist)->text.data) fs_give ((void **) &(*foblist)->text.data); + mail_free_foblist (&(*foblist)->next); + fs_give ((void **) foblist); /* return string to free storage */ + } +} + + +/* Mail instantiate ERRORLIST + * Returns: new ERRORLIST list + * Author: CJH + */ +ERRORLIST *mail_newerrorlist (void) { + return (ERRORLIST *) memset(fs_get(sizeof(ERRORLIST)),0, + sizeof(ERRORLIST)); +} + +/* Mail garbage collect FOBJECTLIST + * Accepts: pointer to FOBJECTLIST pointer + * Author: CJH + */ +void mail_free_errorlist (ERRORLIST **errlist) +{ + if (*errlist) { /* only free if exists */ + if ((*errlist)->text.data) fs_give ((void **) &(*errlist)->text.data); + mail_free_errorlist (&(*errlist)->next); + fs_give ((void **) errlist); /* return string to free storage */ + } +} + + +/* Author: CJH */ +int imap_init_request (INIT_FUNC_ARGS) { + imap_errorstack = NIL; + imap_alertstack = NIL; + return SUCCESS; +} + +/* Author: CJH */ +int imap_end_request () { + ERRORLIST *ecur = NIL; + STRINGLIST *acur = NIL; + + if (imap_errorstack != NIL) { + /* output any remaining errors at their original error level */ + ecur = imap_errorstack; + while (ecur != NIL) { + php3_error(ecur->errflg, ecur->LTEXT); + ecur = ecur->next; + } + mail_free_errorlist(&imap_errorstack); + } + + if (imap_alertstack != NIL) { + /* output any remaining alerts at E_NOTICE level */ + acur = imap_alertstack; + while (acur != NIL) { + php3_error(E_NOTICE, acur->LTEXT); + acur = acur->next; + } + mail_free_stringlist(&imap_alertstack); + } + + return SUCCESS; +} + void imap_info(void) { php3_printf("Imap Support enabled<br>"); @@ -221,6 +388,9 @@ int imap_init(INIT_FUNC_ARGS) { + unsigned long sa_all = SA_MESSAGES | SA_RECENT | SA_UNSEEN | + SA_UIDNEXT | SA_UIDVALIDITY; + #if !(WIN32|WINNT) mail_link(&unixdriver); /* link in the unix driver */ #endif @@ -342,8 +512,19 @@ /* next UID to be assigned */ REGISTER_MAIN_LONG_CONSTANT("SA_UIDVALIDITY",SA_UIDVALIDITY , CONST_PERSISTENT | CONST_CS); /* UID validity value */ - - +#ifdef SA_QUOTA + sa_all |= SA_QUOTA; + REGISTER_MAIN_LONG_CONSTANT("SA_QUOTA",SA_QUOTA , CONST_PERSISTENT | CONST_CS); + /* Disk space taken up by mailbox. */ +#endif +#ifdef SA_QUOTA_ALL + sa_all |= SA_QUOTA_ALL; + REGISTER_MAIN_LONG_CONSTANT("SA_QUOTA_ALL",SA_QUOTA_ALL , CONST_PERSISTENT | CONST_CS); + /* Disk space taken up by all mailboxes owned by user. */ +#endif + REGISTER_MAIN_LONG_CONSTANT("SA_ALL", sa_all, CONST_PERSISTENT | CONST_CS); + /* get all status information */ + /* Bits for mm_list() and mm_lsub() */ REGISTER_MAIN_LONG_CONSTANT("LATT_NOINFERIORS",LATT_NOINFERIORS , CONST_PERSISTENT | CONST_CS); @@ -402,12 +583,14 @@ */ le_imap = register_list_destructors(mail_close_it,NULL); +#ifdef OP_RELOGIN + /* AJS: destructors for persistent connections */ + le_pimap = register_list_destructors(mail_phalfclose_it,mail_pclose_it); +#endif return SUCCESS; } -/* {{{ proto int imap_open(string mailbox, string user, string password [, int options]) - Open an IMAP stream to a mailbox */ -void php3_imap_open(INTERNAL_FUNCTION_PARAMETERS) +void php3_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) { pval *mailbox; pval *user; @@ -415,48 +598,173 @@ pval *options; MAILSTREAM *imap_stream; pils *imap_le_struct; + list_entry new_le; + list_entry *le; long flags=NIL; long cl_flags=NIL; - +#ifdef OP_RELOGIN + NETMBX netmbx; +#endif int ind; int myargc=ARG_COUNT(ht); + if (myargc <3 || myargc >4 || getParameters(ht, myargc, &mailbox,&user,&passwd,&options) == FAILURE) { WRONG_PARAM_COUNT; - } else { - convert_to_string(mailbox); - convert_to_string(user); - convert_to_string(passwd); - if(myargc ==4) { - convert_to_long(options); - flags = options->value.lval; - if(flags & PHP_EXPUNGE) { - cl_flags = CL_EXPUNGE; - flags ^= PHP_EXPUNGE; + } + + convert_to_string(mailbox); + convert_to_string(user); + convert_to_string(passwd); + if(myargc ==4) { + convert_to_long(options); + flags = options->value.lval; + if(flags & PHP_EXPUNGE) { + cl_flags = CL_EXPUNGE; + flags ^= PHP_EXPUNGE; + } + } + strcpy(imap_user,user->value.str.val); + strcpy(imap_password,passwd->value.str.val); + +#ifdef OP_RELOGIN + /* AJS: persistent connection handling */ + /* Cannot use a persistent connection if we cannot parse + * out the server's hostname. + */ + if ( persistent && + !mail_valid_net_parse(mailbox->value.str.val, &netmbx)) + { + persistent = 0; + } + + imap_stream = NIL; + le = NULL; + if (persistent) { + /* Check for an existing connection. */ + if ((_php3_hash_find( plist, + netmbx.host, + strlen(netmbx.host) + 1, + (void**) &le) == FAILURE) + || (le->type != le_pimap)) + { + le = NULL; + } + + /* Re-use existing connection if available. */ + if (le) { + imap_le_struct = (pils*) le->ptr; + if (imap_le_struct->busy) { + /* This connection is in use right now. */ + le = NULL; } + else { + /* Login with a new username/password. */ + imap_stream = mail_open( + imap_le_struct->imap_stream, + mailbox->value.str.val, + flags | OP_RELOGIN); + if (imap_stream) { + /* Ping the stream to see if it is + * still good. + */ + if (!mail_ping(imap_stream)) { + mail_close(imap_stream); + imap_stream = NIL; + } + } + } } - strcpy(imap_user,user->value.str.val); - strcpy(imap_password,passwd->value.str.val); - imap_stream = NIL; - imap_stream = mail_open(imap_stream,mailbox->value.str.val,flags); + + /* Did we find a valid stream? */ + if (imap_stream == NIL) { + /* Open a new connection. */ + imap_stream = mail_open( + NIL, + mailbox->value.str.val, + flags | OP_RELOGIN); + if (imap_stream == NIL) { + /* XXX if (le) { remove_from_hash; } */ + RETURN_FALSE; + } + + if (le) { + /* Reuse existing hash entry. */ + imap_le_struct = (pils*) le->ptr; + } + else { + /* Alloc new hash entry. */ + imap_le_struct = malloc(sizeof(pils)); + new_le.type = le_pimap; + new_le.ptr = imap_le_struct; + } + } + + /* Initialize the imap_le_struct */ + imap_le_struct->busy = 1; + imap_le_struct->imap_stream = imap_stream; + imap_le_struct->flags = cl_flags; - if (imap_stream == NIL){ - php3_error(E_WARNING,"Couldn't open stream %s\n",mailbox->value.str.val); + /* Add to hash if not there already. */ + if (!le && _php3_hash_update( + plist, + netmbx.host, + strlen(netmbx.host) + 1, + (void*) &new_le, + sizeof(list_entry), + NULL) == FAILURE) + { + mail_close(imap_stream); + free(imap_le_struct); RETURN_FALSE; } - /* Note that if we ever come up with a persistent imap stream, the persistent version of this - struct needs to be malloc'ed and not emalloc'ed */ + } + else { +#endif + imap_stream = mail_open(NIL, mailbox->value.str.val, flags); + if (imap_stream == NIL) { + php3_error(E_WARNING, + "Couldn't open stream %s\n", + mailbox->value.str.val); + RETURN_FALSE; + } + imap_le_struct = emalloc(sizeof(pils)); imap_le_struct->imap_stream = imap_stream; imap_le_struct->flags = cl_flags; +#ifdef OP_RELOGIN + } + + if (persistent) + ind = php3_list_insert(imap_le_struct, le_pimap); + else +#endif ind = php3_list_insert(imap_le_struct, le_imap); - RETURN_LONG(ind); - } - return; + RETURN_LONG(ind); } + +/* {{{ proto int imap_open(string mailbox, string user, string password [, int options]) + Open an IMAP stream to a mailbox */ +void php3_imap_open(INTERNAL_FUNCTION_PARAMETERS) +{ + php3_imap_do_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); +} /* }}} */ +/* {{{ proto int imap_popen(string mailbox, string user, string password [, int options]) + Open an IMAP stream to a mailbox */ +void php3_imap_popen(INTERNAL_FUNCTION_PARAMETERS) +{ +#ifdef OP_RELOGIN + php3_imap_do_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); +#else + php3_error(E_WARNING, "Persistent IMAP connections are not yet supported.\n"); + RETURN_FALSE; +#endif +} +/* }}} */ + /* {{{ proto int imap_reopen(int stream_id, string mailbox [, int options]) Reopen IMAP stream to new mailbox */ void php3_imap_reopen(INTERNAL_FUNCTION_PARAMETERS) @@ -478,7 +786,7 @@ convert_to_long(streamind); ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -524,7 +832,7 @@ imap_le_struct = (pils *)php3_list_find( ind, &ind_type ); - if ( !imap_le_struct || ind_type != le_imap ) { + if ( !imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -558,7 +866,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -583,7 +891,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find( ind, &ind_type ); - if ( !imap_le_struct || ind_type != le_imap ) { + if ( !imap_le_struct || !IS_STREAM(ind_type)) { php3_error( E_WARNING, "Unable to find stream pointer" ); RETURN_FALSE; } @@ -604,7 +912,7 @@ convert_to_long(streamind); ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -630,7 +938,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -657,7 +965,7 @@ convert_to_long(streamind); ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -698,7 +1006,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -716,6 +1024,7 @@ tmp[2] = cache->flagged ? 'F' : ' '; tmp[3] = cache->answered ? 'A' : ' '; tmp[4] = cache->deleted ? 'D' : ' '; + tmp[5] = cache->draft ? 'X' : ' '; sprintf (tmp+5,"%4ld) ",cache->msgno); mail_date (tmp+11,cache); tmp[17] = ' '; @@ -759,7 +1068,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -786,7 +1095,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -814,7 +1123,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -846,7 +1155,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -880,7 +1189,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -915,7 +1224,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -945,7 +1254,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -969,7 +1278,10 @@ int ind, ind_type; pils *imap_le_struct; STRINGLIST *cur=NIL; - + + /* set flag for normal, old mailbox list */ + folderlist_style = FLIST_ARRAY; + if (ARG_COUNT(ht)!=3 || getParameters(ht,3,&streamind,&ref,&pat) == FAILURE) { WRONG_PARAM_COUNT; @@ -982,7 +1294,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1001,6 +1313,68 @@ } /* }}} */ + +/* {{{ proto array imap_getmailboxes(int stream_id, string ref, string pattern) + Reads the list of mailboxes and returns a full array of objects containing name, attributes, and delimiter. */ +/* Author: CJH */ +void php3_imap_list_full(INTERNAL_FUNCTION_PARAMETERS) +{ + pval *streamind, *ref, *pat, mboxob; + int ind, ind_type; + pils *imap_le_struct; + FOBJECTLIST *cur=NIL; + char *delim=NIL; + + + /* set flag for new, improved array of objects mailbox list */ + folderlist_style = FLIST_OBJECT; + + if (ARG_COUNT(ht)!=3 + || getParameters(ht,3,&streamind,&ref,&pat) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(streamind); + convert_to_string(ref); + convert_to_string(pat); + + ind = streamind->value.lval; + + imap_le_struct = (pils *)php3_list_find(ind, &ind_type); + if (!imap_le_struct || !IS_STREAM(ind_type)) { + php3_error(E_WARNING, "Unable to find stream pointer"); + RETURN_FALSE; + } + + imap_folder_objects = NIL; + mail_list(imap_le_struct->imap_stream,ref->value.str.val,pat->value.str.val); + if (imap_folder_objects == NIL) { + RETURN_FALSE; + } + array_init(return_value); + delim = emalloc(2 * sizeof(char)); + cur=imap_folder_objects; + while (cur != NIL ) { + object_init(&mboxob); + add_property_string(&mboxob, "name", cur->LTEXT,1); + add_property_long(&mboxob, "attributes", cur->attributes); +#ifdef IMAP41 + delim[0] = (char)cur->delimiter; + delim[1] = 0; + add_property_string(&mboxob, "delimiter", delim, 1); +#else + add_property_string(&mboxob, "delimiter", cur->delimiter, 1); +#endif + add_next_index_object(return_value, mboxob); + cur=cur->next; + } + mail_free_foblist(&imap_folder_objects); + efree(delim); + folderlist_style = FLIST_ARRAY; /* reset to default */ +} +/* }}} */ + + /* {{{ proto array imap_scanmailbox(int stream_id, string ref, string pattern, string content) An alias for imap_scan */ /* }}} */ @@ -1026,7 +1400,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1063,7 +1437,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1103,7 +1477,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1131,7 +1505,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1177,7 +1551,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1486,6 +1860,7 @@ add_property_string(return_value,"Flagged",cache->flagged ? "F" : " ",1); add_property_string(return_value,"Answered",cache->answered ? "A" : " ",1); add_property_string(return_value,"Deleted",cache->deleted ? "D" : " ",1); + add_property_string(return_value,"Draft",cache->draft ? "X" : " ",1); sprintf (dummy,"%4ld",cache->msgno); add_property_string(return_value,"Msgno",dummy,1); mail_date (dummy,cache); @@ -1523,6 +1898,9 @@ pils *imap_le_struct; STRINGLIST *cur=NIL; + /* set flag for normal, old mailbox list */ + folderlist_style = FLIST_ARRAY; + if (ARG_COUNT(ht)!=3 || getParameters(ht,3,&streamind,&ref,&pat) == FAILURE) { WRONG_PARAM_COUNT; } @@ -1534,7 +1912,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1553,6 +1931,67 @@ } /* }}} */ + +/* {{{ proto array imap_getsubscribed(int stream_id, string ref, string pattern) + Return a list of subscribed mailboxes */ +/* Author: CJH */ +void php3_imap_lsub_full(INTERNAL_FUNCTION_PARAMETERS) +{ + pval *streamind, *ref, *pat, mboxob; + int ind, ind_type; + pils *imap_le_struct; + FOBJECTLIST *cur=NIL; + char *delim=NIL; + + delim = emalloc(2 * sizeof(char)); + + /* set flag for new, improved array of objects list */ + folderlist_style = FLIST_OBJECT; + + if (ARG_COUNT(ht)!=3 || getParameters(ht,3,&streamind,&ref,&pat) == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(streamind); + convert_to_string(ref); + convert_to_string(pat); + + ind = streamind->value.lval; + + imap_le_struct = (pils *)php3_list_find(ind, &ind_type); + if (!imap_le_struct || !IS_STREAM(ind_type)) { + php3_error(E_WARNING, "Unable to find stream pointer"); + RETURN_FALSE; + } + + imap_sfolder_objects = NIL; + mail_lsub(imap_le_struct->imap_stream,ref->value.str.val,pat->value.str.val); + if (imap_sfolder_objects == NIL) { + RETURN_FALSE; + } + array_init(return_value); + cur=imap_sfolder_objects; + while (cur != NIL ) { + object_init(&mboxob); + add_property_string(&mboxob, "name", cur->LTEXT, 1); + add_property_long(&mboxob, "attributes", cur->attributes); +#ifdef IMAP41 + delim[0] = (char)cur->delimiter; + delim[1] = 0; + add_property_string(&mboxob, "delimiter", delim, 1); +#else + add_property_string(&mboxob, "delimiter", cur->delimiter, 1); +#endif + add_next_index_object(return_value, mboxob); + cur=cur->next; + } + mail_free_foblist (&imap_sfolder_objects); + efree(delim); + folderlist_style = FLIST_ARRAY; // reset to default +} +/* }}} */ + + /* {{{ proto int imap_subscribe(int stream_id, string mailbox) Subscribe to a mailbox */ void php3_imap_subscribe(INTERNAL_FUNCTION_PARAMETERS) @@ -1571,7 +2010,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1600,7 +2039,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1730,7 +2169,7 @@ imap_le_struct = (pils *)php3_list_find( ind, &ind_type ); - if ( !imap_le_struct || ind_type != le_imap ) { + if ( !imap_le_struct || !IS_STREAM(ind_type)) { php3_error( E_WARNING, "Unable to find stream pointer" ); RETURN_FALSE; } @@ -1768,7 +2207,7 @@ imap_le_struct = (pils *)php3_list_find( ind, &ind_type ); - if ( !imap_le_struct || ind_type != le_imap ) { + if ( !imap_le_struct || !IS_STREAM(ind_type)) { php3_error( E_WARNING, "Unable to find stream pointer" ); RETURN_FALSE; } @@ -1875,7 +2314,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if(!imap_le_struct || ind_type != le_imap) { + if(!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -1988,7 +2427,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if(!imap_le_struct || ind_type != le_imap) { + if(!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2017,7 +2456,7 @@ if(myargc==4) convert_to_long(flags); ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if(!imap_le_struct || ind_type != le_imap) { + if(!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2053,7 +2492,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if(!imap_le_struct || ind_type != le_imap) { + if(!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2093,7 +2532,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2121,7 +2560,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2149,7 +2588,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2177,7 +2616,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2193,6 +2632,12 @@ if(status_flags & SA_UNSEEN) add_property_long(return_value,"unseen",status_unseen); if(status_flags & SA_UIDNEXT) add_property_long(return_value,"uidnext",status_uidnext); if(status_flags & SA_UIDVALIDITY) add_property_long(return_value,"uidvalidity",status_uidvalidity); +#ifdef SA_QUOTA + if(status_flags & SA_QUOTA) add_property_long(return_value,"quota",status_quota); +#endif +#ifdef SA_QUOTA + if(status_flags & SA_QUOTA_ALL) add_property_long(return_value,"quota_all",status_quota_all); +#endif } else { @@ -2223,7 +2668,7 @@ imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2321,7 +2766,7 @@ ind = streamind->value.lval; imap_le_struct = (pils *)php3_list_find(ind, &ind_type); - if (!imap_le_struct || ind_type != le_imap) { + if (!imap_le_struct || !IS_STREAM(ind_type)) { php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } @@ -2349,6 +2794,7 @@ add_property_long(&myoverview,"answered",elt->answered); add_property_long(&myoverview,"deleted",elt->deleted); add_property_long(&myoverview,"seen",elt->seen); + add_property_long(&myoverview,"draft",elt->draft); add_next_index_object(return_value,myoverview); } } @@ -2571,7 +3017,99 @@ /* }}} */ +/* {{{ proto string imap_alerts() + Returns an array of all IMAP alerts that have been generated either + since the last page load, or since the last imap_alerts() call, + whichever came last. The alert stack is cleared after imap_alerts() + is called. */ +/* Author: CJH */ +void php3_imap_alerts(INTERNAL_FUNCTION_PARAMETERS) +{ + STRINGLIST *cur=NIL; + + int arg_count = ARG_COUNT(ht); + + if (arg_count > 0) { + WRONG_PARAM_COUNT; + } + + if (imap_alertstack == NIL) { + RETURN_FALSE; + } + + array_init(return_value); + cur = imap_alertstack; + while (cur != NIL) { + add_next_index_string(return_value,cur->LTEXT,1); + cur = cur->next; + } + mail_free_stringlist(&imap_alertstack); + imap_alertstack = NIL; +} +/* }}} */ + + +/* {{{ proto string imap_errors() + Returns an array of all IMAP errors generated either since the last + page load, or since the last imap_errors() call, whichever came + last. The error stack is cleared after imap_errors() is called. */ +/* Author: CJH */ +void php3_imap_errors(INTERNAL_FUNCTION_PARAMETERS) +{ + ERRORLIST *cur=NIL; + + int arg_count = ARG_COUNT(ht); + + if (arg_count > 0) { + WRONG_PARAM_COUNT; + } + + if (imap_errorstack == NIL) { + RETURN_FALSE; + } + + array_init(return_value); + cur = imap_errorstack; + while (cur != NIL) { + add_next_index_string(return_value,cur->LTEXT,1); + cur = cur->next; + } + mail_free_errorlist(&imap_errorstack); + imap_errorstack = NIL; +} +/* }}} */ + + +/* {{{ proto string imap_last_error() Returns the last error that was + generated by an IMAP function. The error stack is NOT cleared after + this call. */ +/* Author: CJH */ +void php3_imap_last_error(INTERNAL_FUNCTION_PARAMETERS) +{ + ERRORLIST *cur=NIL; + + int arg_count = ARG_COUNT(ht); + + if (arg_count > 0) { + WRONG_PARAM_COUNT; + } + + if (imap_errorstack == NIL) { + RETURN_FALSE; + } + + cur = imap_errorstack; + while (cur != NIL) { + if (cur->next == NIL) { + RETURN_STRING(cur->LTEXT, 1); + } + cur = cur->next; + } +} +/* }}} */ + + /* Interfaces to C-client */ @@ -2595,27 +3133,73 @@ } -void mm_notify (MAILSTREAM *stream,char *string,long errflg) +/* Author: CJH */ +void mm_notify (MAILSTREAM *stream,char *string, long errflg) { + STRINGLIST *cur = NIL; + + if (strncmp(string, "[ALERT] ", 8) == 0) { + if (imap_alertstack == NIL) { + imap_alertstack = mail_newstringlist(); + imap_alertstack->LSIZE = strlen(imap_alertstack->LTEXT = cpystr(string)); + imap_alertstack->next = NIL; + } else { + cur = imap_alertstack; + while (cur->next != NIL ) { + cur = cur->next; + } + cur->next = mail_newstringlist (); + cur = cur->next; + cur->LSIZE = strlen(cur->LTEXT = cpystr(string)); + cur->next = NIL; + } + } } void mm_list (MAILSTREAM *stream,DTYPE delimiter,char *mailbox,long attributes) { STRINGLIST *cur=NIL; - if(!(attributes & LATT_NOSELECT)) { - if (imap_folders == NIL) { - imap_folders=mail_newstringlist(); - imap_folders->LSIZE=strlen(imap_folders->LTEXT=cpystr(mailbox)); - imap_folders->next=NIL; + FOBJECTLIST *ocur=NIL; + + if (folderlist_style == FLIST_OBJECT) { + /* build up a the new array of objects */ + /* Author: CJH */ + if (imap_folder_objects == NIL) { + imap_folder_objects = mail_newfolderobjectlist(); + imap_folder_objects->LSIZE=strlen(imap_folder_objects->LTEXT=cpystr(mailbox)); + imap_folder_objects->delimiter = delimiter; + imap_folder_objects->attributes = attributes; + imap_folder_objects->next = NIL; } else { - cur=imap_folders; - while (cur->next != NIL ) { + ocur=imap_folder_objects; + while (ocur->next != NIL) { + ocur=ocur->next; + } + ocur->next=mail_newfolderobjectlist(); + ocur=ocur->next; + ocur->LSIZE = strlen(ocur->LTEXT = cpystr(mailbox)); + ocur->delimiter = delimiter; + ocur->attributes = attributes; + ocur->next = NIL; + } + + } else { + /* build the old imap_folders variable to allow old imap_listmailbox() to work */ + if (!(attributes & LATT_NOSELECT)) { + if (imap_folders == NIL) { + imap_folders=mail_newstringlist(); + imap_folders->LSIZE=strlen(imap_folders->LTEXT=cpystr(mailbox)); + imap_folders->next=NIL; + } else { + cur=imap_folders; + while (cur->next != NIL ) { + cur=cur->next; + } + cur->next=mail_newstringlist (); cur=cur->next; + cur->LSIZE = strlen (cur->LTEXT = cpystr (mailbox)); + cur->next = NIL; } - cur->next=mail_newstringlist (); - cur=cur->next; - cur->LSIZE = strlen (cur->LTEXT = cpystr (mailbox)); - cur->next = NIL; } } } @@ -2623,52 +3207,95 @@ void mm_lsub (MAILSTREAM *stream,DTYPE delimiter,char *mailbox,long attributes) { STRINGLIST *cur=NIL; - if (imap_sfolders == NIL) { - imap_sfolders=mail_newstringlist(); - imap_sfolders->LSIZE=strlen(imap_sfolders->LTEXT=cpystr(mailbox)); - imap_sfolders->next=NIL; + FOBJECTLIST *ocur=NIL; + + if (folderlist_style == FLIST_OBJECT) { + /* build the array of objects */ + /* Author: CJH */ + if (imap_sfolder_objects == NIL) { + imap_sfolder_objects = mail_newfolderobjectlist(); + imap_sfolder_objects->LSIZE=strlen(imap_sfolder_objects->LTEXT=cpystr(mailbox)); + imap_sfolder_objects->delimiter = delimiter; + imap_sfolder_objects->attributes = attributes; + imap_sfolder_objects->next = NIL; + } else { + ocur=imap_sfolder_objects; + while (ocur->next != NIL) { + ocur=ocur->next; + } + ocur->next=mail_newfolderobjectlist(); + ocur=ocur->next; + ocur->LSIZE=strlen(ocur->LTEXT = cpystr(mailbox)); + ocur->delimiter = delimiter; + ocur->attributes = attributes; + ocur->next = NIL; + } + } else { - cur=imap_sfolders; - while (cur->next != NIL ) { + /* build the old simple array for imap_listsubscribed() */ + if (imap_sfolders == NIL) { + imap_sfolders=mail_newstringlist(); + imap_sfolders->LSIZE=strlen(imap_sfolders->LTEXT=cpystr(mailbox)); + imap_sfolders->next=NIL; + } else { + cur=imap_sfolders; + while (cur->next != NIL ) { + cur=cur->next; + } + cur->next=mail_newstringlist (); cur=cur->next; + cur->LSIZE = strlen (cur->LTEXT = cpystr (mailbox)); + cur->next = NIL; } - cur->next=mail_newstringlist (); - cur=cur->next; - cur->LSIZE = strlen (cur->LTEXT = cpystr (mailbox)); - cur->next = NIL; } } void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) { -status_flags=status->flags; + status_flags=status->flags; if(status_flags & SA_MESSAGES) status_messages=status->messages; if(status_flags & SA_RECENT) status_recent=status->recent; if(status_flags & SA_UNSEEN) status_unseen=status->unseen; if(status_flags & SA_UIDNEXT) status_uidnext=status->uidnext; if(status_flags & SA_UIDVALIDITY) status_uidvalidity=status->uidvalidity; - +#ifdef SA_QUOTA + if(status_flags & SA_QUOTA) status_quota=status->quota; +#endif +#ifdef SA_QUOTA_ALL + if(status_flags & SA_QUOTA_ALL) status_quota_all=status->quota_all; +#endif } void mm_log (char *string,long errflg) { - switch ((short) errflg) { - case NIL: - /* php3_error(E_NOTICE,string); messages */ - break; - case PARSE: - case WARN: - php3_error(E_WARNING,string); /* warnings */ - break; - case ERROR: - php3_error(E_NOTICE,string); /* errors */ - break; - } + ERRORLIST *cur = NIL; + + /* Author: CJH */ + if (errflg != NIL) { /* CJH: maybe put these into a more comprehensive log for debugging purposes? */ + if (imap_errorstack == NIL) { + imap_errorstack = mail_newerrorlist(); + imap_errorstack->LSIZE = strlen(imap_errorstack->LTEXT = cpystr(string)); + imap_errorstack->errflg = errflg; + imap_errorstack->next = NIL; + } else { + cur = imap_errorstack; + while (cur->next != NIL ) { + cur = cur->next; + } + cur->next = mail_newerrorlist (); + cur = cur->next; + cur->LSIZE = strlen(cur->LTEXT = cpystr(string)); + cur->errflg = errflg; + cur->next = NIL; + } + } } void mm_dlog (char *string) { - php3_error(E_NOTICE,string); + /* CJH: this is for debugging; it might be useful to allow setting + the stream to debug mode and capturing this somewhere - syslog? + php debugger? */ } void mm_login (NETMBX *mb,char *user,char *pwd,long trial) Index: php3/functions/imap.h diff -u php3/functions/imap.h:1.10 php3/functions/imap.h:1.11 --- php3/functions/imap.h:1.10 Mon Dec 28 04:43:58 1998 +++ php3/functions/imap.h Fri Jul 2 17:05:17 1999 @@ -1,4 +1,4 @@ -/* $Id: imap.h,v 1.10 1998/12/28 09:43:58 sas Exp $ */ +/* $Id: imap.h,v 1.11 1999/07/02 21:05:17 musone Exp $ */ #ifndef _INCLUDED_IMAP_H #define _INCLUDED_IMAP_H @@ -22,8 +22,11 @@ #define php3_imap_module_ptr &php3_imap_module_entry extern int imap_init(INIT_FUNC_ARGS); +extern int imap_init_request(INIT_FUNC_ARGS); +extern int imap_end_request(void); extern void imap_info(void); void php3_imap_open(INTERNAL_FUNCTION_PARAMETERS); +void php3_imap_popen(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_reopen(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_close(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_num_msg(INTERNAL_FUNCTION_PARAMETERS); @@ -40,8 +43,10 @@ void php3_imap_renamemailbox(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_deletemailbox(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_list(INTERNAL_FUNCTION_PARAMETERS); +void php3_imap_list_full(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_listscan(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_lsub(INTERNAL_FUNCTION_PARAMETERS); +void php3_imap_lsub_full(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_subscribe(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_unsubscribe(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_num_recent(INTERNAL_FUNCTION_PARAMETERS); @@ -68,24 +73,12 @@ void php3_imap_bodystruct(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_fetch_overview(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_mail_compose(INTERNAL_FUNCTION_PARAMETERS); +void php3_imap_alerts(INTERNAL_FUNCTION_PARAMETERS); +void php3_imap_errors(INTERNAL_FUNCTION_PARAMETERS); +void php3_imap_last_error(INTERNAL_FUNCTION_PARAMETERS); #else #define php3_imap_module_ptr NULL #endif /* HAVE_IMAP */ #endif - - - - - - - - - - - - - - -

« previous php.dev (#8022) next »