Ver código fonte

added auto expunge

Luke Ehresman 25 anos atrás
pai
commit
7809e75fa3
3 arquivos alterados com 5 adições e 1 exclusões
  1. 1 1
      config/config.php
  2. 3 0
      functions/imap.php
  3. 1 0
      functions/mailbox.php

+ 1 - 1
config/config.php

@@ -81,7 +81,7 @@
 
     $default_move_to_trash = true;
     $trash_folder = "INBOX.Trash";
-    $default_auto_expunge = true;
+    $auto_expunge = true;
 
 //  Special Folders are folders that can't be manipulated like normal user created
 //  folders can.  A couple of examples would be "INBOX.Trash", "INBOX.Drafts".  We have

+ 3 - 0
functions/imap.php

@@ -292,7 +292,10 @@
       } else {
          setMessageFlag($imapConnection, $a, $b, "Deleted");
       }
+      if ($auto_expunge == true)
+         expungeBox($imapConnection, $mailbox);
    }
+
    function stripComments($line) {
       if (strpos($line, ";")) {
          $line = substr($line, 0, strpos($line, ";"));

+ 1 - 0
functions/mailbox.php

@@ -227,6 +227,7 @@
    function expungeBox($imapConnection, $mailbox) {
       selectMailbox($imapConnection, $mailbox, $num);
       fputs($imapConnection, "1 EXPUNGE\n");
+      imapReadData($imapConnection, "1", true, $response, $message);
    }
 
    function getFolderNameMinusINBOX($mailbox, $del) {