I have a PHP script that cleans up a mailbox every day. The problem is that all deleted emails are moved to the trash and garbage can never be emptied.
I used the PHP IMAP commands to process the mailbox.
$this->_mbox = imap_open(
$this->_data['server'],
$this->_data['user'],
$this->_data['pass'],
OP_SILENT
)
...
imap_delete($this->_mbox, $index);
...
imap_expunge($this->_mbox);
How to empty the basket?
EDIT:
imap_delete () completely deletes letters (also from the trash). Now I'm just trying to find a way to read the basket folder. I tried to open the directory in the same way that I open the inbox without success.
source
share