Hello roundcube-Team,
i wrote a tiny patch that creates .Trash if it doesn't exist when you delete an email.
--- program/steps/mail/move_del.inc 2008-02-05 22:39:08.000000000 +0100 +++ program/steps/mail/move_del.inc 2008-04-24 09:54:24.000000000 +0200 @@ -28,8 +28,16 @@ { $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST)))); $target = get_input_value('_target_mbox', RCUBE_INPUT_POST);
- // create .Trash folder if it doesn't exist
- if ($target == "Trash") {
- if (!in_array_nocase($target, $IMAP->list_mailboxes())) {
$IMAP->create_mailbox($target, TRUE);
- }
- }
Nice work, guys!
Greetings, martin _______________________________________________ List info: http://lists.roundcube.net/dev/
On Apr Thu 24 2008 10:38, Martin Spuetz wrote:
Hello roundcube-Team,
i wrote a tiny patch that creates .Trash if it doesn't exist when you delete an email.
Mmmm... bear with me a little :)
When I pulled one of the latest releases from the SVN repo, I had these lines in main.php.dist
// move messages to this folder when deleting them // leave blank if they should be deleted directly $rcmail_config['trash_mbox'] = 'Trash';
plus
// automatically create the above listed default folders on login $rcmail_config['create_default_folders'] = FALSE;
So, the behaviours I expect are
1. trash_mbox unset: delete messages automatically, no matter if
there is a Trash folder or not.
2. trash_mbox set AND create_default_folders FALSE: it is assumed
that the Trash folder exists. I guess that if it does not exist,
the message will be deleted and *not* saved :-?
3. trash_mbox set AND create_default_folders TRUE: if there is no
trash folder, it will be created, so the deleted messages will
always go there.
Having said this, I believe that your patch tries to cover the uncertain behaviour in Case (2) when the Trash folder does not exists. If so, I think it would be necessary to check the conditions (trash_mbox set AND create_default_folders FALSE) to ensure that we are in that case.
If I am all wrong here, please ignore my rant :) and, in any case, could you clarify which case does your patch cover?
My 2 cents!