[imp] delete emails directly and permanently

Andrew Morgan morgan at orst.edu
Thu Aug 28 17:37:20 UTC 2008


On Thu, 28 Aug 2008, Khanh Truong wrote:

>> It won't matter. Several people have already told you that the ability 
>> of a mail client to delete messages on the server when you have run out 
>> of quota has NOTHING to do with the client. It is how the server 
>> handles deletion of messages. You need to fix your SERVER not the 
>> client. The client doesn't delete messages. The server does. If the 
>> server can't delete a message when a user is over quota it won't make a 
>> blind bit of difference having a button on your client that says 
>> 'Delete immediately'.
>
>
> I have to disagree with you because you seemed to have not understood the
> problem. The problem here is that the client DOES NOT delete the messages
> but rather, it tries to COPY them to the Trash THEN delete from the Inbox.
> Of course this will not work because the quota is reached and that is why
> you get an error. What the client needs to do is copy the messages to a
> temporary memory, DELETE first the messages so that usage of the quota is
> down, THEN, copy the messages from memory to the Trash. SO the real issue
> here is not that the server don't know how to delete (the server CAN delete
> if the client tells it to), it is the client that is not deleting but
> copying to the Trash that overfills the quota.
>
> Please read carefully. I hope this makes sense.

There are several disadvantages to the method you propose:

1. If something goes wrong, messages can be lost.

2. The client (IMP, in this case) must download the entire message, store 
it, and upload it again.


The authors of the IMAP specification did not intend it be used with a 
separate Trash folder.  The normal process in IMAP is to mark messages as 
deleted (the \Deleted flag is set) and then issue the IMAP command 
"EXPUNGE" which tells the server to delete messages with the \Deleted 
flag.

The IMAP specification does not have a MOVE command, so the only way to 
implement a server-side Trash folder is to COPY messages to the Trash 
folder and then perform the two-step process of setting the \Deleted flag 
and calling EXPUNGE.

Obviously, making a copy of a message uses up additional space on the 
server and may run into a quota limit.  Some IMAP servers allow the 
administrator to set separate quotas on Trash folders (Cyrus, for 
example).

A reasonable compromise is to use a "virtual" trash folder.  IMP does this 
by searching for all messages with the \Deleted flag, displaying them in a 
Virtual Trash folder, and hiding them from the regular folder display. 
When a user deletes a message, IMP marks it with the \Deleted flag.  When 
the user clicks on Empty Trash, IMP issues an IMAP EXPUNGE command.

You may run into some confusion if users access their email with multiple 
different clients, such as IMP *and* Thunderbird, unless all the email 
clients are configured to use a Virtual Trash folder.

 	Andy


More information about the imp mailing list