imap_expunge

(PHP 4, PHP 5)

imap_expungeDelete all messages marked for deletion

Description

bool imap_expunge ( resource $imap_stream )

Deletes all the messages marked for deletion by imap_delete(), imap_mail_move(), or imap_setflag_full().

Parameters

imap_stream

An IMAP stream returned by imap_open().

Return Values

Returns TRUE.

Коментарии

You shouldn't call imap_expunge until before closing the connection. imap_delete tags a message for deletion, imap_expunge deletes all tagged messages. i.e.:
for ($i = 0; $i < $num; $i++) {
  imap_delete($box, $i);
}
imap_expunge($box);

imap_expunge should not be in your inner loop.
2006-01-12 09:57:11
http://php5.kiev.ua/manual/ru/function.imap-expunge.html
Автор:
imap_expunge() may change order of messages which were loaded using imap_sort(). 
That means, if you use foreach() on result of imap_sort() function and each pass you move/delete a message and instantly expunge them, next cycle, messages will have different numbers than imap_sort() returned and the script will fail.
2016-04-29 17:44:20
http://php5.kiev.ua/manual/ru/function.imap-expunge.html

    Поддержать сайт на родительском проекте КГБ