Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Commit

Permalink
feat(#166): Optional: Mark message as read before deleting
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Miguel Biete <[email protected]>
<[email protected]>
  • Loading branch information
fmbiete committed Mar 30, 2015
1 parent 079568d commit 676f83f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/imap/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
define('IMAP_OPTIONS', '/notls/norsh');


// Mark messages as read before deleting them
define('IMAP_AUTOSEEN_ON_DELETE', false);


// IMPORTANT: BASIC IMAP FOLDERS [ask your mail admin]
// We can have diferent cases (case insensitive):
Expand Down
3 changes: 3 additions & 0 deletions backend/imap/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,9 @@ public function DeleteMessage($folderid, $id, $contentparameters) {
$this->imap_reopen_folder($folderImapid);

if ($this->imap_inside_cutoffdate(Utils::GetCutOffDate($contentparameters->GetFilterType()), $id)) {
if (defined('IMAP_AUTOSEEN_ON_DELETE') && IMAP_AUTOSEEN_ON_DELETE == true) {
$s0 = @imap_setflag_full($this->mbox, $id, "\\Seen", FT_UID);
}
$s1 = @imap_delete ($this->mbox, $id, FT_UID);
$s11 = @imap_setflag_full($this->mbox, $id, "\\Deleted", FT_UID);
$s2 = @imap_expunge($this->mbox);
Expand Down

0 comments on commit 676f83f

Please sign in to comment.