Really, this would be two options that go together:

1. Do not delete emails after processing.

2. Only process unread emails.

I have implemented this on my test box, and it is invaluable for testing and debugging. You can keep user emails in the mailbox and easily browse it via another client and selectively "mark as unread" specific emails to be reprocessed. I'll send a patch soon.

CommentFileSizeAuthor
#2 mailhandler_optional_delete.patch3.71 KBjavanaut

Comments

javanaut’s picture

Just thought of another possibility:
moving read messages to another folder.

This would only be useful for IMAP mailboxes, but it would add to mailhandler's flexibility.

javanaut’s picture

StatusFileSize
new3.71 KB

This patch adds a checkbox to the mailbox edit page to specify whether or not to delete read messages. If read messages are not deleted, then only unread messages are processed.

moshe weitzman’s picture

looks good to me. please commit.
-moshe

moshe weitzman’s picture

applied. thanks.

joshuajabbour’s picture

Category: feature » bug
Priority: Normal » Critical

This patch that was applied was big-time incomplete. It creates a default value for the delete function of '1' (to delete), but upon creation or edit, the value never gets changed.

In mailhandler_save_mailbox(), the value isn't updated in the DB.

This is critical because if you are going to have the checkbox on the settings page, it needs to do something. An admin who unchecks it thinking mail won't be deleted, and doesn't look back to see it's been checked again, will have their mail deleted.

I'll try to make a patch, but for now in my install I've just changed the DB value to 0...

javanaut’s picture

Ok, for some reason, the mailhandler_save_mailbox changes didn't make the last patch. Sorry about that.

Here's a patch against 4.5.0 that fixes those two lines.

javanaut’s picture

Ok, and now try it without debugging enabled..Sorry*2

moshe weitzman’s picture

fix comitted to HEAD and 4.5

Anonymous’s picture