[imp] delete emails directly and permanently

Arminas g.arminas at gmail.com
Tue Aug 26 05:46:52 UTC 2008


Hi again,

It was easier for me to add such feature, because I'm not using
"undelete" function. So here is my changes:

-------------------------------------------------
in imp/mailbox.php I've added line:

 $a_template->set('undelete', Horde::widget('#', _("Delete
Permanently"), 'widget', '', "if (confirm('" . addslashes(_("Are you
sure you wish to perma
nently delete these messages?")) . "')) {
messages_submit('undelete_messages'); } return false;", _("Delete
Permanently")));

and in the same file changed action handler:

case 'undelete_messages':
    if (!empty($indices)) {
        require_once IMP_BASE . '/lib/Message.php';
        $imp_message = &IMP_Message::singleton();
       /* ($actionID == 'delete_messages')
            ? $imp_message->delete($indices, false)
            : */ $imp_message->delete($indices, true);
    }
    break;

-------------------------

Take a look at the arguments for the function delete(); I've added on
more argument to detect weather we are deleting messages permanenlty
or not. So we must change this in the file imp/lib/Message.php

function delete(&$indices, $smth, $keeplog = false)
{
     $nuke = $smth;
      .................
}

And this is it. I guess there might be a "cleaner" way to do this, but
if youre using function for undeleting messages, so you might want to
create your own action.

I hope this helped.

Good luck,
Arminas









2008/8/25 Arminas <g.arminas at gmail.com>:
> Hi,
>
> I got the same problem and i solved this only by changing php code
> manually. I can send you personally a mini tutorial how I;ve done it
> if u would like :)
>
> Good luck,
> Arminas
>
> 2008/8/25 Khanh Truong <k11h12anh at gmail.com>:
>> Hi all,
>>
>> My IMAP server enforces quotas for users. The problem is, when users reach
>> their quota, they cannot delete messages to reduce their usage. Everytime
>> this happens, I have to be involved and increase the quota then reduce it
>> again when they've cleaned up their mailbox.
>> Is there an option to delete messages permanently when you click on Delete?
>> Right now, when you click Delete, it just moves the messages to Trash or it
>> marks the messages as Deleted. When quota is reached, moving deleted
>> messages to Trash doesn't work because it complains there's not enough space
>> and marking messages as Deleted doesn't work either because they're still
>> there. Is there a way around this so that users can resolve the problem
>> themselves and not have to involve the administrator?
>>
>> Thanks,
>> Ken
>> --
>> IMP mailing list - Join the hunt: http://horde.org/bounties/#imp
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
>>
>


More information about the imp mailing list