mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Remove ext/imap — it has been moved to PECL (#13190)
* Remove ext/imap — it has been moved to PECL https://pecl.php.net/package/imap * Remove files related to IMAP * Remove IMAP CI files and set up * Also disable IMAP on Circle CI * Update CREDITS file * Remove IMAP entry from CODEOWNERS * Revert "Remove files related to IMAP" This reverts commita05ffd6c97. * Mark IMAP is being removed * Revert "Remove IMAP CI files and set up" This reverts commit82e5ba9910. * Revert "Also disable IMAP on Circle CI" This reverts commite83827b0b2. * Don't try to build imap extension with CI * Restore test setup files * Remove mention of imap in labeler, EXTENSIONS, and sample php.ini files
This commit is contained in:
@@ -148,9 +148,6 @@ jobs:
|
||||
--with-qdbm \
|
||||
--with-snmp \
|
||||
`#--with-unixODBC` \
|
||||
--with-imap \
|
||||
--with-kerberos \
|
||||
--with-imap-ssl \
|
||||
`#--with-pdo-odbc=unixODBC,/usr` \
|
||||
`#--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient` \
|
||||
`#--with-oci8=shared,instantclient,/opt/oracle/instantclient` \
|
||||
|
||||
2
.github/actions/configure-x64/action.yml
vendored
2
.github/actions/configure-x64/action.yml
vendored
@@ -72,8 +72,6 @@ runs:
|
||||
--with-qdbm \
|
||||
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
|
||||
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
|
||||
${{ inputs.skipSlow == 'false' && '--with-imap' || '' }} \
|
||||
${{ inputs.skipSlow == 'false' && '--with-imap-ssl' || '' }} \
|
||||
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
|
||||
$([ -d "/opt/oracle/instantclient" ] && echo '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient') \
|
||||
$([ -d "/opt/oracle/instantclient" ] && echo '--with-oci8=shared,instantclient,/opt/oracle/instantclient') \
|
||||
|
||||
3
.github/labeler.yml
vendored
3
.github/labeler.yml
vendored
@@ -74,9 +74,6 @@
|
||||
"Extension: iconv":
|
||||
- ext/iconv/**/*
|
||||
|
||||
"Extension: imap":
|
||||
- ext/imap/**/*
|
||||
|
||||
"Extension: intl":
|
||||
- ext/intl/**/*
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
/ext/dom @nielsdos
|
||||
/ext/ffi @dstogov
|
||||
/ext/gmp @Girgias
|
||||
/ext/imap @Girgias
|
||||
/ext/intl @devnexen
|
||||
/ext/json @bukka
|
||||
/ext/libxml @nielsdos
|
||||
|
||||
@@ -350,14 +350,6 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: imap
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org> (1999 - 2004)
|
||||
Ilia Alshanetsky <iliaa@php.net> (2002 - 2010)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2008 - 2010)
|
||||
Bishop Bettini <bishop@php.net> (2018 - 2019)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: json
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net> (2014 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
@@ -380,6 +380,10 @@ PDO_SQLITE:
|
||||
8. Removed Extensions and SAPIs
|
||||
========================================
|
||||
|
||||
- IMAP:
|
||||
. The IMAP extension has been unbundled and moved to PECL.
|
||||
RFC: https://wiki.php.net/rfc/unbundle_imap_pspell_oci8
|
||||
|
||||
- PSpell:
|
||||
. The pspell extension has been unbundled and moved to PECL.
|
||||
RFC: https://wiki.php.net/rfc/unbundle_imap_pspell_oci8
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
IMAP
|
||||
Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky
|
||||
@@ -1,304 +0,0 @@
|
||||
AC_DEFUN([IMAP_INC_CHK],[if test -r "$i$1/c-client.h"; then
|
||||
AC_DEFINE(HAVE_IMAP2000, 1, [ ])
|
||||
IMAP_DIR=$i
|
||||
IMAP_INC_DIR=$i$1
|
||||
break
|
||||
elif test -r "$i$1/rfc822.h"; then
|
||||
IMAP_DIR=$i;
|
||||
IMAP_INC_DIR=$i$1
|
||||
break
|
||||
])
|
||||
|
||||
AC_DEFUN([IMAP_LIB_CHK],[
|
||||
str="$IMAP_DIR/$1/lib$lib.*"
|
||||
for i in `echo $str`; do
|
||||
test -r $i && IMAP_LIBDIR=$IMAP_DIR/$1 && break 2
|
||||
done
|
||||
])
|
||||
|
||||
dnl PHP_IMAP_TEST_BUILD(function, action-if-ok, action-if-not-ok, extra-libs, extra-source)
|
||||
dnl
|
||||
dnl The UW-IMAP c-client library was not originally designed to be a
|
||||
dnl shared library. The mm_foo functions are callbacks, and are required
|
||||
dnl to be implemented by the program that is linking to c-client. This
|
||||
dnl macro does the work of defining them all to no-ops for you. Note
|
||||
dnl that PHP_TEST_BUILD is a link test; the undefined symbols will only
|
||||
dnl cause problems if you actually try to link with c-client. For
|
||||
dnl example, if your test is trivial enough to be optimized out, and if
|
||||
dnl you link with --as-needed, the test/library may be omitted entirely
|
||||
dnl from the final executable. In that case linking will of course
|
||||
dnl succeed, but your luck won't necessarily apply at lower optimization
|
||||
dnl levels or systems where --as-needed is not used.
|
||||
AC_DEFUN([PHP_IMAP_TEST_BUILD], [
|
||||
PHP_TEST_BUILD([$1], [$2], [$3], [$4], [$5]
|
||||
[
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define PHP_IMAP_EXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define PHP_IMAP_EXPORT
|
||||
#endif
|
||||
|
||||
PHP_IMAP_EXPORT void mm_log(void){}
|
||||
PHP_IMAP_EXPORT void mm_dlog(void){}
|
||||
PHP_IMAP_EXPORT void mm_flags(void){}
|
||||
PHP_IMAP_EXPORT void mm_fatal(void){}
|
||||
PHP_IMAP_EXPORT void mm_critical(void){}
|
||||
PHP_IMAP_EXPORT void mm_nocritical(void){}
|
||||
PHP_IMAP_EXPORT void mm_notify(void){}
|
||||
PHP_IMAP_EXPORT void mm_login(void){}
|
||||
PHP_IMAP_EXPORT void mm_diskerror(void){}
|
||||
PHP_IMAP_EXPORT void mm_status(void){}
|
||||
PHP_IMAP_EXPORT void mm_lsub(void){}
|
||||
PHP_IMAP_EXPORT void mm_list(void){}
|
||||
PHP_IMAP_EXPORT void mm_exists(void){}
|
||||
PHP_IMAP_EXPORT void mm_searched(void){}
|
||||
PHP_IMAP_EXPORT void mm_expunged(void){}
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_IMAP_KRB_CHK], [
|
||||
if test "$PHP_KERBEROS" != "no"; then
|
||||
PKG_CHECK_MODULES([KERBEROS], [krb5-gssapi krb5])
|
||||
|
||||
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
|
||||
PHP_EVAL_LIBLINE($KERBEROS_LIBS, IMAP_SHARED_LIBADD)
|
||||
|
||||
AC_DEFINE(HAVE_IMAP_KRB, 1, [Whether IMAP extension has Kerberos support])
|
||||
else
|
||||
AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [
|
||||
AC_MSG_ERROR([This c-client library is built with Kerberos support.
|
||||
|
||||
Add --with-kerberos to your configure line. Check config.log for details.
|
||||
])
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_IMAP_SSL_CHK], [
|
||||
if test "$PHP_IMAP_SSL" != "no"; then
|
||||
if test "$PHP_OPENSSL" = ""; then
|
||||
PHP_OPENSSL='no'
|
||||
fi
|
||||
PHP_SETUP_OPENSSL(IMAP_SHARED_LIBADD,
|
||||
[
|
||||
AC_DEFINE(HAVE_IMAP_SSL,1,[ ])
|
||||
], [
|
||||
AC_MSG_ERROR([OpenSSL libraries not found.
|
||||
|
||||
Check whether openssl is on your PKG_CONFIG_PATH and the output in config.log)
|
||||
])
|
||||
])
|
||||
elif test -f "$IMAP_INC_DIR/linkage.c"; then
|
||||
AC_EGREP_HEADER(ssl_onceonlyinit, $IMAP_INC_DIR/linkage.c, [
|
||||
AC_MSG_ERROR([This c-client library is built with SSL support.
|
||||
|
||||
Add --with-imap-ssl to your configure line. Check config.log for details.
|
||||
])
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
PHP_ARG_WITH([imap],
|
||||
[for IMAP support],
|
||||
[AS_HELP_STRING([[--with-imap[=DIR]]],
|
||||
[Include IMAP support. DIR is the c-client install prefix])])
|
||||
|
||||
PHP_ARG_WITH([kerberos],
|
||||
[for IMAP Kerberos support],
|
||||
[AS_HELP_STRING([--with-kerberos],
|
||||
[IMAP: Include Kerberos support])],
|
||||
[no],
|
||||
[no])
|
||||
|
||||
PHP_ARG_WITH([imap-ssl],
|
||||
[for IMAP SSL support],
|
||||
[AS_HELP_STRING([[--with-imap-ssl]],
|
||||
[IMAP: Include SSL support])],
|
||||
[no],
|
||||
[no])
|
||||
|
||||
if test "$PHP_IMAP" != "no"; then
|
||||
PHP_SUBST(IMAP_SHARED_LIBADD)
|
||||
PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
||||
AC_DEFINE(HAVE_IMAP,1,[ ])
|
||||
|
||||
for i in $PHP_IMAP /usr/local /usr; do
|
||||
IMAP_INC_CHK()
|
||||
el[]IMAP_INC_CHK(/include/c-client)
|
||||
el[]IMAP_INC_CHK(/include/imap)
|
||||
el[]IMAP_INC_CHK(/include)
|
||||
el[]IMAP_INC_CHK(/imap)
|
||||
el[]IMAP_INC_CHK(/c-client)
|
||||
fi
|
||||
done
|
||||
|
||||
dnl Check for c-client version 2004
|
||||
AC_EGREP_HEADER(mail_fetch_overview_sequence, $IMAP_INC_DIR/mail.h, [
|
||||
AC_DEFINE(HAVE_IMAP2004,1,[ ])
|
||||
])
|
||||
|
||||
dnl Check for new version of the utf8_mime2text() function
|
||||
old_CFLAGS=$CFLAGS
|
||||
CFLAGS="-I$IMAP_INC_DIR"
|
||||
AC_CACHE_CHECK(for utf8_mime2text signature, ac_cv_utf8_mime2text,
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
#include <c-client.h>
|
||||
]],[[
|
||||
SIZEDTEXT *src, *dst;
|
||||
utf8_mime2text(src, dst);
|
||||
]])],[
|
||||
ac_cv_utf8_mime2text=old
|
||||
],[
|
||||
ac_cv_utf8_mime2text=new
|
||||
])
|
||||
)
|
||||
if test "$ac_cv_utf8_mime2text" = "new"; then
|
||||
AC_DEFINE(HAVE_NEW_MIME2TEXT, 1, [Whether utf8_mime2text() has new signature])
|
||||
fi
|
||||
CFLAGS=$old_CFLAGS
|
||||
|
||||
old_CFLAGS=$CFLAGS
|
||||
CFLAGS="-I$IMAP_INC_DIR"
|
||||
AC_CACHE_CHECK(for U8T_DECOMPOSE, ac_cv_u8t_decompose,
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <c-client.h>
|
||||
]],[[
|
||||
int i = U8T_CANONICAL;
|
||||
]])],[
|
||||
ac_cv_u8t_decompose=yes
|
||||
],[
|
||||
ac_cv_u8t_decompose=no
|
||||
])
|
||||
)
|
||||
CFLAGS=$old_CFLAGS
|
||||
|
||||
if test "$ac_cv_u8t_decompose" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then
|
||||
AC_MSG_ERROR([utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.])
|
||||
fi
|
||||
if test "$ac_cv_u8t_decompose" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then
|
||||
AC_MSG_ERROR([utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. Check config.log for additional information.])
|
||||
fi
|
||||
|
||||
dnl Check for c-client version 2001
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$IMAP_INC_DIR
|
||||
AC_EGREP_CPP(this_is_true, [
|
||||
#include "imap4r1.h"
|
||||
#if defined(IMAPSSLPORT)
|
||||
this_is_true
|
||||
#endif
|
||||
],[
|
||||
AC_DEFINE(HAVE_IMAP2001, 1, [ ])
|
||||
],[])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
PHP_CHECK_LIBRARY(pam, pam_start,
|
||||
[
|
||||
PHP_ADD_LIBRARY(pam,, IMAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_LIBPAM,1,[ ])
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(crypt, crypt,
|
||||
[
|
||||
PHP_ADD_LIBRARY(crypt,, IMAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_LIBCRYPT,1,[ ])
|
||||
])
|
||||
|
||||
PHP_EXPAND_PATH($IMAP_DIR, IMAP_DIR)
|
||||
|
||||
if test -z "$IMAP_DIR"; then
|
||||
AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.)
|
||||
fi
|
||||
|
||||
if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then
|
||||
ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
|
||||
elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
|
||||
ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
for lib in c-client4 c-client imap; do
|
||||
IMAP_LIB=$lib
|
||||
IMAP_LIB_CHK($PHP_LIBDIR)
|
||||
IMAP_LIB_CHK(c-client)
|
||||
done
|
||||
|
||||
if test -z "$IMAP_LIBDIR"; then
|
||||
AC_MSG_ERROR(Cannot find imap library (libc-client.a). Please check your c-client installation.)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($IMAP_INC_DIR)
|
||||
PHP_ADD_LIBRARY_DEFER($IMAP_LIB,, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD)
|
||||
PHP_IMAP_KRB_CHK
|
||||
PHP_IMAP_SSL_CHK
|
||||
|
||||
dnl Test the build in the end
|
||||
TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD"
|
||||
|
||||
dnl Check if auth_gss exists
|
||||
PHP_IMAP_TEST_BUILD(auth_gssapi_valid, [
|
||||
AC_DEFINE(HAVE_IMAP_AUTH_GSS, 1, [ ])
|
||||
], [], $TST_LIBS)
|
||||
|
||||
dnl Check if utf8_to_mutf7 exists.
|
||||
old_CPPFLAGS="${CPPFLAGS}"
|
||||
CPPFLAGS="${CPPFLAGS} -I${IMAP_INC_DIR}"
|
||||
AC_LANG_PUSH(C)
|
||||
AC_CACHE_CHECK(for utf8_to_mutf7, ac_cv_utf8_to_mutf7,
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <c-client.h>]],[[
|
||||
unsigned char c = '\0';
|
||||
utf8_to_mutf7(&c);
|
||||
]])],[
|
||||
AC_DEFINE(HAVE_IMAP_MUTF7, 1, [ ])
|
||||
ac_cv_utf8_to_mutf7=yes
|
||||
],[
|
||||
ac_cv_utf8_to_mutf7=no
|
||||
])
|
||||
)
|
||||
AC_LANG_POP
|
||||
|
||||
|
||||
AC_MSG_CHECKING(whether rfc822_output_address_list function present)
|
||||
PHP_TEST_BUILD(foobar, [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RFC822_OUTPUT_ADDRESS_LIST, 1, [ ])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [
|
||||
$TST_LIBS
|
||||
], [
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define PHP_IMAP_EXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define PHP_IMAP_EXPORT
|
||||
#endif
|
||||
|
||||
PHP_IMAP_EXPORT void mm_log(void){}
|
||||
PHP_IMAP_EXPORT void mm_dlog(void){}
|
||||
PHP_IMAP_EXPORT void mm_flags(void){}
|
||||
PHP_IMAP_EXPORT void mm_fatal(void){}
|
||||
PHP_IMAP_EXPORT void mm_critical(void){}
|
||||
PHP_IMAP_EXPORT void mm_nocritical(void){}
|
||||
PHP_IMAP_EXPORT void mm_notify(void){}
|
||||
PHP_IMAP_EXPORT void mm_login(void){}
|
||||
PHP_IMAP_EXPORT void mm_diskerror(void){}
|
||||
PHP_IMAP_EXPORT void mm_status(void){}
|
||||
PHP_IMAP_EXPORT void mm_lsub(void){}
|
||||
PHP_IMAP_EXPORT void mm_list(void){}
|
||||
PHP_IMAP_EXPORT void mm_exists(void){}
|
||||
PHP_IMAP_EXPORT void mm_searched(void){}
|
||||
PHP_IMAP_EXPORT void mm_expunged(void){}
|
||||
void rfc822_output_address_list(void);
|
||||
void (*f)(void);
|
||||
char foobar () {f = rfc822_output_address_list;}
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether build with IMAP works)
|
||||
PHP_IMAP_TEST_BUILD(mail_newbody, [
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
||||
], $TST_LIBS)
|
||||
fi
|
||||
@@ -1,26 +0,0 @@
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_WITH("imap", "IMAP Support", "no");
|
||||
|
||||
if (PHP_IMAP == "yes") {
|
||||
if (CHECK_LIB("cclient_a.lib;cclient.lib", "imap") &&
|
||||
(CHECK_HEADER_ADD_INCLUDE("c-client.h", "CFLAGS_IMAP")||
|
||||
CHECK_HEADER_ADD_INCLUDE("c-client/c-client.h", "CFLAGS_IMAP", null, null, true)) ||
|
||||
(CHECK_HEADER_ADD_INCLUDE("utf8aux.h", "CFLAGS_IMAP")||
|
||||
CHECK_HEADER_ADD_INCLUDE("c-client/utf8aux.h", "CFLAGS_IMAP", null, null, true))
|
||||
) {
|
||||
CHECK_LIB("winmm.lib", "imap");
|
||||
CHECK_LIB("ws2_32.lib", "imap");
|
||||
CHECK_LIB("Secur32.lib", "imap");
|
||||
CHECK_LIB("crypt32.lib", "imap");
|
||||
EXTENSION("imap", "php_imap.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
||||
|
||||
ADD_FLAG("CFLAGS_IMAP", "/D HAVE_IMAP2000=1 /D HAVE_IMAP2004=1 /D HAVE_IMAP2007a=1 /D HAVE_IMAP2007b=1 /D HAVE_IMAP_SSL=1");
|
||||
AC_DEFINE('HAVE_IMAP', 1, 'Have IMAP support', true);
|
||||
AC_DEFINE('HAVE_RFC822_OUTPUT_ADDRESS_LIST', 1, 'Have rfc822_output_address_list', true);
|
||||
AC_DEFINE('HAVE_IMAP_MUTF7', 1, 'Have modified utf7 support', true);
|
||||
AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Whether utf8_mime2text() has new signature');
|
||||
} else {
|
||||
WARNING("imap not enabled; libraries and headers not found");
|
||||
}
|
||||
}
|
||||
4808
ext/imap/php_imap.c
4808
ext/imap/php_imap.c
File diff suppressed because it is too large
Load Diff
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| https://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Rex Logan <veebert@dimensional.com> |
|
||||
| Mark Musone <musone@afterfive.com> |
|
||||
| Brian Wang <brian@vividnet.com> |
|
||||
| Kaj-Michael Lang <milang@tal.org> |
|
||||
| Antoni Pamies Olive <toni@readysoft.net> |
|
||||
| Rasmus Lerdorf <rasmus@php.net> |
|
||||
| Chuck Hagenbuch <chuck@horde.org> |
|
||||
| Andrew Skalski <askalski@chekinc.com> |
|
||||
| Hartmut Holzgraefe <hholzgra@php.net> |
|
||||
| Jani Taskinen <sniper@iki.fi> |
|
||||
| Daniel R. Kalowsky <kalowsky@php.net> |
|
||||
| PHP 4.0 updates: Zeev Suraski <zeev@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef PHP_IMAP_H
|
||||
#define PHP_IMAP_H
|
||||
|
||||
#ifdef HAVE_IMAP
|
||||
|
||||
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
|
||||
|
||||
/* For now these appear on Windows, remove this check if it appears outside */
|
||||
# ifdef PHP_WIN32
|
||||
/* Undefine these LOG defines to avoid warnings */
|
||||
# undef LOG_EMERG
|
||||
# undef LOG_CRIT
|
||||
# undef LOG_ERR
|
||||
# undef LOG_WARNING
|
||||
# undef LOG_NOTICE
|
||||
# undef LOG_DEBUG
|
||||
|
||||
/* c-client also redefines its own ftruncate */
|
||||
# undef ftruncate
|
||||
# endif
|
||||
|
||||
/* these are used for quota support */
|
||||
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
|
||||
# include "c-client.h" /* includes mail.h and rfc822.h */
|
||||
ZEND_DIAGNOSTIC_IGNORED_END
|
||||
# include "imap4r1.h" /* location of c-client quota functions */
|
||||
#else
|
||||
# include "mail.h"
|
||||
# include "rfc822.h"
|
||||
#endif
|
||||
|
||||
extern zend_module_entry imap_module_entry;
|
||||
#define imap_module_ptr &imap_module_entry
|
||||
|
||||
#include "php_version.h"
|
||||
#define PHP_IMAP_VERSION PHP_VERSION
|
||||
|
||||
/* Data types */
|
||||
|
||||
#ifdef IMAP41
|
||||
#define LSIZE text.size
|
||||
#define LTEXT text.data
|
||||
#define DTYPE int
|
||||
#define CONTENT_PART nested.part
|
||||
#define CONTENT_MSG_BODY nested.msg->body
|
||||
#define IMAPVER "Imap 4R1"
|
||||
#else
|
||||
#define LSIZE size
|
||||
#define LTEXT text
|
||||
#define DTYPE char
|
||||
#define CONTENT_PART contents.part
|
||||
#define CONTENT_MSG_BODY contents.msg.body
|
||||
#define IMAPVER "Imap 4"
|
||||
#endif
|
||||
|
||||
|
||||
/* Determines how mm_list() and mm_lsub() are to return their results. */
|
||||
typedef enum {
|
||||
FLIST_ARRAY,
|
||||
FLIST_OBJECT
|
||||
} folderlist_style_t;
|
||||
|
||||
typedef struct php_imap_mailbox_struct {
|
||||
SIZEDTEXT text;
|
||||
DTYPE delimiter;
|
||||
long attributes;
|
||||
struct php_imap_mailbox_struct *next;
|
||||
} FOBJECTLIST;
|
||||
|
||||
typedef struct php_imap_error_struct {
|
||||
SIZEDTEXT text;
|
||||
long errflg;
|
||||
struct php_imap_error_struct *next;
|
||||
} ERRORLIST;
|
||||
|
||||
typedef struct _php_imap_message_struct {
|
||||
unsigned long msgid;
|
||||
struct _php_imap_message_struct *next;
|
||||
} MESSAGELIST;
|
||||
|
||||
|
||||
/* Functions */
|
||||
|
||||
PHP_MINIT_FUNCTION(imap);
|
||||
PHP_RINIT_FUNCTION(imap);
|
||||
PHP_RSHUTDOWN_FUNCTION(imap);
|
||||
PHP_MINFO_FUNCTION(imap);
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(imap)
|
||||
char *imap_user;
|
||||
char *imap_password;
|
||||
|
||||
STRINGLIST *imap_alertstack;
|
||||
ERRORLIST *imap_errorstack;
|
||||
|
||||
STRINGLIST *imap_folders;
|
||||
STRINGLIST *imap_folders_tail;
|
||||
STRINGLIST *imap_sfolders;
|
||||
STRINGLIST *imap_sfolders_tail;
|
||||
MESSAGELIST *imap_messages;
|
||||
MESSAGELIST *imap_messages_tail;
|
||||
FOBJECTLIST *imap_folder_objects;
|
||||
FOBJECTLIST *imap_folder_objects_tail;
|
||||
FOBJECTLIST *imap_sfolder_objects;
|
||||
FOBJECTLIST *imap_sfolder_objects_tail;
|
||||
|
||||
folderlist_style_t folderlist_style;
|
||||
long status_flags;
|
||||
unsigned long status_messages;
|
||||
unsigned long status_recent;
|
||||
unsigned long status_unseen;
|
||||
unsigned long status_uidnext;
|
||||
unsigned long status_uidvalidity;
|
||||
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
|
||||
zval **quota_return;
|
||||
zval *imap_acl_list;
|
||||
#endif
|
||||
/* php_stream for php_mail_gets() */
|
||||
php_stream *gets_stream;
|
||||
bool enable_rsh;
|
||||
ZEND_END_MODULE_GLOBALS(imap)
|
||||
|
||||
#if defined(ZTS) && defined(COMPILE_DL_IMAP)
|
||||
ZEND_TSRMLS_CACHE_EXTERN()
|
||||
#endif
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(imap)
|
||||
#define IMAPG(v) ZEND_MODULE_GLOBALS_ACCESSOR(imap, v)
|
||||
|
||||
#else
|
||||
|
||||
#define imap_module_ptr NULL
|
||||
|
||||
#endif
|
||||
|
||||
#define phpext_imap_ptr imap_module_ptr
|
||||
|
||||
#endif /* PHP_IMAP_H */
|
||||
@@ -1,578 +0,0 @@
|
||||
<?php
|
||||
|
||||
/** @generate-class-entries */
|
||||
|
||||
namespace {
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue NIL
|
||||
* @deprecated
|
||||
*/
|
||||
const NIL = UNKNOWN;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PHP_IMAP_OPENTIMEOUT
|
||||
*/
|
||||
const IMAP_OPENTIMEOUT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PHP_IMAP_READTIMEOUT
|
||||
*/
|
||||
const IMAP_READTIMEOUT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PHP_IMAP_WRITETIMEOUT
|
||||
*/
|
||||
const IMAP_WRITETIMEOUT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PHP_IMAP_CLOSETIMEOUT
|
||||
*/
|
||||
const IMAP_CLOSETIMEOUT = UNKNOWN;
|
||||
|
||||
/**
|
||||
* debug protocol negotiations
|
||||
* @var int
|
||||
* @cvalue OP_DEBUG
|
||||
*/
|
||||
const OP_DEBUG = UNKNOWN;
|
||||
/**
|
||||
* read-only open
|
||||
* @var int
|
||||
* @cvalue OP_READONLY
|
||||
*/
|
||||
const OP_READONLY = UNKNOWN;
|
||||
/**
|
||||
* anonymous open of newsgroup
|
||||
* @var int
|
||||
* @cvalue OP_ANONYMOUS
|
||||
*/
|
||||
const OP_ANONYMOUS = UNKNOWN;
|
||||
/**
|
||||
* short (elt-only) caching
|
||||
* @var int
|
||||
* @cvalue OP_SHORTCACHE
|
||||
*/
|
||||
const OP_SHORTCACHE = UNKNOWN;
|
||||
/**
|
||||
* don't pass up events (internal use)
|
||||
* @var int
|
||||
* @cvalue OP_SILENT
|
||||
*/
|
||||
const OP_SILENT = UNKNOWN;
|
||||
/**
|
||||
* return driver prototype
|
||||
* @var int
|
||||
* @cvalue OP_PROTOTYPE
|
||||
*/
|
||||
const OP_PROTOTYPE = UNKNOWN;
|
||||
/**
|
||||
* half-open (IMAP connect but no select)
|
||||
* @var int
|
||||
* @cvalue OP_HALFOPEN
|
||||
*/
|
||||
const OP_HALFOPEN = UNKNOWN;
|
||||
/**
|
||||
* silently expunge recycle stream
|
||||
* @var int
|
||||
* @cvalue OP_EXPUNGE
|
||||
*/
|
||||
const OP_EXPUNGE = UNKNOWN;
|
||||
/**
|
||||
* don't do non-secure authentication
|
||||
* @var int
|
||||
* @cvalue OP_SECURE
|
||||
*/
|
||||
const OP_SECURE = UNKNOWN;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue PHP_EXPUNGE
|
||||
*/
|
||||
const CL_EXPUNGE = UNKNOWN;
|
||||
|
||||
/**
|
||||
* argument is a UID
|
||||
* @var int
|
||||
* @cvalue FT_UID
|
||||
*/
|
||||
const FT_UID = UNKNOWN;
|
||||
/**
|
||||
* peek at data
|
||||
* @var int
|
||||
* @cvalue FT_PEEK
|
||||
*/
|
||||
const FT_PEEK = UNKNOWN;
|
||||
/**
|
||||
* NOT flag for header lines fetch
|
||||
* @var int
|
||||
* @cvalue FT_NOT
|
||||
*/
|
||||
const FT_NOT = UNKNOWN;
|
||||
/**
|
||||
* text can be internal strings
|
||||
* @var int
|
||||
* @cvalue FT_INTERNAL
|
||||
*/
|
||||
const FT_INTERNAL = UNKNOWN;
|
||||
/**
|
||||
* IMAP prefetch text when fetching header
|
||||
* @var int
|
||||
* @cvalue FT_PREFETCHTEXT
|
||||
*/
|
||||
const FT_PREFETCHTEXT = UNKNOWN;
|
||||
|
||||
/**
|
||||
* argument is a UID sequence
|
||||
* @var int
|
||||
* @cvalue ST_UID
|
||||
*/
|
||||
const ST_UID = UNKNOWN;
|
||||
/**
|
||||
* don't return results
|
||||
* @var int
|
||||
* @cvalue ST_SILENT
|
||||
*/
|
||||
const ST_SILENT = UNKNOWN;
|
||||
/**
|
||||
* set vs. clear
|
||||
* @var int
|
||||
* @cvalue ST_SET
|
||||
*/
|
||||
const ST_SET = UNKNOWN;
|
||||
|
||||
/**
|
||||
* argument is a UID sequence
|
||||
* @var int
|
||||
* @cvalue CP_UID
|
||||
*/
|
||||
const CP_UID = UNKNOWN;
|
||||
/**
|
||||
* delete from source after copying
|
||||
* @var int
|
||||
* @cvalue CP_MOVE
|
||||
*/
|
||||
const CP_MOVE = UNKNOWN;
|
||||
|
||||
/**
|
||||
* return UID
|
||||
* @var int
|
||||
* @cvalue SE_UID
|
||||
*/
|
||||
const SE_UID = UNKNOWN;
|
||||
/**
|
||||
* free search program after finished
|
||||
* @var int
|
||||
* @cvalue SE_FREE
|
||||
*/
|
||||
const SE_FREE = UNKNOWN;
|
||||
/**
|
||||
* no search prefetchin
|
||||
* @var int
|
||||
* @cvalue SE_NOPREFETCH
|
||||
*/
|
||||
const SE_NOPREFETCH = UNKNOWN;
|
||||
/**
|
||||
* free sort program after finished
|
||||
* @var int
|
||||
* @cvalue SO_FREE
|
||||
*/
|
||||
const SO_FREE = UNKNOWN;
|
||||
/**
|
||||
* don't do server-based sort
|
||||
* @var int
|
||||
* @cvalue SO_FREE
|
||||
*/
|
||||
const SO_NOSERVER = UNKNOWN;
|
||||
|
||||
/**
|
||||
* number of messages
|
||||
* @var int
|
||||
* @cvalue SA_MESSAGES
|
||||
*/
|
||||
const SA_MESSAGES = UNKNOWN;
|
||||
/**
|
||||
* number of recent messages
|
||||
* @var int
|
||||
* @cvalue SA_RECENT
|
||||
*/
|
||||
const SA_RECENT = UNKNOWN;
|
||||
/**
|
||||
* number of unseen messages
|
||||
* @var int
|
||||
* @cvalue SA_UNSEEN
|
||||
*/
|
||||
const SA_UNSEEN = UNKNOWN;
|
||||
/**
|
||||
* next UID to be assigned
|
||||
* @var int
|
||||
* @cvalue SA_UIDNEXT
|
||||
*/
|
||||
const SA_UIDNEXT = UNKNOWN;
|
||||
/**
|
||||
* UID validity value
|
||||
* @var int
|
||||
* @cvalue SA_UIDVALIDITY
|
||||
*/
|
||||
const SA_UIDVALIDITY = UNKNOWN;
|
||||
/**
|
||||
* get all status information
|
||||
* @var int
|
||||
* @cvalue SA_ALL
|
||||
*/
|
||||
const SA_ALL = UNKNOWN;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_NOINFERIORS
|
||||
*/
|
||||
const LATT_NOINFERIORS = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_NOSELECT
|
||||
*/
|
||||
const LATT_NOSELECT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_MARKED
|
||||
*/
|
||||
const LATT_MARKED = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_UNMARKED
|
||||
*/
|
||||
const LATT_UNMARKED = UNKNOWN;
|
||||
|
||||
#ifdef LATT_REFERRAL
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_REFERRAL
|
||||
*/
|
||||
const LATT_REFERRAL = UNKNOWN;
|
||||
#endif
|
||||
#ifdef LATT_HASCHILDREN
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_HASCHILDREN
|
||||
*/
|
||||
const LATT_HASCHILDREN = UNKNOWN;
|
||||
#endif
|
||||
#ifdef LATT_HASNOCHILDREN
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue LATT_HASNOCHILDREN
|
||||
*/
|
||||
const LATT_HASNOCHILDREN = UNKNOWN;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* date
|
||||
* @var int
|
||||
* @cvalue SORTDATE
|
||||
*/
|
||||
const SORTDATE = UNKNOWN;
|
||||
/**
|
||||
* arrival date
|
||||
* @var int
|
||||
* @cvalue SORTARRIVAL
|
||||
*/
|
||||
const SORTARRIVAL = UNKNOWN;
|
||||
/**
|
||||
* from
|
||||
* @var int
|
||||
* @cvalue SORTFROM
|
||||
*/
|
||||
const SORTFROM = UNKNOWN;
|
||||
/**
|
||||
* subject
|
||||
* @var int
|
||||
* @cvalue SORTSUBJECT
|
||||
*/
|
||||
const SORTSUBJECT = UNKNOWN;
|
||||
/**
|
||||
* to
|
||||
* @var int
|
||||
* @cvalue SORTTO
|
||||
*/
|
||||
const SORTTO = UNKNOWN;
|
||||
/**
|
||||
* cc
|
||||
* @var int
|
||||
* @cvalue SORTCC
|
||||
*/
|
||||
const SORTCC = UNKNOWN;
|
||||
/**
|
||||
* size
|
||||
* @var int
|
||||
* @cvalue SORTSIZE
|
||||
*/
|
||||
const SORTSIZE = UNKNOWN;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPETEXT
|
||||
*/
|
||||
const TYPETEXT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEMULTIPART
|
||||
*/
|
||||
const TYPEMULTIPART = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEMESSAGE
|
||||
*/
|
||||
const TYPEMESSAGE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEAPPLICATION
|
||||
*/
|
||||
const TYPEAPPLICATION = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEAUDIO
|
||||
*/
|
||||
const TYPEAUDIO = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEIMAGE
|
||||
*/
|
||||
const TYPEIMAGE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEVIDEO
|
||||
*/
|
||||
const TYPEVIDEO = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEMODEL
|
||||
*/
|
||||
const TYPEMODEL = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue TYPEOTHER
|
||||
*/
|
||||
const TYPEOTHER = UNKNOWN;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue ENC7BIT
|
||||
*/
|
||||
const ENC7BIT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue ENC8BIT
|
||||
*/
|
||||
const ENC8BIT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue ENCBINARY
|
||||
*/
|
||||
const ENCBINARY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue ENCBASE64
|
||||
*/
|
||||
const ENCBASE64 = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue ENCQUOTEDPRINTABLE
|
||||
*/
|
||||
const ENCQUOTEDPRINTABLE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue ENCOTHER
|
||||
*/
|
||||
const ENCOTHER = UNKNOWN;
|
||||
|
||||
/**
|
||||
* message cache elements
|
||||
* @var int
|
||||
* @cvalue GC_ELT
|
||||
*/
|
||||
const IMAP_GC_ELT = UNKNOWN;
|
||||
/**
|
||||
* ENVELOPEs and BODYs
|
||||
* @var int
|
||||
* @cvalue GC_ENV
|
||||
*/
|
||||
const IMAP_GC_ENV = UNKNOWN;
|
||||
/**
|
||||
* texts
|
||||
* @var int
|
||||
* @cvalue GC_TEXTS
|
||||
*/
|
||||
const IMAP_GC_TEXTS = UNKNOWN;
|
||||
|
||||
function imap_open(string $mailbox, string $user, #[\SensitiveParameter] string $password, int $flags = 0, int $retries = 0, array $options = []): IMAP\Connection|false {}
|
||||
|
||||
function imap_reopen(IMAP\Connection $imap, string $mailbox, int $flags = 0, int $retries = 0): bool {}
|
||||
|
||||
function imap_close(IMAP\Connection $imap, int $flags = 0): true {}
|
||||
|
||||
function imap_is_open(IMAP\Connection $imap): bool {}
|
||||
|
||||
function imap_num_msg(IMAP\Connection $imap): int|false {}
|
||||
|
||||
function imap_num_recent(IMAP\Connection $imap): int {}
|
||||
|
||||
function imap_headers(IMAP\Connection $imap): array|false {}
|
||||
|
||||
function imap_headerinfo(IMAP\Connection $imap, int $message_num, int $from_length = 0, int $subject_length = 0): \stdClass|false {}
|
||||
|
||||
function imap_rfc822_parse_headers(string $headers, string $default_hostname = "UNKNOWN"): \stdClass {}
|
||||
|
||||
function imap_rfc822_write_address(string $mailbox, string $hostname, string $personal): string|false {}
|
||||
|
||||
function imap_rfc822_parse_adrlist(string $string, string $default_hostname): array {}
|
||||
|
||||
function imap_body(IMAP\Connection $imap, int $message_num, int $flags = 0): string|false {}
|
||||
|
||||
/** @alias imap_body */
|
||||
function imap_fetchtext(IMAP\Connection $imap, int $message_num, int $flags = 0): string|false {}
|
||||
|
||||
function imap_bodystruct(IMAP\Connection $imap, int $message_num, string $section): \stdClass|false {}
|
||||
|
||||
function imap_fetchbody(IMAP\Connection $imap, int $message_num, string $section, int $flags = 0): string|false {}
|
||||
|
||||
function imap_fetchmime(IMAP\Connection $imap, int $message_num, string $section, int $flags = 0): string|false {}
|
||||
|
||||
/** @param resource|string|int $file */
|
||||
function imap_savebody(IMAP\Connection $imap, $file, int $message_num, string $section = "", int $flags = 0): bool {}
|
||||
|
||||
function imap_fetchheader(IMAP\Connection $imap, int $message_num, int $flags = 0): string|false {}
|
||||
|
||||
function imap_fetchstructure(IMAP\Connection $imap, int $message_num, int $flags = 0): \stdClass|false {}
|
||||
|
||||
function imap_gc(IMAP\Connection $imap, int $flags): true {}
|
||||
|
||||
function imap_expunge(IMAP\Connection $imap): true {}
|
||||
|
||||
function imap_delete(IMAP\Connection $imap, string $message_nums, int $flags = 0): true {}
|
||||
|
||||
function imap_undelete(IMAP\Connection $imap, string $message_nums, int $flags = 0): true {}
|
||||
|
||||
function imap_check(IMAP\Connection $imap): \stdClass|false {}
|
||||
|
||||
function imap_listscan(IMAP\Connection $imap, string $reference, string $pattern, string $content): array|false {}
|
||||
|
||||
/** @alias imap_listscan */
|
||||
function imap_scan(IMAP\Connection $imap, string $reference, string $pattern, string $content): array|false {}
|
||||
|
||||
/** @alias imap_listscan */
|
||||
function imap_scanmailbox(IMAP\Connection $imap, string $reference, string $pattern, string $content): array|false {}
|
||||
|
||||
function imap_mail_copy(IMAP\Connection $imap, string $message_nums, string $mailbox, int $flags = 0): bool {}
|
||||
|
||||
function imap_mail_move(IMAP\Connection $imap, string $message_nums, string $mailbox, int $flags = 0): bool {}
|
||||
|
||||
function imap_mail_compose(array $envelope, array $bodies): string|false {}
|
||||
|
||||
function imap_createmailbox(IMAP\Connection $imap, string $mailbox): bool {}
|
||||
|
||||
/** @alias imap_createmailbox */
|
||||
function imap_create(IMAP\Connection $imap, string $mailbox): bool {}
|
||||
|
||||
function imap_renamemailbox(IMAP\Connection $imap, string $from, string $to): bool {}
|
||||
|
||||
/** @alias imap_renamemailbox */
|
||||
function imap_rename(IMAP\Connection $imap, string $from, string $to): bool {}
|
||||
|
||||
function imap_deletemailbox(IMAP\Connection $imap, string $mailbox): bool {}
|
||||
|
||||
function imap_subscribe(IMAP\Connection $imap, string $mailbox): bool {}
|
||||
|
||||
function imap_unsubscribe(IMAP\Connection $imap, string $mailbox): bool {}
|
||||
|
||||
function imap_append(IMAP\Connection $imap, string $folder, string $message, ?string $options = null, ?string $internal_date = null): bool {}
|
||||
|
||||
function imap_ping(IMAP\Connection $imap): bool {}
|
||||
|
||||
function imap_base64(string $string): string|false {}
|
||||
|
||||
function imap_qprint(string $string): string|false {}
|
||||
|
||||
function imap_8bit(string $string): string|false {}
|
||||
|
||||
function imap_binary(string $string): string|false {}
|
||||
|
||||
function imap_utf8(string $mime_encoded_text): string {}
|
||||
|
||||
function imap_status(IMAP\Connection $imap, string $mailbox, int $flags): \stdClass|false {}
|
||||
|
||||
function imap_mailboxmsginfo(IMAP\Connection $imap): \stdClass {}
|
||||
|
||||
function imap_setflag_full(IMAP\Connection $imap, string $sequence, string $flag, int $options = 0): true {}
|
||||
|
||||
function imap_clearflag_full(IMAP\Connection $imap, string $sequence, string $flag, int $options = 0): true {}
|
||||
|
||||
function imap_sort(IMAP\Connection $imap, int $criteria, bool $reverse, int $flags = 0, ?string $search_criteria = null, ?string $charset = null): array|false {}
|
||||
|
||||
function imap_uid(IMAP\Connection $imap, int $message_num): int|false {}
|
||||
|
||||
function imap_msgno(IMAP\Connection $imap, int $message_uid): int {}
|
||||
|
||||
function imap_list(IMAP\Connection $imap, string $reference, string $pattern): array|false {}
|
||||
|
||||
/** @alias imap_list */
|
||||
function imap_listmailbox(IMAP\Connection $imap, string $reference, string $pattern): array|false {}
|
||||
|
||||
function imap_lsub(IMAP\Connection $imap, string $reference, string $pattern): array|false {}
|
||||
|
||||
/** @alias imap_lsub */
|
||||
function imap_listsubscribed(IMAP\Connection $imap, string $reference, string $pattern): array|false {}
|
||||
|
||||
function imap_getsubscribed(IMAP\Connection $imap, string $reference, string $pattern): array|false {}
|
||||
|
||||
function imap_getmailboxes(IMAP\Connection $imap, string $reference, string $pattern): array|false {}
|
||||
|
||||
function imap_fetch_overview(IMAP\Connection $imap, string $sequence, int $flags = 0): array|false {}
|
||||
|
||||
function imap_alerts(): array|false {}
|
||||
|
||||
function imap_errors(): array|false {}
|
||||
|
||||
function imap_last_error(): string|false {}
|
||||
|
||||
function imap_search(IMAP\Connection $imap, string $criteria, int $flags = SE_FREE, string $charset = ""): array|false {}
|
||||
|
||||
function imap_utf7_decode(string $string): string|false {}
|
||||
|
||||
function imap_utf7_encode(string $string): string {}
|
||||
|
||||
#ifdef HAVE_IMAP_MUTF7
|
||||
function imap_utf8_to_mutf7(string $string): string|false {}
|
||||
|
||||
function imap_mutf7_to_utf8(string $string): string|false {}
|
||||
#endif
|
||||
|
||||
function imap_mime_header_decode(string $string): array|false {}
|
||||
|
||||
function imap_thread(IMAP\Connection $imap, int $flags = SE_FREE): array|false {}
|
||||
|
||||
function imap_timeout(int $timeout_type, int $timeout = -1): int|bool {}
|
||||
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
function imap_get_quota(IMAP\Connection $imap, string $quota_root): array|false {}
|
||||
|
||||
function imap_get_quotaroot(IMAP\Connection $imap, string $mailbox): array|false {}
|
||||
|
||||
function imap_set_quota(IMAP\Connection $imap, string $quota_root, int $mailbox_size): bool {}
|
||||
|
||||
function imap_setacl(IMAP\Connection $imap, string $mailbox, string $user_id, string $rights): bool {}
|
||||
|
||||
function imap_getacl(IMAP\Connection $imap, string $mailbox): array|false {}
|
||||
#endif
|
||||
|
||||
function imap_mail(string $to, string $subject, string $message, ?string $additional_headers = null, ?string $cc = null, ?string $bcc = null, ?string $return_path = null): bool {}
|
||||
}
|
||||
|
||||
namespace IMAP {
|
||||
/**
|
||||
* @strict-properties
|
||||
* @not-serializable
|
||||
*/
|
||||
final class Connection {
|
||||
}
|
||||
}
|
||||
617
ext/imap/php_imap_arginfo.h
generated
617
ext/imap/php_imap_arginfo.h
generated
@@ -1,617 +0,0 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 45b8472a0d18e596a427daf14edbe1ec46bd06ef */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_open, 0, 3, IMAP\\Connection, MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "0")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_reopen, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_close, 0, 1, IS_TRUE, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_is_open, 0, 1, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_num_msg, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_num_recent, 0, 1, IS_LONG, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_headers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_headerinfo, 0, 2, stdClass, MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, from_length, IS_LONG, 0, "0")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, subject_length, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_rfc822_parse_headers, 0, 1, stdClass, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, default_hostname, IS_STRING, 0, "\"UNKNOWN\"")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_rfc822_write_address, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, personal, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_rfc822_parse_adrlist, 0, 2, IS_ARRAY, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, default_hostname, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_body, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_fetchtext arginfo_imap_body
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_bodystruct, 0, 3, stdClass, MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, section, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_fetchbody, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, section, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_fetchmime arginfo_imap_fetchbody
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_savebody, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_INFO(0, file)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, section, IS_STRING, 0, "\"\"")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_fetchheader arginfo_imap_body
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_fetchstructure, 0, 2, stdClass, MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_gc, 0, 2, IS_TRUE, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_expunge, 0, 1, IS_TRUE, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_delete, 0, 2, IS_TRUE, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_nums, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_undelete arginfo_imap_delete
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_check, 0, 1, stdClass, MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_listscan, 0, 4, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, reference, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_scan arginfo_imap_listscan
|
||||
|
||||
#define arginfo_imap_scanmailbox arginfo_imap_listscan
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail_copy, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_nums, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_mail_move arginfo_imap_mail_copy
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_mail_compose, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, envelope, IS_ARRAY, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, bodies, IS_ARRAY, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_createmailbox, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_create arginfo_imap_createmailbox
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_renamemailbox, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_rename arginfo_imap_renamemailbox
|
||||
|
||||
#define arginfo_imap_deletemailbox arginfo_imap_createmailbox
|
||||
|
||||
#define arginfo_imap_subscribe arginfo_imap_createmailbox
|
||||
|
||||
#define arginfo_imap_unsubscribe arginfo_imap_createmailbox
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_append, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, folder, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, internal_date, IS_STRING, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_ping arginfo_imap_is_open
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_base64, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_qprint arginfo_imap_base64
|
||||
|
||||
#define arginfo_imap_8bit arginfo_imap_base64
|
||||
|
||||
#define arginfo_imap_binary arginfo_imap_base64
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_utf8, 0, 1, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mime_encoded_text, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_status, 0, 3, stdClass, MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_mailboxmsginfo, 0, 1, stdClass, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_setflag_full, 0, 3, IS_TRUE, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, sequence, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, flag, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_clearflag_full arginfo_imap_setflag_full
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_sort, 0, 3, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, criteria, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, reverse, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, search_criteria, IS_STRING, 1, "null")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_uid, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_num, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_msgno, 0, 2, IS_LONG, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message_uid, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_list, 0, 3, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, reference, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_listmailbox arginfo_imap_list
|
||||
|
||||
#define arginfo_imap_lsub arginfo_imap_list
|
||||
|
||||
#define arginfo_imap_listsubscribed arginfo_imap_list
|
||||
|
||||
#define arginfo_imap_getsubscribed arginfo_imap_list
|
||||
|
||||
#define arginfo_imap_getmailboxes arginfo_imap_list
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_fetch_overview, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, sequence, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_alerts, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_errors arginfo_imap_alerts
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_last_error, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_search, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, criteria, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SE_FREE")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 0, "\"\"")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_imap_utf7_decode arginfo_imap_base64
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_utf7_encode, 0, 1, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#if defined(HAVE_IMAP_MUTF7)
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_utf8_to_mutf7, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_IMAP_MUTF7)
|
||||
#define arginfo_imap_mutf7_to_utf8 arginfo_imap_utf8_to_mutf7
|
||||
#endif
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_mime_header_decode, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_thread, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SE_FREE")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_timeout, 0, 1, MAY_BE_LONG|MAY_BE_BOOL)
|
||||
ZEND_ARG_TYPE_INFO(0, timeout_type, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_get_quota, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, quota_root, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_get_quotaroot, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_set_quota, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, quota_root, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox_size, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_setacl, 0, 4, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, imap, IMAP\\Connection, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, rights, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
#define arginfo_imap_getacl arginfo_imap_get_quotaroot
|
||||
#endif
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail, 0, 3, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_headers, IS_STRING, 1, "null")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cc, IS_STRING, 1, "null")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bcc, IS_STRING, 1, "null")
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return_path, IS_STRING, 1, "null")
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
|
||||
ZEND_FUNCTION(imap_open);
|
||||
ZEND_FUNCTION(imap_reopen);
|
||||
ZEND_FUNCTION(imap_close);
|
||||
ZEND_FUNCTION(imap_is_open);
|
||||
ZEND_FUNCTION(imap_num_msg);
|
||||
ZEND_FUNCTION(imap_num_recent);
|
||||
ZEND_FUNCTION(imap_headers);
|
||||
ZEND_FUNCTION(imap_headerinfo);
|
||||
ZEND_FUNCTION(imap_rfc822_parse_headers);
|
||||
ZEND_FUNCTION(imap_rfc822_write_address);
|
||||
ZEND_FUNCTION(imap_rfc822_parse_adrlist);
|
||||
ZEND_FUNCTION(imap_body);
|
||||
ZEND_FUNCTION(imap_bodystruct);
|
||||
ZEND_FUNCTION(imap_fetchbody);
|
||||
ZEND_FUNCTION(imap_fetchmime);
|
||||
ZEND_FUNCTION(imap_savebody);
|
||||
ZEND_FUNCTION(imap_fetchheader);
|
||||
ZEND_FUNCTION(imap_fetchstructure);
|
||||
ZEND_FUNCTION(imap_gc);
|
||||
ZEND_FUNCTION(imap_expunge);
|
||||
ZEND_FUNCTION(imap_delete);
|
||||
ZEND_FUNCTION(imap_undelete);
|
||||
ZEND_FUNCTION(imap_check);
|
||||
ZEND_FUNCTION(imap_listscan);
|
||||
ZEND_FUNCTION(imap_mail_copy);
|
||||
ZEND_FUNCTION(imap_mail_move);
|
||||
ZEND_FUNCTION(imap_mail_compose);
|
||||
ZEND_FUNCTION(imap_createmailbox);
|
||||
ZEND_FUNCTION(imap_renamemailbox);
|
||||
ZEND_FUNCTION(imap_deletemailbox);
|
||||
ZEND_FUNCTION(imap_subscribe);
|
||||
ZEND_FUNCTION(imap_unsubscribe);
|
||||
ZEND_FUNCTION(imap_append);
|
||||
ZEND_FUNCTION(imap_ping);
|
||||
ZEND_FUNCTION(imap_base64);
|
||||
ZEND_FUNCTION(imap_qprint);
|
||||
ZEND_FUNCTION(imap_8bit);
|
||||
ZEND_FUNCTION(imap_binary);
|
||||
ZEND_FUNCTION(imap_utf8);
|
||||
ZEND_FUNCTION(imap_status);
|
||||
ZEND_FUNCTION(imap_mailboxmsginfo);
|
||||
ZEND_FUNCTION(imap_setflag_full);
|
||||
ZEND_FUNCTION(imap_clearflag_full);
|
||||
ZEND_FUNCTION(imap_sort);
|
||||
ZEND_FUNCTION(imap_uid);
|
||||
ZEND_FUNCTION(imap_msgno);
|
||||
ZEND_FUNCTION(imap_list);
|
||||
ZEND_FUNCTION(imap_lsub);
|
||||
ZEND_FUNCTION(imap_getsubscribed);
|
||||
ZEND_FUNCTION(imap_getmailboxes);
|
||||
ZEND_FUNCTION(imap_fetch_overview);
|
||||
ZEND_FUNCTION(imap_alerts);
|
||||
ZEND_FUNCTION(imap_errors);
|
||||
ZEND_FUNCTION(imap_last_error);
|
||||
ZEND_FUNCTION(imap_search);
|
||||
ZEND_FUNCTION(imap_utf7_decode);
|
||||
ZEND_FUNCTION(imap_utf7_encode);
|
||||
#if defined(HAVE_IMAP_MUTF7)
|
||||
ZEND_FUNCTION(imap_utf8_to_mutf7);
|
||||
#endif
|
||||
#if defined(HAVE_IMAP_MUTF7)
|
||||
ZEND_FUNCTION(imap_mutf7_to_utf8);
|
||||
#endif
|
||||
ZEND_FUNCTION(imap_mime_header_decode);
|
||||
ZEND_FUNCTION(imap_thread);
|
||||
ZEND_FUNCTION(imap_timeout);
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FUNCTION(imap_get_quota);
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FUNCTION(imap_get_quotaroot);
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FUNCTION(imap_set_quota);
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FUNCTION(imap_setacl);
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FUNCTION(imap_getacl);
|
||||
#endif
|
||||
ZEND_FUNCTION(imap_mail);
|
||||
|
||||
|
||||
static const zend_function_entry ext_functions[] = {
|
||||
ZEND_FE(imap_open, arginfo_imap_open)
|
||||
ZEND_FE(imap_reopen, arginfo_imap_reopen)
|
||||
ZEND_FE(imap_close, arginfo_imap_close)
|
||||
ZEND_FE(imap_is_open, arginfo_imap_is_open)
|
||||
ZEND_FE(imap_num_msg, arginfo_imap_num_msg)
|
||||
ZEND_FE(imap_num_recent, arginfo_imap_num_recent)
|
||||
ZEND_FE(imap_headers, arginfo_imap_headers)
|
||||
ZEND_FE(imap_headerinfo, arginfo_imap_headerinfo)
|
||||
ZEND_FE(imap_rfc822_parse_headers, arginfo_imap_rfc822_parse_headers)
|
||||
ZEND_FE(imap_rfc822_write_address, arginfo_imap_rfc822_write_address)
|
||||
ZEND_FE(imap_rfc822_parse_adrlist, arginfo_imap_rfc822_parse_adrlist)
|
||||
ZEND_FE(imap_body, arginfo_imap_body)
|
||||
ZEND_FALIAS(imap_fetchtext, imap_body, arginfo_imap_fetchtext)
|
||||
ZEND_FE(imap_bodystruct, arginfo_imap_bodystruct)
|
||||
ZEND_FE(imap_fetchbody, arginfo_imap_fetchbody)
|
||||
ZEND_FE(imap_fetchmime, arginfo_imap_fetchmime)
|
||||
ZEND_FE(imap_savebody, arginfo_imap_savebody)
|
||||
ZEND_FE(imap_fetchheader, arginfo_imap_fetchheader)
|
||||
ZEND_FE(imap_fetchstructure, arginfo_imap_fetchstructure)
|
||||
ZEND_FE(imap_gc, arginfo_imap_gc)
|
||||
ZEND_FE(imap_expunge, arginfo_imap_expunge)
|
||||
ZEND_FE(imap_delete, arginfo_imap_delete)
|
||||
ZEND_FE(imap_undelete, arginfo_imap_undelete)
|
||||
ZEND_FE(imap_check, arginfo_imap_check)
|
||||
ZEND_FE(imap_listscan, arginfo_imap_listscan)
|
||||
ZEND_FALIAS(imap_scan, imap_listscan, arginfo_imap_scan)
|
||||
ZEND_FALIAS(imap_scanmailbox, imap_listscan, arginfo_imap_scanmailbox)
|
||||
ZEND_FE(imap_mail_copy, arginfo_imap_mail_copy)
|
||||
ZEND_FE(imap_mail_move, arginfo_imap_mail_move)
|
||||
ZEND_FE(imap_mail_compose, arginfo_imap_mail_compose)
|
||||
ZEND_FE(imap_createmailbox, arginfo_imap_createmailbox)
|
||||
ZEND_FALIAS(imap_create, imap_createmailbox, arginfo_imap_create)
|
||||
ZEND_FE(imap_renamemailbox, arginfo_imap_renamemailbox)
|
||||
ZEND_FALIAS(imap_rename, imap_renamemailbox, arginfo_imap_rename)
|
||||
ZEND_FE(imap_deletemailbox, arginfo_imap_deletemailbox)
|
||||
ZEND_FE(imap_subscribe, arginfo_imap_subscribe)
|
||||
ZEND_FE(imap_unsubscribe, arginfo_imap_unsubscribe)
|
||||
ZEND_FE(imap_append, arginfo_imap_append)
|
||||
ZEND_FE(imap_ping, arginfo_imap_ping)
|
||||
ZEND_FE(imap_base64, arginfo_imap_base64)
|
||||
ZEND_FE(imap_qprint, arginfo_imap_qprint)
|
||||
ZEND_FE(imap_8bit, arginfo_imap_8bit)
|
||||
ZEND_FE(imap_binary, arginfo_imap_binary)
|
||||
ZEND_FE(imap_utf8, arginfo_imap_utf8)
|
||||
ZEND_FE(imap_status, arginfo_imap_status)
|
||||
ZEND_FE(imap_mailboxmsginfo, arginfo_imap_mailboxmsginfo)
|
||||
ZEND_FE(imap_setflag_full, arginfo_imap_setflag_full)
|
||||
ZEND_FE(imap_clearflag_full, arginfo_imap_clearflag_full)
|
||||
ZEND_FE(imap_sort, arginfo_imap_sort)
|
||||
ZEND_FE(imap_uid, arginfo_imap_uid)
|
||||
ZEND_FE(imap_msgno, arginfo_imap_msgno)
|
||||
ZEND_FE(imap_list, arginfo_imap_list)
|
||||
ZEND_FALIAS(imap_listmailbox, imap_list, arginfo_imap_listmailbox)
|
||||
ZEND_FE(imap_lsub, arginfo_imap_lsub)
|
||||
ZEND_FALIAS(imap_listsubscribed, imap_lsub, arginfo_imap_listsubscribed)
|
||||
ZEND_FE(imap_getsubscribed, arginfo_imap_getsubscribed)
|
||||
ZEND_FE(imap_getmailboxes, arginfo_imap_getmailboxes)
|
||||
ZEND_FE(imap_fetch_overview, arginfo_imap_fetch_overview)
|
||||
ZEND_FE(imap_alerts, arginfo_imap_alerts)
|
||||
ZEND_FE(imap_errors, arginfo_imap_errors)
|
||||
ZEND_FE(imap_last_error, arginfo_imap_last_error)
|
||||
ZEND_FE(imap_search, arginfo_imap_search)
|
||||
ZEND_FE(imap_utf7_decode, arginfo_imap_utf7_decode)
|
||||
ZEND_FE(imap_utf7_encode, arginfo_imap_utf7_encode)
|
||||
#if defined(HAVE_IMAP_MUTF7)
|
||||
ZEND_FE(imap_utf8_to_mutf7, arginfo_imap_utf8_to_mutf7)
|
||||
#endif
|
||||
#if defined(HAVE_IMAP_MUTF7)
|
||||
ZEND_FE(imap_mutf7_to_utf8, arginfo_imap_mutf7_to_utf8)
|
||||
#endif
|
||||
ZEND_FE(imap_mime_header_decode, arginfo_imap_mime_header_decode)
|
||||
ZEND_FE(imap_thread, arginfo_imap_thread)
|
||||
ZEND_FE(imap_timeout, arginfo_imap_timeout)
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FE(imap_get_quota, arginfo_imap_get_quota)
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FE(imap_get_quotaroot, arginfo_imap_get_quotaroot)
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FE(imap_set_quota, arginfo_imap_set_quota)
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FE(imap_setacl, arginfo_imap_setacl)
|
||||
#endif
|
||||
#if (defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001))
|
||||
ZEND_FE(imap_getacl, arginfo_imap_getacl)
|
||||
#endif
|
||||
ZEND_FE(imap_mail, arginfo_imap_mail)
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
|
||||
static const zend_function_entry class_IMAP_Connection_methods[] = {
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
static void register_php_imap_symbols(int module_number)
|
||||
{
|
||||
REGISTER_LONG_CONSTANT("NIL", NIL, CONST_PERSISTENT | CONST_DEPRECATED);
|
||||
REGISTER_LONG_CONSTANT("IMAP_OPENTIMEOUT", PHP_IMAP_OPENTIMEOUT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMAP_READTIMEOUT", PHP_IMAP_READTIMEOUT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMAP_WRITETIMEOUT", PHP_IMAP_WRITETIMEOUT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMAP_CLOSETIMEOUT", PHP_IMAP_CLOSETIMEOUT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_DEBUG", OP_DEBUG, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_READONLY", OP_READONLY, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_ANONYMOUS", OP_ANONYMOUS, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_SHORTCACHE", OP_SHORTCACHE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_SILENT", OP_SILENT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_PROTOTYPE", OP_PROTOTYPE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_HALFOPEN", OP_HALFOPEN, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_EXPUNGE", OP_EXPUNGE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OP_SECURE", OP_SECURE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CL_EXPUNGE", PHP_EXPUNGE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FT_UID", FT_UID, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FT_PEEK", FT_PEEK, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FT_NOT", FT_NOT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FT_INTERNAL", FT_INTERNAL, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FT_PREFETCHTEXT", FT_PREFETCHTEXT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ST_UID", ST_UID, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ST_SILENT", ST_SILENT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ST_SET", ST_SET, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CP_UID", CP_UID, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CP_MOVE", CP_MOVE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SE_UID", SE_UID, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SE_FREE", SE_FREE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SE_NOPREFETCH", SE_NOPREFETCH, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SO_FREE", SO_FREE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SO_NOSERVER", SO_FREE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SA_MESSAGES", SA_MESSAGES, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SA_RECENT", SA_RECENT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SA_UNSEEN", SA_UNSEEN, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SA_UIDNEXT", SA_UIDNEXT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SA_UIDVALIDITY", SA_UIDVALIDITY, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SA_ALL", SA_ALL, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("LATT_NOINFERIORS", LATT_NOINFERIORS, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("LATT_NOSELECT", LATT_NOSELECT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("LATT_MARKED", LATT_MARKED, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("LATT_UNMARKED", LATT_UNMARKED, CONST_PERSISTENT);
|
||||
#if defined(LATT_REFERRAL)
|
||||
REGISTER_LONG_CONSTANT("LATT_REFERRAL", LATT_REFERRAL, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(LATT_HASCHILDREN)
|
||||
REGISTER_LONG_CONSTANT("LATT_HASCHILDREN", LATT_HASCHILDREN, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(LATT_HASNOCHILDREN)
|
||||
REGISTER_LONG_CONSTANT("LATT_HASNOCHILDREN", LATT_HASNOCHILDREN, CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("SORTDATE", SORTDATE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SORTARRIVAL", SORTARRIVAL, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SORTFROM", SORTFROM, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SORTSUBJECT", SORTSUBJECT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SORTTO", SORTTO, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SORTCC", SORTCC, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SORTSIZE", SORTSIZE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPETEXT", TYPETEXT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEMULTIPART", TYPEMULTIPART, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEMESSAGE", TYPEMESSAGE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEAPPLICATION", TYPEAPPLICATION, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEAUDIO", TYPEAUDIO, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEIMAGE", TYPEIMAGE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEVIDEO", TYPEVIDEO, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEMODEL", TYPEMODEL, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("TYPEOTHER", TYPEOTHER, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ENC7BIT", ENC7BIT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ENC8BIT", ENC8BIT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ENCBINARY", ENCBINARY, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ENCBASE64", ENCBASE64, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ENCQUOTEDPRINTABLE", ENCQUOTEDPRINTABLE, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("ENCOTHER", ENCOTHER, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMAP_GC_ELT", GC_ELT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMAP_GC_ENV", GC_ENV, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMAP_GC_TEXTS", GC_TEXTS, CONST_PERSISTENT);
|
||||
|
||||
|
||||
zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "imap_open", sizeof("imap_open") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
|
||||
}
|
||||
|
||||
static zend_class_entry *register_class_IMAP_Connection(void)
|
||||
{
|
||||
zend_class_entry ce, *class_entry;
|
||||
|
||||
INIT_NS_CLASS_ENTRY(ce, "IMAP", "Connection", class_IMAP_Connection_methods);
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
# The imap extension tests
|
||||
|
||||
Many of the tests in this directory require a mail server to be running, if
|
||||
there is no mail server the test will skip and warn, see skipif.inc for details.
|
||||
|
||||
To make the tests run parameters in the `skipif.inc` and `imap_include.inc`
|
||||
files will need to be changed to match the local mailserver configuration.
|
||||
|
||||
The tests have been checked using dovecot (on Linux 32 and 64 bit systems) and
|
||||
hMailServer on Windows. The tests are intended to be mailserver agnostic.
|
||||
|
||||
## Set-up tests on Ubuntu (checked on Ubuntu 18.04 (Bionic))
|
||||
The necessary packages can be installed using the following command;
|
||||
`apt-get install libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd sendmail`
|
||||
|
||||
The build of PHP will need to be compiled with the following flags:
|
||||
```
|
||||
--with-imap --with-kerberos --with-imap-ssl
|
||||
```
|
||||
|
||||
Then run the set-up script `ext/imap/tests/setup/setup.sh` which will add the `vmail`
|
||||
group and user which is used by Dovecot for the mailbox. It will also copy the
|
||||
`ext/imap/tests/setup/dovecot.conf` and `ext/imap/tests/setup/dovecotpass` to the correct
|
||||
location for Dovecot and restarts it for the new configuration to be enabled.
|
||||
@@ -1,55 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31142 test #1 (imap_mail_compose() generates incorrect output)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$envelope["from"]= "joe@example.com";
|
||||
$envelope["to"] = "foo@example.com";
|
||||
$envelope["cc"] = "bar@example.com";
|
||||
|
||||
$part1["type"] = TYPEMULTIPART;
|
||||
$part1["subtype"] = "mixed";
|
||||
|
||||
$part2["type"] = TYPEAPPLICATION;
|
||||
$part2["encoding"] = ENCBINARY;
|
||||
$part2["subtype"] = "octet-stream";
|
||||
$part2["description"] = "some file";
|
||||
$part2["contents.data"] = "ABC";
|
||||
|
||||
$part3["type"] = TYPETEXT;
|
||||
$part3["subtype"] = "plain";
|
||||
$part3["description"] = "description3";
|
||||
$part3["contents.data"] = "contents.data3\n\n\n\t";
|
||||
|
||||
$body[1] = $part1;
|
||||
$body[2] = $part2;
|
||||
$body[3] = $part3;
|
||||
|
||||
echo imap_mail_compose($envelope, $body);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
From: joe@example.com
|
||||
To: foo@example.com
|
||||
cc: bar@example.com
|
||||
MIME-Version: 1.0
|
||||
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
|
||||
|
||||
--%s
|
||||
Content-Type: APPLICATION/octet-stream
|
||||
Content-Transfer-Encoding: BASE64
|
||||
Content-Description: some file
|
||||
|
||||
QUJD
|
||||
|
||||
--%s
|
||||
Content-Type: TEXT/plain; CHARSET=US-ASCII
|
||||
Content-Description: description3
|
||||
|
||||
contents.data3
|
||||
|
||||
|
||||
|
||||
--%s--
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31142 test #2 (imap_mail_compose() generates incorrect output)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope["from"]= 'host@domain.com';
|
||||
$envelope["return_path"]= 'host@domain.com';
|
||||
|
||||
$part1["type"]=TYPETEXT;
|
||||
$part1["subtype"]="plain";
|
||||
$part1["encoding"]=ENCQUOTEDPRINTABLE ;
|
||||
$part1["charset"]='iso-8859-2';
|
||||
$part1["contents.data"]=imap_8bit('asn řkl');
|
||||
|
||||
$body = array($part1);
|
||||
|
||||
echo imap_mail_compose($envelope, $body);
|
||||
?>
|
||||
--EXPECT--
|
||||
From: host@domain.com
|
||||
MIME-Version: 1.0
|
||||
Content-Type: TEXT/plain; CHARSET=iso-8859-2
|
||||
Content-Transfer-Encoding: QUOTED-PRINTABLE
|
||||
|
||||
asn =C5=99kl
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32589 (crash inside imap_mail_compose() function)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$m_envelope["To"] = "mail@example.com";
|
||||
$m_part1["type"] = TYPEMULTIPART;
|
||||
$m_part1["subtype"] = "mixed";
|
||||
$m_part2["type"] = TYPETEXT;
|
||||
$m_part2["subtype"] = "plain";
|
||||
$m_part2["description"] = "text_message";
|
||||
|
||||
$m_part2["charset"] = "ISO-8859-2";
|
||||
|
||||
$m_part2["contents.data"] = "hello";
|
||||
$m_body[1] = $m_part1;
|
||||
$m_body[2] = $m_part2;
|
||||
echo imap_mail_compose($m_envelope, $m_body);
|
||||
?>
|
||||
--EXPECTF--
|
||||
MIME-Version: 1.0
|
||||
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
|
||||
|
||||
%s
|
||||
Content-Type: TEXT/plain; CHARSET=ISO-8859-2
|
||||
Content-Description: text_message
|
||||
|
||||
hello
|
||||
%s
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope["from"] = 'Santa <somewhere@northpole.gov>';
|
||||
$envelope["to"] = 'The bad smurf <bad@smurf.com>';
|
||||
$envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500';
|
||||
|
||||
$multipart["type"] = TYPEMULTIPART;
|
||||
$multipart["subtype"] = "MIXED";
|
||||
$body[] = $multipart; //add multipart stuff
|
||||
|
||||
$textpart["type"] = TYPEMULTIPART;
|
||||
$textpart["subtype"] = "ALTERNATIVE";
|
||||
$body[] = $textpart; //add body part
|
||||
|
||||
$plain["type"] = TYPETEXT;
|
||||
$plain["subtype"] = "PLAIN";
|
||||
$plain["charset"] = "iso-8859-1";
|
||||
$plain["encoding"] = ENCQUOTEDPRINTABLE;
|
||||
$plain["description"] = "Plaintype part of message";
|
||||
$plain['disposition'] = "inline";
|
||||
$plain["contents.data"] = 'See mom, it will crash';
|
||||
|
||||
$body[] = $plain; //next add plain text part
|
||||
|
||||
$html["type"] = TYPETEXT;
|
||||
$html["subtype"] = "HTML";
|
||||
$html["charset"] = "iso-8859-1";
|
||||
$html["encoding"] = ENCQUOTEDPRINTABLE;
|
||||
$html["description"] = "HTML part of message";
|
||||
$html['disposition'] = "inline";
|
||||
$html["contents.data"] = 'See mom, it will <b>crash</b>';
|
||||
|
||||
$body[] = $html;
|
||||
|
||||
echo imap_mail_compose($envelope, $body);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Date: Wed, 04 Jan 2006 19:24:43 -0500
|
||||
From: Santa <somewhere@northpole.gov>
|
||||
To: The bad smurf <bad@smurf.com>
|
||||
MIME-Version: 1.0
|
||||
Content-Type: MULTIPART/MIXED; BOUNDARY="%s"
|
||||
|
||||
--%s
|
||||
Content-Type: TEXT/ALTERNATIVE; CHARSET=US-ASCII
|
||||
|
||||
|
||||
--%s
|
||||
Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1
|
||||
Content-Transfer-Encoding: QUOTED-PRINTABLE
|
||||
Content-Description: Plaintype part of message
|
||||
|
||||
See mom, it will crash
|
||||
--%s
|
||||
Content-Type: TEXT/HTML; CHARSET=iso-8859-1
|
||||
Content-Transfer-Encoding: QUOTED-PRINTABLE
|
||||
Content-Description: HTML part of message
|
||||
|
||||
See mom, it will <b>crash</b>
|
||||
--%s--
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
Bug #40854 (imap_mail_compose() creates an invalid terminator for multipart e-mails)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope["from"]= "joe@example.com";
|
||||
$envelope["to"] = "foo@example.com";
|
||||
$envelope["cc"] = "bar@example.com";
|
||||
|
||||
$part1["type"] = TYPEMULTIPART;
|
||||
$part1["subtype"] = "mixed";
|
||||
|
||||
$part2["type"] = TYPEAPPLICATION;
|
||||
$part2["encoding"] = ENCBINARY;
|
||||
$part2["subtype"] = "octet-stream";
|
||||
$part2["description"] = 'a.txt';
|
||||
$part2["contents.data"] = '';
|
||||
|
||||
$part3["type"] = TYPETEXT;
|
||||
$part3["subtype"] = "plain";
|
||||
$part3["description"] = "description3";
|
||||
$part3["contents.data"] = "contents.data3\n\n\n\t";
|
||||
|
||||
$body[1] = $part1;
|
||||
$body[2] = $part2;
|
||||
$body[3] = $part3;
|
||||
|
||||
echo imap_mail_compose($envelope, $body);
|
||||
?>
|
||||
--EXPECTF--
|
||||
From: joe@example.com
|
||||
To: foo@example.com
|
||||
cc: bar@example.com
|
||||
MIME-Version: 1.0
|
||||
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
|
||||
|
||||
--%s
|
||||
Content-Type: APPLICATION/octet-stream
|
||||
Content-Transfer-Encoding: BASE64
|
||||
Content-Description: a.txt
|
||||
|
||||
|
||||
|
||||
--%s
|
||||
Content-Type: TEXT/plain; CHARSET=US-ASCII
|
||||
Content-Description: description3
|
||||
|
||||
contents.data3
|
||||
|
||||
|
||||
|
||||
--%s--
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #44098 (imap_utf8() returns only capital letters)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$exp = 'Luzon®14 dot CoM';
|
||||
$res = imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM');
|
||||
var_dump($res);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(17) "Luzon®14 dot CoM"
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #45705 test #1 (imap rfc822_parse_adrlist() modifies passed address parameter)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$address = 'John Doe <john@example.com>';
|
||||
var_dump($address);
|
||||
imap_rfc822_parse_adrlist($address, '');
|
||||
var_dump($address);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(27) "John Doe <john@example.com>"
|
||||
string(27) "John Doe <john@example.com>"
|
||||
@@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
Bug #45705 test #2 (imap rfc822_parse_adrlist() modifies passed address parameter)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$envelope = array('return_path' => 'John Doe <john@example.com>',
|
||||
'from' => 'John Doe <john@example.com>',
|
||||
'reply_to' => 'John Doe <john@example.com>',
|
||||
'to' => 'John Doe <john@example.com>',
|
||||
'cc' => 'John Doe <john@example.com>',
|
||||
'bcc' => 'John Doe <john@example.com>',
|
||||
);
|
||||
|
||||
var_dump($envelope);
|
||||
imap_mail_compose($envelope, [1 => ['cc' => 'Steve Doe <steve@example.com>',]]);
|
||||
var_dump($envelope);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(6) {
|
||||
["return_path"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["from"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["reply_to"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["to"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["cc"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["bcc"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
}
|
||||
array(6) {
|
||||
["return_path"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["from"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["reply_to"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["to"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["cc"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
["bcc"]=>
|
||||
string(27) "John Doe <john@example.com>"
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
--TEST--
|
||||
Bug #46918 (imap_rfc822_parse_adrlist host part not filled in correctly)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$adds = 'ian eiloart <iane@example.ac.uk>,
|
||||
shuf6@example.ac.uk,
|
||||
blobby,
|
||||
"ian,eiloart"<ian@example.ac.uk>,
|
||||
<@example.com:foo@example.ac.uk>,
|
||||
foo@#,
|
||||
ian@-example.com,
|
||||
ian@one@two';
|
||||
$add_arr = imap_rfc822_parse_adrlist($adds, 'example.com');
|
||||
var_export($add_arr);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array (
|
||||
0 =>
|
||||
(object) array(
|
||||
'mailbox' => 'iane',
|
||||
'host' => 'example.ac.uk',
|
||||
'personal' => 'ian eiloart',
|
||||
),
|
||||
1 =>
|
||||
(object) array(
|
||||
'mailbox' => 'shuf6',
|
||||
'host' => 'example.ac.uk',
|
||||
),
|
||||
2 =>
|
||||
(object) array(
|
||||
'mailbox' => 'blobby',
|
||||
'host' => 'example.com',
|
||||
),
|
||||
3 =>
|
||||
(object) array(
|
||||
'mailbox' => 'ian',
|
||||
'host' => 'example.ac.uk',
|
||||
'personal' => 'ian,eiloart',
|
||||
),
|
||||
4 =>
|
||||
(object) array(
|
||||
'mailbox' => 'foo',
|
||||
'host' => 'example.ac.uk',
|
||||
'adl' => '@example.com',
|
||||
),
|
||||
5 =>
|
||||
(object) array(
|
||||
'mailbox' => 'foo',
|
||||
'host' => '#',
|
||||
),
|
||||
6 =>
|
||||
(object) array(
|
||||
'mailbox' => 'ian',
|
||||
'host' => '-example.com',
|
||||
),
|
||||
7 =>
|
||||
(object) array(
|
||||
'mailbox' => 'ian',
|
||||
'host' => 'one',
|
||||
),
|
||||
8 =>
|
||||
(object) array(
|
||||
'mailbox' => 'UNEXPECTED_DATA_AFTER_ADDRESS',
|
||||
'host' => '.SYNTAX-ERROR.',
|
||||
),
|
||||
)
|
||||
Notice: PHP Request Shutdown: Unexpected characters at end of address: @two (errflg=3) in Unknown on line 0
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #53377 (imap_mime_header_decode() doesn't ignore \t during long MIME header unfolding)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$s = "=?UTF-8?Q?=E2=82=AC?=";
|
||||
$header = "$s\n $s\n\t$s";
|
||||
|
||||
var_dump(imap_mime_header_decode($header));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
object(stdClass)#1 (2) {
|
||||
["charset"]=>
|
||||
string(5) "UTF-8"
|
||||
["text"]=>
|
||||
string(3) "€"
|
||||
}
|
||||
[1]=>
|
||||
object(stdClass)#2 (2) {
|
||||
["charset"]=>
|
||||
string(5) "UTF-8"
|
||||
["text"]=>
|
||||
string(3) "€"
|
||||
}
|
||||
[2]=>
|
||||
object(stdClass)#3 (2) {
|
||||
["charset"]=>
|
||||
string(5) "UTF-8"
|
||||
["text"]=>
|
||||
string(3) "€"
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
--TEST--
|
||||
imap_open() DISABLE_AUTHENTICATOR ignores array param
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__. '/setup/imap_include.inc');
|
||||
|
||||
$in = @imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1);
|
||||
if (!$in) {
|
||||
die("skip could not connect to mailbox " . IMAP_SERVER_DEBUG);
|
||||
}
|
||||
$kerberos = false;
|
||||
if (is_array($errors = imap_errors())) {
|
||||
foreach ($errors as $err) {
|
||||
if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
|
||||
$kerberos = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$kerberos) {
|
||||
die("skip need a GSSAPI/Kerberos aware server");
|
||||
}
|
||||
?>
|
||||
--CONFLICTS--
|
||||
defaultmailbox
|
||||
--FILE--
|
||||
<?php
|
||||
// TODO Test Kerberos on CI
|
||||
$tests = array(
|
||||
'Array' => array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')),
|
||||
'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'),
|
||||
);
|
||||
require_once(__DIR__. '/setup/imap_include.inc');
|
||||
foreach ($tests as $name => $testparams) {
|
||||
echo "Test for $name\n";
|
||||
$in = imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1, $testparams);
|
||||
if ($in) {
|
||||
if (is_array($errors = imap_errors())) {
|
||||
foreach ($errors as $err) {
|
||||
if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
|
||||
echo "$err\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "Can't connect\n";
|
||||
}
|
||||
}
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Test for Array
|
||||
Test for String
|
||||
Done
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64076 (imap_sort() does not return FALSE on failure)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once __DIR__ . '/setup/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/setup/imap_include.inc';
|
||||
$stream = setup_test_mailbox('bug64076', 2);
|
||||
imap_errors(); // clear error stack
|
||||
var_dump(imap_sort($stream, SORTFROM, 0, 0, 'UNSUPPORTED SEARCH CRITERIUM'));
|
||||
var_dump(imap_errors() !== false);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'bug64076';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 2 msgs
|
||||
New mailbox created
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75774 imap_append HeapCorruction
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$fn = __DIR__ . DIRECTORY_SEPARATOR . "foo75774";
|
||||
$var1 = fopen($fn, "w");
|
||||
|
||||
try {
|
||||
imap_append($var1, "", "", "", "");
|
||||
} catch (\TypeError $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
fclose($var1);
|
||||
unlink($fn);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
imap_append(): Argument #1 ($imap) must be of type IMAP\Connection, resource given
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77020 (null pointer dereference in imap_mail)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--INI--
|
||||
sendmail_path="echo >/dev/null"
|
||||
--FILE--
|
||||
<?php
|
||||
// For Windows, set it to a string of length HOST_NAME_LEN (256) so the mail is not actually sent
|
||||
ini_set("SMTP", str_repeat("A", 256));
|
||||
|
||||
@imap_mail('1', 1, NULL);
|
||||
echo 'done'
|
||||
?>
|
||||
--EXPECTF--
|
||||
%Adone
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77153 (imap_open allows to run arbitrary shell commands via mailbox parameter)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--CONFLICTS--
|
||||
defaultmailbox
|
||||
--FILE--
|
||||
<?php
|
||||
$payload = "echo 'BUG'> " . __DIR__ . '/__bug';
|
||||
$payloadb64 = base64_encode($payload);
|
||||
$server = "x -oProxyCommand=echo\t$payloadb64|base64\t-d|sh}";
|
||||
@imap_open('{'.$server.':143/imap}INBOX', '', '');
|
||||
// clean
|
||||
imap_errors();
|
||||
var_dump(file_exists(__DIR__ . '/__bug'));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
--CLEAN--
|
||||
<?php
|
||||
if(file_exists(__DIR__ . '/__bug')) unlink(__DIR__ . '/__bug');
|
||||
?>
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80213 (imap_mail_compose() segfaults on certain $bodies)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope = [];
|
||||
$body = [[
|
||||
'type.parameters' => ['param'],
|
||||
'disposition' => ['disp'],
|
||||
], [
|
||||
'type.parameters' => ['param'],
|
||||
'disposition' => ['disp'],
|
||||
]];
|
||||
var_dump(imap_mail_compose($envelope, $body));
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
string(67) "MIME-Version: 1.0
|
||||
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
|
||||
|
||||
|
||||
"
|
||||
done
|
||||
@@ -1,67 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80215 (imap_mail_compose() may modify by-val parameters)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope = [
|
||||
"from" => 1,
|
||||
"to" => 2,
|
||||
"custom_headers" => [3],
|
||||
];
|
||||
$body = [[
|
||||
"contents.data" => 4,
|
||||
"type.parameters" => ['foo' => 5],
|
||||
"disposition" => ['bar' => 6],
|
||||
], [
|
||||
"contents.data" => 7,
|
||||
"type.parameters" => ['foo' => 8],
|
||||
"disposition" => ['bar' => 9],
|
||||
]];
|
||||
imap_mail_compose($envelope, $body);
|
||||
var_dump($envelope, $body);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
["from"]=>
|
||||
int(1)
|
||||
["to"]=>
|
||||
int(2)
|
||||
["custom_headers"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["contents.data"]=>
|
||||
int(4)
|
||||
["type.parameters"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
int(5)
|
||||
}
|
||||
["disposition"]=>
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
["contents.data"]=>
|
||||
int(7)
|
||||
["type.parameters"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
int(8)
|
||||
}
|
||||
["disposition"]=>
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
int(9)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80216 (imap_mail_compose() does not validate types/encodings)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], []]);
|
||||
imap_mail_compose([], [['type' => 12]]);
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], ['type' => 12]]);
|
||||
imap_mail_compose([], [['encoding' => 8]]);
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], ['encoding' => 8]]);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80220 (imap_mail_compose() may leak memory) - message/rfc822 regression
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$bodies = [[
|
||||
'type' => TYPEMESSAGE,
|
||||
'subtype' => 'RFC822',
|
||||
], [
|
||||
'contents.data' => 'asd',
|
||||
]];
|
||||
var_dump(imap_mail_compose([], $bodies));
|
||||
|
||||
$bodies = [[
|
||||
'type' => TYPEMESSAGE,
|
||||
], [
|
||||
'contents.data' => 'asd',
|
||||
]];
|
||||
var_dump(imap_mail_compose([], $bodies));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(53) "MIME-Version: 1.0
|
||||
Content-Type: MESSAGE/RFC822
|
||||
|
||||
|
||||
"
|
||||
string(53) "MIME-Version: 1.0
|
||||
Content-Type: MESSAGE/RFC822
|
||||
|
||||
|
||||
"
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80223 (imap_mail_compose() leaks envelope on malformed bodies)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
imap_mail_compose([], []);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_mail_compose([], [1]);
|
||||
} catch (\TypeError $e) {
|
||||
echo $e->getMessage(), \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_mail_compose([], [[]]);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), \PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
imap_mail_compose(): Argument #2 ($bodies) cannot be empty
|
||||
imap_mail_compose(): Argument #2 ($bodies) individual body must be of type array, int given
|
||||
imap_mail_compose(): Argument #2 ($bodies) individual body cannot be empty
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80226 (imap_sort() leaks sortpgm memory)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test\n";
|
||||
|
||||
$stream = setup_test_mailbox("bug80226", 0);
|
||||
var_dump(imap_sort($stream, SORTFROM, 0));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'bug80226';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a new mailbox for test
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80242 (imap_mail_compose() segfaults for multipart with rfc822)
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$bodies = [[
|
||||
'type' => TYPEMULTIPART,
|
||||
], [
|
||||
'type' => TYPETEXT,
|
||||
'contents.data' => 'some text',
|
||||
], [
|
||||
'type' => TYPEMESSAGE,
|
||||
'subtype' => 'RFC822',
|
||||
]];
|
||||
imap_mail_compose([], $bodies);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -1,66 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
// create a new mailbox and add 10 new messages to it
|
||||
$mail_box = setup_test_mailbox_for_uid_tests('bug80438');
|
||||
|
||||
$message_number_array = imap_search($mail_box, 'ALL', SE_UID);
|
||||
|
||||
var_dump($message_number_array);
|
||||
|
||||
foreach ($message_number_array as $message_unique_id)
|
||||
{
|
||||
echo 'Unique ID: ';
|
||||
var_dump($message_unique_id);
|
||||
echo 'Ordered message number: ';
|
||||
var_dump(imap_msgno($mail_box, $message_unique_id));
|
||||
}
|
||||
|
||||
imap_close($mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'bug80438';
|
||||
require_once __DIR__.'/setup/clean.inc';
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
[4]=>
|
||||
int(9)
|
||||
[5]=>
|
||||
int(10)
|
||||
}
|
||||
Unique ID: int(1)
|
||||
Ordered message number: int(1)
|
||||
Unique ID: int(2)
|
||||
Ordered message number: int(2)
|
||||
Unique ID: int(7)
|
||||
Ordered message number: int(3)
|
||||
Unique ID: int(8)
|
||||
Ordered message number: int(4)
|
||||
Unique ID: int(9)
|
||||
Ordered message number: int(5)
|
||||
Unique ID: int(10)
|
||||
Ordered message number: int(6)
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80710 (imap_mail_compose() header injection) - MIME Splitting Attack
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope["from"]= "joe@example.com\n From : X-INJECTED";
|
||||
$envelope["to"] = "foo@example.com\nFrom: X-INJECTED";
|
||||
$envelope["cc"] = "bar@example.com\nFrom: X-INJECTED";
|
||||
$envelope["subject"] = "bar@example.com\n\n From : X-INJECTED";
|
||||
$envelope["x-remail"] = "bar@example.com\nFrom: X-INJECTED";
|
||||
$envelope["something"] = "bar@example.com\nFrom: X-INJECTED";
|
||||
|
||||
$part1["type"] = TYPEMULTIPART;
|
||||
$part1["subtype"] = "mixed";
|
||||
|
||||
$part2["type"] = TYPEAPPLICATION;
|
||||
$part2["encoding"] = ENCBINARY;
|
||||
$part2["subtype"] = "octet-stream\nContent-Type: X-INJECTED";
|
||||
$part2["description"] = "some file\nContent-Type: X-INJECTED";
|
||||
$part2["contents.data"] = "ABC\nContent-Type: X-INJECTED";
|
||||
|
||||
$part3["type"] = TYPETEXT;
|
||||
$part3["subtype"] = "plain";
|
||||
$part3["description"] = "description3";
|
||||
$part3["contents.data"] = "contents.data3\n\n\n\t";
|
||||
|
||||
$body[1] = $part1;
|
||||
$body[2] = $part2;
|
||||
$body[3] = $part3;
|
||||
|
||||
echo imap_mail_compose($envelope, $body);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imap_mail_compose(): header injection attempt in from in %s on line %d
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80710 (imap_mail_compose() header injection) - Remail
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope["from"]= "joe@example.com\n From : X-INJECTED";
|
||||
$envelope["to"] = "foo@example.com\nFrom: X-INJECTED";
|
||||
$envelope["cc"] = "bar@example.com\nFrom: X-INJECTED";
|
||||
$envelope["subject"] = "bar@example.com\n\n From : X-INJECTED";
|
||||
$envelope["remail"] = "X-INJECTED-REMAIL: X-INJECTED\nFrom: X-INJECTED-REMAIL-FROM"; //<--- Injected as first hdr
|
||||
$envelope["something"] = "bar@example.com\nFrom: X-INJECTED";
|
||||
|
||||
$part1["type"] = TYPEMULTIPART;
|
||||
$part1["subtype"] = "mixed";
|
||||
|
||||
$part2["type"] = TYPEAPPLICATION;
|
||||
$part2["encoding"] = ENCBINARY;
|
||||
$part2["subtype"] = "octet-stream\nContent-Type: X-INJECTED";
|
||||
$part2["description"] = "some file\nContent-Type: X-INJECTED";
|
||||
$part2["contents.data"] = "ABC\nContent-Type: X-INJECTED";
|
||||
|
||||
$part3["type"] = TYPETEXT;
|
||||
$part3["subtype"] = "plain";
|
||||
$part3["description"] = "description3";
|
||||
$part3["contents.data"] = "contents.data3\n\n\n\t";
|
||||
|
||||
$body[1] = $part1;
|
||||
$body[2] = $part2;
|
||||
$body[3] = $part3;
|
||||
|
||||
echo imap_mail_compose($envelope, $body);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imap_mail_compose(): header injection attempt in remail in %s on line %d
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80800: imap_open() fails when the flags parameter includes CL_EXPUNGE
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
$mail_box = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, flags: CL_EXPUNGE);
|
||||
var_dump(imap_reopen($mail_box, IMAP_DEFAULT_MAILBOX, flags: CL_EXPUNGE));
|
||||
imap_close($mail_box);
|
||||
|
||||
echo 'Connected without any issues', "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Connected without any issues
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug GH-9309 (Segfault when connection is used after imap_close())
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('gh9309', 0, $mailbox);
|
||||
imap_close($stream_id);
|
||||
try {
|
||||
imap_headers($stream_id);
|
||||
} catch (ValueError $ex) {
|
||||
echo $ex->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'gh9309';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
IMAP\Connection is already closed
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_8bit() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_8bit() : basic functionality ***\n";
|
||||
|
||||
var_dump(imap_8bit("String with CRLF at end \r\n"));
|
||||
//NB this appears to be a bug in cclient; a space at end of string should be encoded as =20
|
||||
var_dump(imap_8bit("String with space at end "));
|
||||
var_dump(imap_8bit("String with tabs \t\t in middle"));
|
||||
var_dump(imap_8bit("String with tab at end \t"));
|
||||
var_dump(imap_8bit("\x00\x01\x02\x03\x04\xfe\xff\x0a\x0d"));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_8bit() : basic functionality ***
|
||||
string(28) "String with CRLF at end=20
|
||||
"
|
||||
string(25) "String with space at end "
|
||||
string(33) "String with tabs =09=09 in middle"
|
||||
string(26) "String with tab at end =09"
|
||||
string(27) "=00=01=02=03=04=FE=FF=0A=0D"
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_append() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__. '/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_append() : basic functionality ***\n";
|
||||
|
||||
require_once(__DIR__. '/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test\n";
|
||||
$imap_stream = setup_test_mailbox("imapappendbaisc", 0);
|
||||
|
||||
$mb_details = imap_mailboxmsginfo($imap_stream);
|
||||
echo "Add a couple of msgs to the new mailbox\n";
|
||||
var_dump(imap_append($imap_stream, $mb_details->Mailbox
|
||||
, "From: webmaster@example.com\r\n"
|
||||
. "To: info@example.com\r\n"
|
||||
. "Subject: Test message\r\n"
|
||||
. "\r\n"
|
||||
. "this is a test message, please ignore\r\n"
|
||||
));
|
||||
|
||||
var_dump(imap_append($imap_stream, $mb_details->Mailbox
|
||||
, "From: webmaster@example.com\r\n"
|
||||
. "To: info@example.com\r\n"
|
||||
. "Subject: Another test\r\n"
|
||||
. "\r\n"
|
||||
. "this is another test message, please ignore it too!!\r\n"
|
||||
));
|
||||
|
||||
$check = imap_check($imap_stream);
|
||||
echo "Msg Count after append : ". $check->Nmsgs . "\n";
|
||||
|
||||
echo "List the msg headers\n";
|
||||
var_dump(imap_headers($imap_stream));
|
||||
|
||||
imap_close($imap_stream);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapappendbaisc';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_append() : basic functionality ***
|
||||
Create a new mailbox for test
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
Add a couple of msgs to the new mailbox
|
||||
bool(true)
|
||||
bool(true)
|
||||
Msg Count after append : 2
|
||||
List the msg headers
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%w%s 1)%s webmaster@example.co Test message (%d chars)"
|
||||
[1]=>
|
||||
string(%d) "%w%s 2)%s webmaster@example.co Another test (%d chars)"
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_base64() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_base64() : basic functionality ***\n";
|
||||
|
||||
$str = 'This is an example string to be base 64 encoded';
|
||||
$base64 = base64_encode($str);
|
||||
if (imap_base64($base64) == $str) {
|
||||
echo "TEST PASSED\n";
|
||||
} else {
|
||||
echo "TEST FAILED";
|
||||
}
|
||||
|
||||
$str = '!£$%^&*()_+-={][];;@~#?/>.<,';
|
||||
$base64 = base64_encode($str);
|
||||
if (imap_base64($base64) == $str) {
|
||||
echo "TEST PASSED\n";
|
||||
} else {
|
||||
echo "TEST FAILED";
|
||||
}
|
||||
|
||||
$hex = 'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
|
||||
$base64 = base64_encode($hex);
|
||||
if (imap_base64($base64) == $hex) {
|
||||
echo "TEST PASSED\n";
|
||||
} else {
|
||||
echo "TEST FAILED";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_base64() : basic functionality ***
|
||||
TEST PASSED
|
||||
TEST PASSED
|
||||
TEST PASSED
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_binary() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_binary() : basic functionality ***\n";
|
||||
|
||||
echo "Encode as short string\n";
|
||||
$str = 'This is an example string to be base 64 encoded';
|
||||
$base64 = imap_binary($str);
|
||||
var_dump(bin2hex($base64));
|
||||
|
||||
echo "Encode a string which results in more than 60 charters of output\n";
|
||||
$str = 'This is a long string with results in more than 60 characters of output';
|
||||
$base64 = imap_binary($str);
|
||||
var_dump(bin2hex($base64));
|
||||
|
||||
echo "Encode a string with special characters\n";
|
||||
$str = '_+-={][];;@~#?/>.<,';
|
||||
$base64 = imap_binary($str);
|
||||
var_dump(bin2hex($base64));
|
||||
|
||||
echo "Encode some hexadecimal data\n";
|
||||
$hex = 'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
|
||||
$base64 = imap_binary($hex);
|
||||
var_dump(bin2hex($base64));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_binary() : basic functionality ***
|
||||
Encode as short string
|
||||
string(136) "5647687063794270637942686269426c654746746347786c49484e30636d6c755a794230627942695a53426959584e6c49445930494756755932396b0d0a5a57513d0d0a"
|
||||
Encode a string which results in more than 60 charters of output
|
||||
string(200) "56476870637942706379426849477876626d6367633352796157356e4948647064476767636d567a64577830637942706269427462334a6c4948526f0d0a595734674e6a416759326868636d466a64475679637942765a694276645852776458513d0d0a"
|
||||
Encode a string with special characters
|
||||
string(60) "5879737450587464573130374f30422b497a3876506934384c413d3d0d0a"
|
||||
Encode some hexadecimal data
|
||||
string(144) "65444177584867774d5678344d444a636544417a584867774e4678344d445663654441325848684751567834526b4a6365455a4458486847524678340d0a526b566365455a470d0a"
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_body() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_body() : basic functionality ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test\n";
|
||||
$imap_stream = setup_test_mailbox("imapbodybasic", 1);
|
||||
|
||||
$check = imap_check($imap_stream);
|
||||
echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
|
||||
|
||||
// show body for msg 1
|
||||
var_dump(imap_body($imap_stream, 1));
|
||||
|
||||
//Access via FT_UID
|
||||
var_dump(imap_body($imap_stream, 1, FT_UID));
|
||||
|
||||
imap_close($imap_stream);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapbodybasic';
|
||||
require_once __DIR__.'/setup/clean.inc';
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_body() : basic functionality ***
|
||||
Create a new mailbox for test
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
Msg Count in new mailbox: 1
|
||||
string(%d) "1: this is a test message, please ignore
|
||||
newline%r\R?%r"
|
||||
string(%d) "1: this is a test message, please ignore
|
||||
newline%r\R?%r"
|
||||
@@ -1,52 +0,0 @@
|
||||
--TEST--
|
||||
imap_body() errors: ValueError and Warnings
|
||||
--CREDITS--
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapbodyerror", 0);
|
||||
|
||||
try {
|
||||
imap_body($imap_mail_box, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_body($imap_mail_box, 1, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
// Access not existing
|
||||
var_dump(imap_body($imap_mail_box, 255));
|
||||
var_dump(imap_body($imap_mail_box, 255, FT_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapbodyerror';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
imap_body(): Argument #2 ($message_num) must be greater than 0
|
||||
imap_body(): Argument #3 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
|
||||
|
||||
Warning: imap_body(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imap_body(): UID does not exist in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
imap_body() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapbodyuid", $msg_no, $uid);
|
||||
|
||||
var_dump(imap_body($imap_mail_box, $uid, FT_UID) === imap_body($imap_mail_box, $msg_no));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapbodyuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_bodystruct() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing string imap_bodystruct : basic functionality ***\n";
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test and add a multipart msgs\n";
|
||||
$imap_stream = setup_test_mailbox("imapbodystructbasic", 1, $mailbox, "multipart");
|
||||
|
||||
echo "\nGet and validate structure of body part 1\n";
|
||||
|
||||
$m = imap_bodystruct($imap_stream, 1, "1");
|
||||
|
||||
$mandatoryFields = [
|
||||
'ifsubtype',
|
||||
'ifdescription',
|
||||
'ifid',
|
||||
'ifdisposition',
|
||||
'ifdparameters',
|
||||
'ifparameters',
|
||||
];
|
||||
|
||||
function isValid($param) {
|
||||
return ($param == 0) || ($param == 1);
|
||||
}
|
||||
|
||||
foreach($mandatoryFields as $mf) {
|
||||
if (isValid($m->$mf)) {
|
||||
echo "$mf is 0 or 1\n";
|
||||
} else {
|
||||
echo "$mf FAIL\n";
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($m->parameters)) {
|
||||
echo "parameters is an array\n";
|
||||
}
|
||||
|
||||
echo "\nTry to get part 4!\n";
|
||||
var_dump(imap_bodystruct($imap_stream, 1, "4"));
|
||||
|
||||
imap_close($imap_stream);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapbodystructbasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing string imap_bodystruct : basic functionality ***
|
||||
Create a new mailbox for test and add a multipart msgs
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
|
||||
Get and validate structure of body part 1
|
||||
ifsubtype is 0 or 1
|
||||
ifdescription is 0 or 1
|
||||
ifid is 0 or 1
|
||||
ifdisposition is 0 or 1
|
||||
ifdparameters is 0 or 1
|
||||
ifparameters is 0 or 1
|
||||
parameters is an array
|
||||
|
||||
Try to get part 4!
|
||||
bool(false)
|
||||
@@ -1,120 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_clearflag_full() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_clearflag_full() : basic functionality ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test\n";
|
||||
$imap_stream = setup_test_mailbox("imapclearflagfullbasic", 10);
|
||||
|
||||
$check = imap_check($imap_stream);
|
||||
echo "Initial msg count in new_mailbox : ". $check->Nmsgs . "\n";
|
||||
|
||||
echo "Set some flags\n";
|
||||
var_dump(imap_setflag_full($imap_stream, "1,3", "\\Seen \\Answered"));
|
||||
var_dump(imap_setflag_full($imap_stream, "2,4", "\\Answered"));
|
||||
var_dump(imap_setflag_full($imap_stream, "5,7", "\\Flagged \\Deleted"));
|
||||
var_dump(imap_setflag_full($imap_stream, "6,8", "\\Deleted"));
|
||||
var_dump(imap_setflag_full($imap_stream, "9,10", "\\Draft \\Flagged"));
|
||||
|
||||
var_dump(imap_search($imap_stream, "SEEN"));
|
||||
var_dump(imap_search($imap_stream, "ANSWERED"));
|
||||
var_dump(imap_search($imap_stream, "FLAGGED"));
|
||||
var_dump(imap_search($imap_stream, "DELETED"));
|
||||
|
||||
var_dump(imap_clearflag_full($imap_stream, "1,4", "\\Answered"));
|
||||
var_dump(imap_clearflag_full($imap_stream, "5,6,7,8", "\\Deleted"));
|
||||
var_dump(imap_clearflag_full($imap_stream, "9", "\\Flagged"));
|
||||
|
||||
var_dump(imap_search($imap_stream, "SEEN"));
|
||||
var_dump(imap_search($imap_stream, "ANSWERED"));
|
||||
var_dump(imap_search($imap_stream, "FLAGGED"));
|
||||
var_dump(imap_search($imap_stream, "DELETED"));
|
||||
|
||||
imap_close($imap_stream);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapclearflagfullbasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_clearflag_full() : basic functionality ***
|
||||
Create a new mailbox for test
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Initial msg count in new_mailbox : 10
|
||||
Set some flags
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(7)
|
||||
[2]=>
|
||||
int(9)
|
||||
[3]=>
|
||||
int(10)
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
}
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(7)
|
||||
[2]=>
|
||||
int(10)
|
||||
}
|
||||
bool(false)
|
||||
@@ -1,92 +0,0 @@
|
||||
--TEST--
|
||||
imap_clearflag_full() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapclearflagfulluid");
|
||||
|
||||
/* This works on the assumption that UID message 3 to 6 inclusive are deleted. */
|
||||
|
||||
imap_setflag_full($imap_mail_box, '2,8,9', '\Answered', ST_UID);
|
||||
imap_setflag_full($imap_mail_box, '7,10', '\Deleted', ST_UID);
|
||||
imap_setflag_full($imap_mail_box, '7:9', '\Flagged', ST_UID);
|
||||
|
||||
// Testing individual entry
|
||||
imap_clearflag_full($imap_mail_box, '10', '\Deleted', ST_UID);
|
||||
// Testing multiple entries entry
|
||||
imap_clearflag_full($imap_mail_box, '2,9', '\Answered', ST_UID);
|
||||
// Testing entry range
|
||||
imap_clearflag_full($imap_mail_box, '7:8', '\Flagged', ST_UID);
|
||||
|
||||
|
||||
echo 'ALL: ';
|
||||
var_dump(imap_search($imap_mail_box, 'ALL'));
|
||||
echo 'ALL (with UID correspondance): ';
|
||||
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
|
||||
echo 'ANSWERED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'ANSWERED'));
|
||||
echo 'DELETED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'DELETED'));
|
||||
echo 'FLAGGED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'FLAGGED'));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapclearflagfulluid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
ALL: array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
}
|
||||
ALL (with UID correspondance): array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
[4]=>
|
||||
int(9)
|
||||
[5]=>
|
||||
int(10)
|
||||
}
|
||||
ANSWERED: array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
DELETED: array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
FLAGGED: array(1) {
|
||||
[0]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_close() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_close() : basic functionality ***\n";
|
||||
|
||||
// include file for required variables in imap_open()
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
// Initialize required variables
|
||||
$stream_id = setup_test_mailbox('imapclosebasic', 3, $mailbox); // set up temp mailbox with 3 messages
|
||||
$options = CL_EXPUNGE;
|
||||
|
||||
// mark messages in inbox for deletion
|
||||
for ($i = 1; $i < 4; $i++) {
|
||||
imap_delete($stream_id, $i);
|
||||
}
|
||||
|
||||
// Calling imap_close() with all possible arguments
|
||||
echo "\n-- Call to imap_close() with all possible arguments --\n";
|
||||
var_dump( imap_close($stream_id, $options) );
|
||||
|
||||
// check that CL_EXPUNGE worked
|
||||
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
|
||||
echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n";
|
||||
|
||||
// Calling imap_close() with mandatory arguments
|
||||
echo "\n-- Call to imap_close() with mandatory arguments --\n";
|
||||
var_dump( imap_close($stream_id) );
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapclosebasic';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_close() : basic functionality ***
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
|
||||
-- Call to imap_close() with all possible arguments --
|
||||
bool(true)
|
||||
There are now 0 msgs in mailbox '%sINBOX.phpttestimapclosebasic'
|
||||
|
||||
-- Call to imap_close() with mandatory arguments --
|
||||
bool(true)
|
||||
@@ -1,88 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_close() function : usage variations - different ints as $flags arg
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Pass different integers as $flags arg to imap_close() to test which are
|
||||
* recognised as CL_EXPUNGE option
|
||||
*/
|
||||
|
||||
echo "*** Testing imap_close() : usage variations ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$inputs = array (0, 3.2768e4, -32768, PHP_INT_MAX, -PHP_INT_MAX);
|
||||
|
||||
$stream_id = setup_test_mailbox('imapclosevar4', 3, $mailbox); // set up temp mailbox with 3 messages
|
||||
|
||||
// loop through each element of $inputs to check the behavior of imap_close()
|
||||
$iterator = 1;
|
||||
foreach($inputs as $input) {
|
||||
|
||||
// mark added messages for deletion
|
||||
for ($i = 1; $i < 4; $i++) {
|
||||
imap_delete($stream_id, $i);
|
||||
}
|
||||
echo "\n-- Iteration $iterator --\n";
|
||||
try {
|
||||
var_dump( $check = imap_close($stream_id, $input) );
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
$check = false;
|
||||
}
|
||||
|
||||
// check that imap_close was successful, if not call imap_close and explicitly set CL_EXPUNGE
|
||||
if(false === $check) {
|
||||
imap_close($stream_id, CL_EXPUNGE);
|
||||
} else {
|
||||
// if imap_close was successful test whether CL_EXPUNGE was set by doing a message count
|
||||
$imap_stream = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
|
||||
$num_msg = imap_num_msg($imap_stream);
|
||||
if ($num_msg != 0) {
|
||||
echo "CL_EXPUNGE was not set, $num_msg msgs in mailbox\n";
|
||||
} else {
|
||||
echo "CL_EXPUNGE was set\n";
|
||||
}
|
||||
// call imap_close with CL_EXPUNGE explicitly set in case mailbox not empty
|
||||
imap_close($imap_stream, CL_EXPUNGE);
|
||||
}
|
||||
$iterator++;
|
||||
|
||||
// get $stream_id for next iteration
|
||||
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
|
||||
populate_mailbox($stream_id, $mailbox, 3);
|
||||
|
||||
};
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapclosevar4';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_close() : usage variations ***
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
|
||||
-- Iteration 1 --
|
||||
bool(true)
|
||||
CL_EXPUNGE was not set, 3 msgs in mailbox
|
||||
|
||||
-- Iteration 2 --
|
||||
bool(true)
|
||||
CL_EXPUNGE was set
|
||||
|
||||
-- Iteration 3 --
|
||||
imap_close(): Argument #2 ($flags) must be CL_EXPUNGE or 0
|
||||
|
||||
-- Iteration 4 --
|
||||
imap_close(): Argument #2 ($flags) must be CL_EXPUNGE or 0
|
||||
|
||||
-- Iteration 5 --
|
||||
imap_close(): Argument #2 ($flags) must be CL_EXPUNGE or 0
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Attempt to instantiate an IMAP\Connection directly
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
new IMAP\Connection();
|
||||
} catch (Error $ex) {
|
||||
echo "Exception: ", $ex->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Exception: Cannot directly construct IMAP\Connection, use imap_open() instead
|
||||
@@ -1,70 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_createmailbox() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once __DIR__.'/setup/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_createmailbox() : basic functionality ***\n";
|
||||
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
$imap_stream = setup_test_mailbox("imapcreatemailboxbasic", 0);
|
||||
|
||||
$newname = "phpnewbox";
|
||||
|
||||
echo "Newname will be '$newname'\n";
|
||||
|
||||
$newbox = imap_utf7_encode(IMAP_SERVER.$newname);
|
||||
if (imap_createmailbox($imap_stream, $newbox)) {
|
||||
|
||||
echo "Add a couple of msgs to '$newname' mailbox\n";
|
||||
populate_mailbox($imap_stream, $newbox, 2);
|
||||
|
||||
$status = imap_status($imap_stream, $newbox, SA_ALL);
|
||||
if ($status) {
|
||||
echo "Your new mailbox '$newname' has the following status:\n";
|
||||
echo "Messages: " . $status->messages . "\n";
|
||||
echo "Recent: " . $status->recent . "\n";
|
||||
echo "Unseen: " . $status->unseen . "\n";
|
||||
echo "UIDnext: " . $status->uidnext . "\n";
|
||||
echo "UIDvalidity: " . $status->uidvalidity . "\n";
|
||||
|
||||
} else {
|
||||
echo "imap_status on new mailbox failed: " . imap_last_error() . "\n";
|
||||
}
|
||||
|
||||
if (imap_deletemailbox($imap_stream, $newbox)) {
|
||||
echo "Mailbox '$newname' removed to restore initial state\n";
|
||||
} else {
|
||||
echo "imap_deletemailbox on new mailbox failed: " . implode("\n", imap_errors()) . "\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "could not create new mailbox: " . implode("\n", imap_errors()) . "\n";
|
||||
}
|
||||
|
||||
imap_close($imap_stream);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapcreatemailboxbasic';
|
||||
require_once __DIR__ . '/setup/clean.inc';
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_createmailbox() : basic functionality ***
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
Newname will be 'phpnewbox'
|
||||
Add a couple of msgs to 'phpnewbox' mailbox
|
||||
Your new mailbox 'phpnewbox' has the following status:
|
||||
Messages: 2
|
||||
Recent: 2
|
||||
Unseen: 2
|
||||
UIDnext: %d
|
||||
UIDvalidity: %d
|
||||
Mailbox 'phpnewbox' removed to restore initial state
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
imap_delete() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapdeleteuid", $msg_no, $uid);
|
||||
|
||||
imap_delete($imap_mail_box, $uid, FT_UID);
|
||||
var_dump(imap_search($imap_mail_box, 'DELETED', SE_UID));
|
||||
imap_expunge($imap_mail_box);
|
||||
|
||||
echo 'After expunging: ';
|
||||
var_dump(imap_search($imap_mail_box, 'DELETED', SE_UID));
|
||||
|
||||
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapdeleteuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(9)
|
||||
}
|
||||
After expunging: bool(false)
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
[4]=>
|
||||
int(10)
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_errors() function : anonymous user not supported
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once __DIR__.'/setup/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_errors() : anonymous user not supported ***\n";
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
$mbox = @imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_ANONYMOUS);
|
||||
|
||||
echo "List any errors\n";
|
||||
var_dump(imap_errors());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_errors() : anonymous user not supported ***
|
||||
List any errors
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetch_overview() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_fetch_overview() : basic functionality ***\n";
|
||||
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
// create a new mailbox and add two new messages to it
|
||||
$stream_id = setup_test_mailbox('imapfetchoverviewbasic', 2, $mailbox, false);
|
||||
|
||||
// get UID for new message
|
||||
$msg_no = imap_uid($stream_id, 1);
|
||||
$options = FT_UID;
|
||||
|
||||
// Calling imap_fetch_overview() with all possible arguments
|
||||
echo "\n-- All possible arguments --\n";
|
||||
$a = imap_fetch_overview($stream_id, "$msg_no", $options) ;
|
||||
echo "\n--> Object #1\n";
|
||||
displayOverviewFields($a[0]);
|
||||
|
||||
// Calling imap_fetch_overview() with mandatory arguments
|
||||
echo "\n-- Mandatory arguments --\n";
|
||||
$a = imap_fetch_overview($stream_id, '1:2') ;
|
||||
|
||||
//first object in array
|
||||
echo "\n--> Object #1\n";
|
||||
displayOverviewFields($a[0]);
|
||||
|
||||
//Second object in array
|
||||
echo "\n--> Object #2\n";
|
||||
displayOverviewFields($a[1]);
|
||||
|
||||
imap_close($stream_id);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchoverviewbasic';
|
||||
require_once __DIR__.'/setup/clean.inc';
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetch_overview() : basic functionality ***
|
||||
Create a temporary mailbox and add 2 msgs
|
||||
New mailbox created
|
||||
|
||||
-- All possible arguments --
|
||||
|
||||
--> Object #1
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 1
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
-- Mandatory arguments --
|
||||
|
||||
--> Object #1
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 1
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
--> Object #2
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 2
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetch_overview() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchoverviewuid", $msg_no, $uid);
|
||||
|
||||
// Usage of == because comparing objects
|
||||
var_dump(imap_fetch_overview($imap_mail_box, $uid, FT_UID) == imap_fetch_overview($imap_mail_box, $msg_no));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchoverviewuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,139 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetch_overview() function : usage variations - $msg_no argument
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Pass different sequences/msg numbers as $msg_no argument to test behaviour
|
||||
* of imap_fetch_overview()
|
||||
*/
|
||||
|
||||
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
$stream_id = setup_test_mailbox('imapfetchoverviewvar5', 3, $mailbox, false); // set up temp mailbox with 3 msgs
|
||||
|
||||
$sequences = [
|
||||
0,
|
||||
4, // out of range
|
||||
'4', // out of range
|
||||
'2',
|
||||
'1,3',
|
||||
'1, 2',
|
||||
'1:3', // pass uid without setting FT_UID option
|
||||
];
|
||||
|
||||
foreach ($sequences as $msg_no) {
|
||||
echo "\n-- \$msg_no is $msg_no --\n";
|
||||
$overview = imap_fetch_overview($stream_id, $msg_no);
|
||||
if (!$overview) {
|
||||
echo imap_last_error() . "\n";
|
||||
} else {
|
||||
foreach($overview as $ov) {
|
||||
echo "\n";
|
||||
displayOverviewFields($ov);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear error stack
|
||||
imap_errors();
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchoverviewvar5';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetch_overview() : usage variations ***
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
|
||||
-- $msg_no is 0 --
|
||||
Sequence out of range
|
||||
|
||||
-- $msg_no is 4 --
|
||||
Sequence out of range
|
||||
|
||||
-- $msg_no is 4 --
|
||||
Sequence out of range
|
||||
|
||||
-- $msg_no is 2 --
|
||||
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 2
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
-- $msg_no is 1,3 --
|
||||
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 1
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 3
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
-- $msg_no is 1, 2 --
|
||||
Syntax error in sequence
|
||||
|
||||
-- $msg_no is 1:3 --
|
||||
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 1
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 2
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 3
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
@@ -1,105 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetch_overview() function : usage variations - multipart message
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Pass a multipart message to imap_fetch_overview() to test the contents of returned array
|
||||
*/
|
||||
|
||||
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
|
||||
|
||||
require_once __DIR__.'/setup/imap_include.inc';
|
||||
|
||||
$stream_id = setup_test_mailbox('imapfetchoverviewvar6', 0, $mailbox); // setup temp mailbox
|
||||
create_multipart_message($stream_id, $mailbox);
|
||||
|
||||
// refresh msg numbers
|
||||
imap_check($stream_id);
|
||||
$msg_no = 1;
|
||||
|
||||
$a = imap_fetch_overview($stream_id, $msg_no);
|
||||
echo "\n--> Object #1\n";
|
||||
displayOverviewFields($a[0]);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a multipart message with subparts
|
||||
*
|
||||
* @param resource $imap_stream
|
||||
* @param string $mailbox
|
||||
*/
|
||||
function create_multipart_message($imap_stream, $mailbox) {
|
||||
global $users, $domain;
|
||||
$envelope["from"]= "foo@anywhere.com";
|
||||
$envelope["to"] = IMAP_USERS[0] . '@' . IMAP_MAIL_DOMAIN;
|
||||
$envelope["subject"] = "Test msg 1";
|
||||
|
||||
$part1["type"] = TYPEMULTIPART;
|
||||
$part1["subtype"] = "mixed";
|
||||
|
||||
$part2["type"] = TYPETEXT;
|
||||
$part2["subtype"] = "plain";
|
||||
$part2["description"] = "imap_mail_compose() function";
|
||||
$part2["contents.data"] = "message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
|
||||
$part3["type"] = TYPETEXT;
|
||||
$part3["subtype"] = "plain";
|
||||
$part3["description"] = "Example";
|
||||
$part3["contents.data"] = "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy";
|
||||
|
||||
$file_handle = fopen(__FILE__, 'r+');
|
||||
$file_size = 1;
|
||||
|
||||
$part4["type"] = TYPEAPPLICATION;
|
||||
$part4["encoding"] = ENCBASE64;
|
||||
$part4["subtype"] = "octet-stream";
|
||||
$part4["description"] = 'Test';
|
||||
$part4['disposition.type'] = 'attachment';
|
||||
$part4['disposition'] = array ('filename' => 'Test');
|
||||
$part4['type.parameters'] = array('name' => 'Test');
|
||||
$part4["contents.data"] = base64_encode(fread($file_handle, 1));
|
||||
|
||||
$body[1] = $part1;
|
||||
$body[2] = $part2;
|
||||
$body[3] = $part3;
|
||||
$body[4] = $part4;
|
||||
|
||||
$msg = imap_mail_compose($envelope, $body);
|
||||
|
||||
if (imap_append($imap_stream, $mailbox, $msg) === false) {
|
||||
echo imap_last_error() . "\n";
|
||||
echo "TEST FAILED : could not append new message to mailbox '$mailbox'\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchoverviewvar6';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetch_overview() : usage variations ***
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
|
||||
--> Object #1
|
||||
size is %d
|
||||
uid is %d
|
||||
msgno is 1
|
||||
recent is %d
|
||||
flagged is 0
|
||||
answered is 0
|
||||
deleted is 0
|
||||
seen is 0
|
||||
draft is 0
|
||||
udate is OK
|
||||
@@ -1,81 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetchbody() function : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* [, int $options])
|
||||
* Description: Get a specific body section
|
||||
* Source code: ext/imap/php_imap.c
|
||||
*/
|
||||
|
||||
echo "*** Testing imap_fetchbody() : basic functionality ***\n";
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
// Initialise all required variables
|
||||
|
||||
// set up mailbox with one message
|
||||
$stream_id = setup_test_mailbox('imapfetchbodybasic', 1, $mailbox, false);
|
||||
|
||||
$msg_no = 1;
|
||||
$section = '2';
|
||||
$options = array ('FT_UID' => FT_UID, 'FT_PEEK' => FT_PEEK, 'FT_INTERNAL' => FT_INTERNAL);
|
||||
|
||||
// Calling imap_fetchbody() with all possible arguments
|
||||
echo "\n-- All possible arguments --\n";
|
||||
foreach ($options as $key => $option) {
|
||||
echo "-- Option is $key --\n";
|
||||
switch ($key) {
|
||||
|
||||
case 'FT_UID';
|
||||
$msg_uid = imap_uid($stream_id, $msg_no);
|
||||
var_dump( imap_fetchbody($stream_id, $msg_uid, $section, $option) );
|
||||
break;
|
||||
|
||||
case 'FT_PEEK';
|
||||
var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) );
|
||||
$overview = imap_fetch_overview($stream_id, 1);
|
||||
echo "Seen Flag: ";
|
||||
var_dump( $overview[0]->seen );
|
||||
break;
|
||||
|
||||
case 'FT_INTERNAL';
|
||||
var_dump( imap_fetchbody($stream_id, $msg_no, $section, $option) );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Calling imap_fetchbody() with mandatory arguments
|
||||
echo "\n-- Mandatory arguments --\n";
|
||||
var_dump( imap_fetchbody($stream_id, $msg_no, $section) );
|
||||
$overview = imap_fetch_overview($stream_id, 1);
|
||||
echo "Seen Flag: ";
|
||||
var_dump( $overview[0]->seen );
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchbodybasic';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetchbody() : basic functionality ***
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
|
||||
-- All possible arguments --
|
||||
-- Option is FT_UID --
|
||||
string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"
|
||||
-- Option is FT_PEEK --
|
||||
string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"
|
||||
Seen Flag: int(%d)
|
||||
-- Option is FT_INTERNAL --
|
||||
string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"
|
||||
|
||||
-- Mandatory arguments --
|
||||
string(36) "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"
|
||||
Seen Flag: int(%d)
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchbody() errors: ValueError and Warnings
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapfetchbodyerrors", 0);
|
||||
|
||||
$section = '';
|
||||
|
||||
try {
|
||||
imap_fetchbody($imap_mail_box, -1, $section);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_fetchbody($imap_mail_box, 1, $section, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
// Access not existing
|
||||
var_dump(imap_fetchbody($imap_mail_box, 255, $section));
|
||||
var_dump(imap_fetchbody($imap_mail_box, 255, $section, FT_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchbodyerrors';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
imap_fetchbody(): Argument #2 ($message_num) must be greater than 0
|
||||
imap_fetchbody(): Argument #4 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
|
||||
|
||||
Warning: imap_fetchbody(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imap_fetchbody(): UID does not exist in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchbody() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchbodyuid", $msg_no, $uid);
|
||||
|
||||
$section = '2';
|
||||
var_dump(imap_fetchbody($imap_mail_box, $uid, $section, FT_UID) === imap_fetchbody($imap_mail_box, $msg_no, $section));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchbodyuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,55 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetchbody() function : usage variations - $message_num arg
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Pass different integers, strings, msg sequences and msg UIDs as $message_num argument
|
||||
* to test behaviour of imap_fetchbody()
|
||||
*/
|
||||
|
||||
echo "*** Testing imap_fetchbody() : usage variations ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
//Initialise required variables
|
||||
$stream_id = setup_test_mailbox('imapfetchbodyvar6', 3); // set up temp mailbox with simple msgs
|
||||
$section = 1;
|
||||
|
||||
$sequences = [0, /* out of range */ 4, 1];
|
||||
|
||||
foreach($sequences as $message_num) {
|
||||
echo "\n-- \$message_num is $message_num --\n";
|
||||
try {
|
||||
var_dump(imap_fetchbody($stream_id, $message_num, $section));
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchbodyvar6';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetchbody() : usage variations ***
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
|
||||
-- $message_num is 0 --
|
||||
imap_fetchbody(): Argument #2 ($message_num) must be greater than 0
|
||||
|
||||
-- $message_num is 4 --
|
||||
|
||||
Warning: imap_fetchbody(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- $message_num is 1 --
|
||||
string(%d) "1: this is a test message, please ignore
|
||||
newline%r\R?%r"
|
||||
@@ -1,79 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetchheader() function : basic function
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_fetchheader() : basic functionality ***\n";
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
// Initialise all required variables
|
||||
$stream_id = setup_test_mailbox('imapfetchheaderbasic', 1, $mailbox, false); // setup temp mailbox with 1 msg
|
||||
$msg_no = 1;
|
||||
$options = array('FT_UID' => FT_UID, 'FT_INTERNAL' => FT_INTERNAL,
|
||||
'FT_PREFETCHTEXT' => FT_PREFETCHTEXT);
|
||||
|
||||
// Calling imap_fetchheader() with all possible arguments
|
||||
echo "\n-- All possible arguments --\n";
|
||||
foreach ($options as $key => $option) {
|
||||
echo "-- Option is $key --\n";
|
||||
if ($key == 'FT_UID') {
|
||||
$msg_uid = imap_uid($stream_id, $msg_no);
|
||||
var_dump(imap_fetchheader($stream_id, $msg_uid, $option));
|
||||
} else {
|
||||
var_dump(imap_fetchheader($stream_id, $msg_no, $option));
|
||||
}
|
||||
}
|
||||
|
||||
// Calling imap_fetchheader() with mandatory arguments
|
||||
echo "\n-- Mandatory arguments --\n";
|
||||
var_dump( imap_fetchheader($stream_id, $msg_no) );
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchheaderbasic';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetchheader() : basic functionality ***
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
|
||||
-- All possible arguments --
|
||||
-- Option is FT_UID --
|
||||
string(%d) "From: foo@anywhere.com
|
||||
Subject: Test msg 1
|
||||
To: %s
|
||||
MIME-Version: 1.0
|
||||
Content-Type: %s; %s
|
||||
|
||||
"
|
||||
-- Option is FT_INTERNAL --
|
||||
string(%d) "From: foo@anywhere.com
|
||||
Subject: Test msg 1
|
||||
To: %s
|
||||
MIME-Version: 1.0
|
||||
Content-Type: %s; %s
|
||||
|
||||
"
|
||||
-- Option is FT_PREFETCHTEXT --
|
||||
string(%d) "From: foo@anywhere.com
|
||||
Subject: Test msg 1
|
||||
To: %s
|
||||
MIME-Version: 1.0
|
||||
Content-Type: %s; %s
|
||||
|
||||
"
|
||||
|
||||
-- Mandatory arguments --
|
||||
string(%d) "From: foo@anywhere.com
|
||||
Subject: Test msg 1
|
||||
To: %s
|
||||
MIME-Version: 1.0
|
||||
Content-Type: %s; %s
|
||||
|
||||
"
|
||||
@@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchheader() errors: ValueError and Warnings
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapfetchheadererrors", 0);
|
||||
|
||||
try {
|
||||
imap_fetchheader($imap_mail_box, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_fetchheader($imap_mail_box, 1, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
// Access not existing
|
||||
var_dump(imap_fetchheader($imap_mail_box, 255));
|
||||
var_dump(imap_fetchheader($imap_mail_box, 255, FT_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchheadererrors';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
imap_fetchheader(): Argument #2 ($message_num) must be greater than 0
|
||||
imap_fetchheader(): Argument #3 ($flags) must be a bitmask of FT_UID, FT_PREFETCHTEXT, and FT_INTERNAL
|
||||
|
||||
Warning: imap_fetchheader(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imap_fetchheader(): UID does not exist in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchheader() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchheaderuid", $msg_no, $uid);
|
||||
|
||||
var_dump(imap_fetchheader($imap_mail_box, $uid, FT_UID) === imap_fetchheader($imap_mail_box, $msg_no));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchheaderuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,61 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_fetchheader() function : usage variations - $message_num argument
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Pass different integers and strings as $message_num argument
|
||||
* to test behaviour of imap_fetchheader()
|
||||
*/
|
||||
|
||||
echo "*** Testing imap_fetchheader() : usage variations ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$stream_id = setup_test_mailbox('imapfetchheadervar5', 3, $mailbox, false); // set up temp mailbox with 3 msgs
|
||||
|
||||
$sequences = [0, /* out of range */ 4, 1];
|
||||
|
||||
foreach($sequences as $message_num) {
|
||||
echo "\n-- \$message_num is $message_num --\n";
|
||||
try {
|
||||
var_dump(imap_fetchheader($stream_id, $message_num));
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
// clear error stack
|
||||
imap_errors();
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchheadervar5';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing imap_fetchheader() : usage variations ***
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
|
||||
-- $message_num is 0 --
|
||||
imap_fetchheader(): Argument #2 ($message_num) must be greater than 0
|
||||
|
||||
-- $message_num is 4 --
|
||||
|
||||
Warning: imap_fetchheader(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- $message_num is 1 --
|
||||
string(%d) "From: foo@anywhere.com
|
||||
Subject: Test msg 1
|
||||
To: %s
|
||||
MIME-Version: 1.0
|
||||
Content-Type: MULTIPART/mixed; BOUNDARY="%s=:%d"
|
||||
|
||||
"
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchmime() errors: ValueError and Warnings
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapfetchmimeerrors", 0);
|
||||
|
||||
$section = '';
|
||||
|
||||
try {
|
||||
imap_fetchmime($imap_mail_box, -1, $section);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_fetchmime($imap_mail_box, 1, $section, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
// Access not existing
|
||||
var_dump(imap_fetchmime($imap_mail_box, 255, $section));
|
||||
var_dump(imap_fetchmime($imap_mail_box, 255, $section, FT_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchmimeerrors';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
imap_fetchmime(): Argument #2 ($message_num) must be greater than 0
|
||||
imap_fetchmime(): Argument #4 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
|
||||
|
||||
Warning: imap_fetchmime(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imap_fetchmime(): UID does not exist in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchmime() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchmimeuid", $msg_no, $uid);
|
||||
|
||||
$section = '2';
|
||||
var_dump(imap_fetchbody($imap_mail_box, $uid, $section, FT_UID) === imap_fetchbody($imap_mail_box, $msg_no, $section));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchmimeuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,63 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchstructure() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('imapfetchstructurebasic', 1);
|
||||
|
||||
try {
|
||||
imap_fetchstructure($stream_id,0);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
$z = imap_fetchstructure($stream_id,1);
|
||||
|
||||
|
||||
$fields = array('type','encoding','ifsubtype','subtype',
|
||||
'ifdescription','lines','bytes','parameters');
|
||||
|
||||
foreach ($fields as $key) {
|
||||
var_dump(isset($z->$key));
|
||||
}
|
||||
var_dump($z->type);
|
||||
var_dump($z->encoding);
|
||||
var_dump($z->bytes);
|
||||
var_dump($z->lines);
|
||||
var_dump($z->ifparameters);
|
||||
var_dump(is_object($z->parameters[0]));
|
||||
|
||||
imap_close($stream_id);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchstructurebasic';
|
||||
require_once('setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
imap_fetchstructure(): Argument #2 ($message_num) must be greater than 0
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(1)
|
||||
bool(true)
|
||||
@@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchstructure() errors: ValueError and Warnings
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapfetchstructureerrors", 0);
|
||||
|
||||
try {
|
||||
imap_fetchstructure($imap_mail_box, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_fetchstructure($imap_mail_box, 1, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
// Access not existing
|
||||
var_dump(imap_fetchstructure($imap_mail_box, 255));
|
||||
var_dump(imap_fetchstructure($imap_mail_box, 255, FT_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchstructureerrors';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
imap_fetchstructure(): Argument #2 ($message_num) must be greater than 0
|
||||
imap_fetchstructure(): Argument #3 ($flags) must be FT_UID or 0
|
||||
|
||||
Warning: imap_fetchstructure(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imap_fetchstructure(): UID does not exist in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
imap_fetchstructure() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchstructureuid", $msg_no, $uid);
|
||||
|
||||
// Usage of == because comparing objects
|
||||
var_dump(imap_fetchstructure($imap_mail_box, $uid, FT_UID) == imap_fetchstructure($imap_mail_box, $msg_no));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapfetchstructureuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Check that IMAP\Connection is declared final
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class T extends IMAP\Connection {}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class T cannot extend final class IMAP\Connection in %s on line %d
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
imap_gc() ValueError
|
||||
--CREDITS--
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('imapgcerror', 1);
|
||||
|
||||
try {
|
||||
imap_gc($stream_id, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapgcerror';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
imap_gc(): Argument #2 ($flags) must be a bitmask of IMAP_GC_TEXTS, IMAP_GC_ELT, and IMAP_GC_ENV
|
||||
@@ -1,54 +0,0 @@
|
||||
--TEST--
|
||||
imap_getsubscribed() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
if (getenv("SKIP_ASAN")) die("xleak asan chokes on this: 'LeakSanitizer does not work under ptrace (strace, gdb, etc)'");
|
||||
?>
|
||||
--CONFLICTS--
|
||||
defaultmailbox
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD) or
|
||||
die("Cannot connect to mailbox ". IMAP_DEFAULT_MAILBOX. ": " . imap_last_error());
|
||||
|
||||
var_dump(imap_getsubscribed($stream_id, IMAP_DEFAULT_MAILBOX, 'ezDvfXvbvcxSerz'));
|
||||
|
||||
|
||||
echo "Checking OK\n";
|
||||
|
||||
$newbox = IMAP_DEFAULT_MAILBOX . "." . IMAP_MAILBOX_PHPT_PREFIX;
|
||||
|
||||
imap_createmailbox($stream_id, $newbox);
|
||||
imap_subscribe($stream_id, $newbox);
|
||||
|
||||
$z = imap_getsubscribed($stream_id, IMAP_DEFAULT_MAILBOX, '*');
|
||||
|
||||
var_dump(is_array($z));
|
||||
var_dump($z[0]);
|
||||
|
||||
imap_close($stream_id);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = '';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
Checking OK
|
||||
bool(true)
|
||||
object(stdClass)#%d (%d) {
|
||||
[%sname"]=>
|
||||
string(%d) "{%s}%s"
|
||||
[%sattributes"]=>
|
||||
int(%d)
|
||||
[%sdelimiter"]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
--TEST--
|
||||
imap_headerinfo() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('imapheaderinfobasic', 1);
|
||||
|
||||
$z = imap_headerinfo($stream_id, 1);
|
||||
|
||||
$fields = array ('toaddress','to','fromaddress','from',
|
||||
'reply_toaddress','reply_to',
|
||||
'senderaddress', 'sender',
|
||||
'subject','Subject',
|
||||
'Recent','Unseen','Flagged','Answered','Deleted','Draft',
|
||||
'Msgno','MailDate','Size','udate');
|
||||
|
||||
echo "Check general fields\n";
|
||||
foreach ($fields as $key) {
|
||||
var_dump(isset($z->$key));
|
||||
}
|
||||
|
||||
echo "Check type\n";
|
||||
var_dump($z->toaddress);
|
||||
var_dump($z->fromaddress);
|
||||
var_dump($z->reply_toaddress);
|
||||
var_dump($z->senderaddress);
|
||||
var_dump($z->subject);
|
||||
var_dump($z->Subject);
|
||||
|
||||
if ($z->Recent == 'R' || $z->Recent == 'N' || $z->Recent == ' ') {
|
||||
echo "Recent: OK";
|
||||
} else {
|
||||
echo "Recent: error: ".$z->Recent;
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Unseen == 'U' || $z->Unseen == ' ') {
|
||||
echo "Unseen: OK";
|
||||
} else {
|
||||
echo "Unseen: error: ".$z->Unseen;
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Flagged == 'F' || $z->Flagged == ' ') {
|
||||
echo "Flagged: OK";
|
||||
} else {
|
||||
echo "Flagged: error: ".$z->Flagged;
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Answered == 'A' || $z->Answered == ' ') {
|
||||
echo "Answered: OK";
|
||||
} else {
|
||||
echo "Answered: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Deleted == 'D' || $z->Deleted == ' ') {
|
||||
echo "Deleted: OK";
|
||||
} else {
|
||||
echo "Deleted: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Draft == 'X' || $z->Draft == ' ') {
|
||||
echo "Draft: OK";
|
||||
} else {
|
||||
echo "Draft: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
var_dump($z->Msgno);
|
||||
var_dump($z->Size);
|
||||
var_dump($z->udate);
|
||||
|
||||
imap_close($stream_id);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapheaderinfobasic';
|
||||
require_once('setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
Check general fields
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
Check type
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
Recent: OK
|
||||
Unseen: OK
|
||||
Flagged: OK
|
||||
Answered: OK
|
||||
Deleted: OK
|
||||
Draft: OK
|
||||
string(%d) "%s"
|
||||
string(%d) "%d"
|
||||
int(%d)
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_is_open()
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// include file for required variables in imap_open()
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$mailbox_suffix = 'imapisopen';
|
||||
|
||||
// set up temp mailbox with 0 messages
|
||||
$stream_id = setup_test_mailbox($mailbox_suffix, 0, $mailbox);
|
||||
|
||||
var_dump(imap_is_open($stream_id));
|
||||
|
||||
// Close connection
|
||||
var_dump(imap_close($stream_id));
|
||||
var_dump(imap_is_open($stream_id));
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapisopen';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
imap_list() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD) or
|
||||
die("Cannot connect to mailbox " .IMAP_DEFAULT_MAILBOX.": " . imap_last_error());
|
||||
|
||||
imap_list($stream_id, IMAP_DEFAULT_MAILBOX,'ezerz');
|
||||
|
||||
|
||||
$z = imap_list($stream_id, IMAP_DEFAULT_MAILBOX,'*');
|
||||
var_dump(is_array($z));
|
||||
|
||||
// e.g. "{127.0.0.1:143/norsh}INBOX"
|
||||
var_dump($z[0]);
|
||||
|
||||
imap_close($stream_id);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
string(%s) "{%s}%s"
|
||||
@@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
imap_lsub() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
if (getenv("SKIP_ASAN")) die("xleak leak sanitizer crashes");
|
||||
?>
|
||||
--CONFLICTS--
|
||||
defaultmailbox
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD) or
|
||||
die("Cannot connect to mailbox " .IMAP_DEFAULT_MAILBOX. ": " . imap_last_error());
|
||||
|
||||
var_dump(imap_lsub($stream_id, IMAP_DEFAULT_MAILBOX, 'ezDvfXvbvcxSerz'));
|
||||
|
||||
|
||||
echo "Checking OK\n";
|
||||
|
||||
$newbox = IMAP_DEFAULT_MAILBOX . "." . IMAP_MAILBOX_PHPT_PREFIX;
|
||||
|
||||
imap_createmailbox($stream_id, $newbox);
|
||||
imap_subscribe($stream_id, $newbox);
|
||||
|
||||
$z = imap_lsub($stream_id, IMAP_DEFAULT_MAILBOX, '*');
|
||||
|
||||
var_dump(is_array($z));
|
||||
|
||||
// e.g. "{127.0.0.1:143/norsh}INBOX.phpttest"
|
||||
var_dump($z[0]);
|
||||
|
||||
imap_close($stream_id);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = '';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
Checking OK
|
||||
bool(true)
|
||||
string(%s) "{%s}%s"
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_mail_copy() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_mail_copy() : basic functionality ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test\n";
|
||||
$imap_stream = setup_test_mailbox('copybasic', 1);
|
||||
|
||||
$check = imap_check($imap_stream);
|
||||
echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
|
||||
|
||||
var_dump(imap_mail_copy($imap_stream, '1', 'INBOX.' . IMAP_MAILBOX_PHPT_PREFIX . 'copybasic'));
|
||||
|
||||
imap_close($imap_stream);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'copybasic';
|
||||
require_once('setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_mail_copy() : basic functionality ***
|
||||
Create a new mailbox for test
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
Msg Count in new mailbox: 1
|
||||
bool(true)
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_mail_move() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing imap_mail_move() : basic functionality ***\n";
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
echo "Create a new mailbox for test\n";
|
||||
$imap_stream = setup_test_mailbox("movebasic", 1);
|
||||
|
||||
$check = imap_check($imap_stream);
|
||||
echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
|
||||
|
||||
var_dump(imap_mail_move($imap_stream, '1', 'INBOX.' . IMAP_MAILBOX_PHPT_PREFIX . 'movebasic'));
|
||||
|
||||
imap_close($imap_stream);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'movebasic';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
*** Testing imap_mail_move() : basic functionality ***
|
||||
Create a new mailbox for test
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
Msg Count in new mailbox: 1
|
||||
bool(true)
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
imap_mutf7_to_utf8
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
// The underlying imap_mutf7_to_utf8 function can be missing; there's a
|
||||
// ./configure check for it that disables the corresponding PHP function.
|
||||
if (!function_exists('imap_mutf7_to_utf8')) {
|
||||
die("skip no imap_mutf7_to_utf8 function");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(imap_mutf7_to_utf8(""));
|
||||
var_dump(imap_mutf7_to_utf8(1));
|
||||
var_dump(imap_mutf7_to_utf8("t&AOQ-st"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(1) "1"
|
||||
string(5) "täst"
|
||||
Done
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
imap_open() ValueErrors
|
||||
--CREDITS--
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
if (getenv("SKIP_ASAN")) die("xleak leak sanitizer crashes");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "Checking with incorrect parameters\n" ;
|
||||
imap_open('', '', '');
|
||||
|
||||
try {
|
||||
imap_open('', '', '', -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
imap_open('', '', '', 0, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Checking with incorrect parameters
|
||||
|
||||
Warning: imap_open(): Couldn't open stream in %s on line %d
|
||||
imap_open(): Argument #4 ($flags) must be a bitmask of the OP_* constants, and CL_EXPUNGE
|
||||
imap_open(): Argument #5 ($retries) must be greater than or equal to 0
|
||||
|
||||
Notice: PHP Request Shutdown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_open() using the CL_EXPUNGE flag
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// include file for required variables in imap_open()
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
// set up temp mailbox with 3 messages
|
||||
$stream_id = setup_test_mailbox('imapopenwithclexpunge', 3, $mailbox, flags: CL_EXPUNGE);
|
||||
|
||||
// mark messages in inbox for deletion
|
||||
for ($i = 1; $i < 4; $i++) {
|
||||
imap_delete($stream_id, $i);
|
||||
}
|
||||
|
||||
echo "\n-- Call to imap_close() --\n";
|
||||
var_dump( imap_close($stream_id) );
|
||||
|
||||
// check that CL_EXPUNGE in previous imap_open() call worked
|
||||
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
|
||||
echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n";
|
||||
|
||||
// Close connection
|
||||
var_dump( imap_close($stream_id) );
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapopenwithclexpunge';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
|
||||
-- Call to imap_close() --
|
||||
bool(true)
|
||||
There are now 0 msgs in mailbox '%sINBOX.phpttestimapopenwithclexpunge'
|
||||
bool(true)
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
imap_renamemailbox() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$stream_id = setup_test_mailbox('imaprenamemailbox1', 1);
|
||||
|
||||
$mailboxBaseName = IMAP_DEFAULT_MAILBOX . '.' . IMAP_MAILBOX_PHPT_PREFIX;
|
||||
|
||||
//commented because of bug #49901
|
||||
//$ancError = error_reporting(0);
|
||||
//$z = imap_renamemailbox($stream_id, $newbox.'not2', $newbox.'2');
|
||||
//var_dump($z);
|
||||
//error_reporting($ancError);
|
||||
echo "Checking OK\n";
|
||||
|
||||
var_dump(imap_renamemailbox($stream_id, $mailboxBaseName . 'imaprenamemailbox1', $mailboxBaseName . 'imaprenamemailbox2'));
|
||||
|
||||
imap_close($stream_id);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = ['imaprenamemailbox1', 'imaprenamemailbox2'];
|
||||
require_once('setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
Checking OK
|
||||
bool(true)
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Test imap_reopen() using the CL_EXPUNGE flag
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// include file for required variables in imap_open()
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$mailbox_suffix = 'imapreopenwithclexpunge';
|
||||
|
||||
// set up temp mailbox with 3 messages
|
||||
$stream_id = setup_test_mailbox($mailbox_suffix , 3, $mailbox);
|
||||
|
||||
var_dump(imap_reopen($stream_id, IMAP_DEFAULT_MAILBOX . '.' . IMAP_MAILBOX_PHPT_PREFIX . $mailbox_suffix, flags: CL_EXPUNGE));
|
||||
|
||||
// mark messages in inbox for deletion
|
||||
for ($i = 1; $i < 4; $i++) {
|
||||
imap_delete($stream_id, $i);
|
||||
}
|
||||
|
||||
echo "\n-- Call to imap_close() --\n";
|
||||
var_dump( imap_close($stream_id) );
|
||||
|
||||
// check that CL_EXPUNGE in previous imap_reopen() call worked
|
||||
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
|
||||
echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n";
|
||||
|
||||
// Close connection
|
||||
var_dump( imap_close($stream_id) );
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapreopenwithclexpunge';
|
||||
require_once(__DIR__.'/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 3 msgs
|
||||
New mailbox created
|
||||
bool(true)
|
||||
|
||||
-- Call to imap_close() --
|
||||
bool(true)
|
||||
There are now 0 msgs in mailbox '%sINBOX.phpttestimapreopenwithclexpunge'
|
||||
bool(true)
|
||||
@@ -1,125 +0,0 @@
|
||||
--TEST--
|
||||
imap_rfc822_parse_headers() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('imaprfc822parseheadersbasic', 1);
|
||||
|
||||
$z = imap_headerinfo($stream_id, 1);
|
||||
|
||||
$fields = array ('toaddress','to','fromaddress','from',
|
||||
'reply_toaddress','reply_to',
|
||||
'senderaddress', 'sender',
|
||||
'subject','Subject',
|
||||
'MailDate','Size','udate');
|
||||
|
||||
|
||||
echo "Check general fields\n";
|
||||
foreach ($fields as $key) {
|
||||
var_dump(isset($z->$key));
|
||||
}
|
||||
|
||||
echo "Check type\n";
|
||||
var_dump($z->toaddress);
|
||||
var_dump($z->fromaddress);
|
||||
var_dump($z->reply_toaddress);
|
||||
var_dump($z->senderaddress);
|
||||
var_dump($z->subject);
|
||||
var_dump($z->Subject);
|
||||
|
||||
if ($z->Recent == 'R' || $z->Recent == 'N' || $z->Recent == ' ') {
|
||||
echo "Recent: OK";
|
||||
} else {
|
||||
echo "Recent: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Unseen == 'U' || $z->Unseen == ' ') {
|
||||
echo "Unseen: OK";
|
||||
} else {
|
||||
echo "Unseen: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Flagged == 'F' || $z->Flagged == ' ') {
|
||||
echo "Flagged: OK";
|
||||
} else {
|
||||
echo "Flagged: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Answered == 'A' || $z->Answered == ' ') {
|
||||
echo "Answered: OK";
|
||||
} else {
|
||||
echo "Answered: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Deleted == 'D' || $z->Deleted == ' ') {
|
||||
echo "Deleted: OK";
|
||||
} else {
|
||||
echo "Deleted: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
if ($z->Draft == 'X' || $z->Draft == ' ') {
|
||||
echo "Draft: OK";
|
||||
} else {
|
||||
echo "Draft: error";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
var_dump($z->Msgno);
|
||||
var_dump($z->Size);
|
||||
var_dump($z->udate);
|
||||
|
||||
imap_close($stream_id);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imaprfc822parseheadersbasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
Check general fields
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
Check type
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
string(%d) "%s"
|
||||
Recent: OK
|
||||
Unseen: OK
|
||||
Flagged: OK
|
||||
Answered: OK
|
||||
Deleted: OK
|
||||
Draft: OK
|
||||
string(%d) "%s"
|
||||
string(%d) "%d"
|
||||
int(%d)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
imap_rfc822_write_address() : basic functionality
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imap_rfc822_write_address('me', 'example.com', 'My Name'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(24) "My Name <me@example.com>"
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
imap_savebody() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('imapsavebodybasic', 1);
|
||||
|
||||
$file = __DIR__.'/tmpsavebody.txt';
|
||||
|
||||
//with URL
|
||||
$z = imap_savebody($stream_id, $file, 1);
|
||||
var_dump($z);
|
||||
echo "Size: ".filesize($file)."\n";
|
||||
|
||||
//With FOPEN
|
||||
$fp = fopen($file, 'w');
|
||||
$z = imap_savebody($stream_id, $fp, 1);
|
||||
fclose($fp);
|
||||
var_dump($z);
|
||||
echo "Size: ".filesize($file)."\n";
|
||||
|
||||
imap_close($stream_id);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__.'/tmpsavebody.txt');
|
||||
$mailbox_suffix = 'imapsavebodybasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
bool(true)
|
||||
Size: %d
|
||||
bool(true)
|
||||
Size: %d
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
imap_savebody() errors: ValueError and Warnings
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapsavebodyerrors", 0);
|
||||
|
||||
$section = '';
|
||||
|
||||
try {
|
||||
imap_savebody($imap_mail_box, '', -1, $section);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
try {
|
||||
imap_savebody($imap_mail_box, '', 1, $section, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
// Access not existing
|
||||
var_dump(imap_savebody($imap_mail_box, '', 255, $section));
|
||||
var_dump(imap_savebody($imap_mail_box, '', 255, $section, FT_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapsavebodyerrors';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Create a temporary mailbox and add 0 msgs
|
||||
New mailbox created
|
||||
imap_savebody(): Argument #3 ($message_num) must be greater than 0
|
||||
imap_savebody(): Argument #5 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
|
||||
|
||||
Warning: imap_savebody(): Bad message number in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imap_savebody(): UID does not exist in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
imap_savebody() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapsavebodyuid", $msg_no, $uid);
|
||||
|
||||
$section = '';
|
||||
|
||||
$stream_uid = fopen('php://memory', 'w+');
|
||||
imap_savebody($imap_mail_box, $stream_uid, $uid, $section, FT_UID);
|
||||
|
||||
$stream_msg_no = fopen('php://memory', 'w+');
|
||||
imap_savebody($imap_mail_box, $stream_msg_no, $msg_no, $section);
|
||||
|
||||
// Compare what was written.
|
||||
rewind($stream_uid);
|
||||
rewind($stream_msg_no);
|
||||
var_dump(stream_get_contents($stream_uid) === stream_get_contents($stream_msg_no));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapsavebodyuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
imap_search() with unique ID (SE_UID) flag
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapsearchuid");
|
||||
|
||||
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapsearchuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
[4]=>
|
||||
int(9)
|
||||
[5]=>
|
||||
int(10)
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
--TEST--
|
||||
imap_setflag_full() basic test
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox("imapsetflagfullbasic", 10);
|
||||
|
||||
// Testing individual entry
|
||||
imap_setflag_full($imap_mail_box, '1', '\Answered');
|
||||
|
||||
// Testing multiple entries entry
|
||||
imap_setflag_full($imap_mail_box, '2,7', '\Deleted');
|
||||
|
||||
// Testing entry range
|
||||
imap_setflag_full($imap_mail_box, '3:5', '\Flagged');
|
||||
|
||||
echo 'ALL: ';
|
||||
var_dump(imap_search($imap_mail_box, 'ALL'));
|
||||
echo 'ANSWERED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'ANSWERED'));
|
||||
echo 'DELETED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'DELETED'));
|
||||
echo 'FLAGGED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'FLAGGED'));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapsetflagfullbasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
ALL: array(10) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
[6]=>
|
||||
int(7)
|
||||
[7]=>
|
||||
int(8)
|
||||
[8]=>
|
||||
int(9)
|
||||
[9]=>
|
||||
int(10)
|
||||
}
|
||||
ANSWERED: array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
DELETED: array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(7)
|
||||
}
|
||||
FLAGGED: array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
[2]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
--TEST--
|
||||
imap_setflag_full() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapsetflagfulluid");
|
||||
|
||||
/* This works on the assumption that UID message 3 to 6 inclusive are deleted. */
|
||||
|
||||
// Testing individual entry
|
||||
imap_setflag_full($imap_mail_box, '8', '\Answered', ST_UID);
|
||||
|
||||
// Testing multiple entries entry
|
||||
imap_setflag_full($imap_mail_box, '7,10', '\Deleted', ST_UID);
|
||||
|
||||
// Testing entry range
|
||||
imap_setflag_full($imap_mail_box, '7:9', '\Flagged', ST_UID);
|
||||
|
||||
// Testing entry range invalid
|
||||
var_dump(imap_setflag_full($imap_mail_box, '4:9', '\Seen', ST_UID));
|
||||
|
||||
|
||||
echo 'ALL: ';
|
||||
var_dump(imap_search($imap_mail_box, 'ALL'));
|
||||
echo 'ALL (with UID correspondance): ';
|
||||
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
|
||||
echo 'ANSWERED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'ANSWERED'));
|
||||
echo 'DELETED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'DELETED'));
|
||||
echo 'FLAGGED: ';
|
||||
var_dump(imap_search($imap_mail_box, 'FLAGGED'));
|
||||
echo 'SEEN: ';
|
||||
var_dump(imap_search($imap_mail_box, 'SEEN'));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapsetflagfulluid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
bool(true)
|
||||
ALL: array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
}
|
||||
ALL (with UID correspondance): array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
[4]=>
|
||||
int(9)
|
||||
[5]=>
|
||||
int(10)
|
||||
}
|
||||
ANSWERED: array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
DELETED: array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
FLAGGED: array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
[2]=>
|
||||
int(5)
|
||||
}
|
||||
SEEN: array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
[2]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
--TEST--
|
||||
imap_sort() basics
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapsortbasic");
|
||||
|
||||
var_dump(imap_sort($imap_mail_box, SORTSUBJECT, 0));
|
||||
var_dump(imap_sort($imap_mail_box, SORTSUBJECT, 0, SE_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapsortbasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(6)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
[5]=>
|
||||
int(5)
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(10)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(7)
|
||||
[4]=>
|
||||
int(8)
|
||||
[5]=>
|
||||
int(9)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
imap_timeout() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "GET values:\n";
|
||||
var_dump(imap_timeout(IMAP_OPENTIMEOUT));
|
||||
var_dump(imap_timeout(IMAP_READTIMEOUT));
|
||||
var_dump(imap_timeout(IMAP_WRITETIMEOUT));
|
||||
var_dump(imap_timeout(IMAP_CLOSETIMEOUT));
|
||||
|
||||
echo "SET values:\n";
|
||||
var_dump(imap_timeout(IMAP_OPENTIMEOUT, 10));
|
||||
var_dump(imap_timeout(IMAP_READTIMEOUT, 10));
|
||||
var_dump(imap_timeout(IMAP_WRITETIMEOUT, 10));
|
||||
|
||||
//IMAP_CLOSETIMEOUT not implemented
|
||||
//var_dump(imap_timeout(IMAP_CLOSETIMEOUT, 10));
|
||||
|
||||
echo "CHECK values:\n";
|
||||
var_dump(imap_timeout(IMAP_OPENTIMEOUT));
|
||||
var_dump(imap_timeout(IMAP_READTIMEOUT));
|
||||
var_dump(imap_timeout(IMAP_WRITETIMEOUT));
|
||||
|
||||
//IMAP_CLOSETIMEOUT not implemented
|
||||
//var_dump(imap_timeout(IMAP_CLOSETIMEOUT));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
GET values:
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
SET values:
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
CHECK values:
|
||||
int(10)
|
||||
int(10)
|
||||
int(10)
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
imap_undelete() function : basic functionality
|
||||
--CREDITS--
|
||||
Olivier Doucet
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
$stream_id = setup_test_mailbox('imapundeletebasic', 1);
|
||||
|
||||
imap_delete($stream_id, 1);
|
||||
|
||||
var_dump(imap_undelete($stream_id, 1));
|
||||
|
||||
imap_close($stream_id);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapundeletebasic';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 1 msgs
|
||||
New mailbox created
|
||||
bool(true)
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
imap_undelete() passing a unique ID
|
||||
--EXTENSIONS--
|
||||
imap
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/setup/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once(__DIR__.'/setup/imap_include.inc');
|
||||
|
||||
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapundeleteuid", $msg_no, $uid);
|
||||
|
||||
imap_delete($imap_mail_box, $uid, FT_UID);
|
||||
imap_undelete($imap_mail_box, $uid, FT_UID);
|
||||
imap_expunge($imap_mail_box);
|
||||
|
||||
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
|
||||
|
||||
imap_close($imap_mail_box);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$mailbox_suffix = 'imapundeleteuid';
|
||||
require_once(__DIR__ . '/setup/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 10 msgs
|
||||
New mailbox created
|
||||
Delete 4 messages for Unique ID generation
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(7)
|
||||
[3]=>
|
||||
int(8)
|
||||
[4]=>
|
||||
int(9)
|
||||
[5]=>
|
||||
int(10)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user