From: slim at inbox dot lv
Operating system: l
PHP version: 5.3.19
Package: IMAP related
Bug Type: Feature/Change Request
Bug description:make use of UID EXPUNGE
Description:
------------
c-client supports UID EXPUNGE feature from RFC 4315
Following patch adds the functionality to imap_expunge() when UID is set as
second argument:
diff -ur php-5.3.17.orig/ext/imap/php_imap.c
php-5.3.17/ext/imap/php_imap.c
--- php-5.3.17.orig/ext/imap/php_imap.c 2012-10-29 17:49:28.000000000
+0200
+++ php-5.3.17/ext/imap/php_imap.c 2012-12-06 11:11:41.000000000
+0200
@@ -166,7 +166,8 @@
#endif
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_expunge, 0, 0, 1)
- ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, sequence)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_gc, 0, 0, 1)
@@ -1137,6 +1138,7 @@
#if HAVE_IMAP_KRB && HAVE_IMAP_AUTH_GSS
php_info_print_table_row(2, "Kerberos Support", "enabled");
#endif
+ php_info_print_table_row(2, "IMAP UIDEXPUNGE Support", "enabled");
php_info_print_table_end();
}
/* }}} */
@@ -1553,18 +1555,23 @@
Permanently delete all messages marked for deletion */
PHP_FUNCTION(imap_expunge)
{
- zval *streamind;
- pils *imap_le_struct;
+ zval *streamind;
+ char *sequence;
+ long flags = 0x1;
+ int sequence_len;
+ int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r",
&streamind) ==
FAILURE) {
- return;
- }
+ pils *imap_le_struct;
- ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap",
le_imap);
+ if (zend_parse_parameters(argc TSRMLS_CC, "r|s", &streamind,
&sequence,
&sequence_len) == FAILURE) {
+ return;
+ }
- mail_expunge (imap_le_struct->imap_stream);
+ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1,
"imap",
le_imap);
- RETURN_TRUE;
+ mail_expunge_full (imap_le_struct->imap_stream, (argc == 2 ?
sequence :
NIL), (argc == 2 ? flags : NIL));
+
+ RETURN_TRUE;
}
/* }}} */
Test script:
---------------
imap_expunge(resource $imap_stream, int $uid)
--
Edit bug report at https://bugs.php.net/bug.php?id=63723&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63723&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63723&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63723&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63723&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63723&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63723&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63723&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63723&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63723&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63723&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63723&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63723&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63723&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63723&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63723&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63723&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63723&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63723&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63723&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63723&r=mysqlcfg