Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2011-02-01 Thread Emerson Pinter
Thank you, Timo. I will test.

Emerson Pinter
Picture Internet
+55-11-5089-8100
http://www.picturemail.com.br/
http://www.picturesecurity.com.br/
http://www.picture.com.br/

On 01-02-2011 18:25, Timo Sirainen wrote:
> I didn't really look at the logic itself, but attached patch
> fixes/cleans up a couple of things.
> 
> On Tue, 2011-02-01 at 17:48 -0200, Emerson Pinter wrote:
>> I contacted Lex Brugman about the delete-to-trash plugin for dovecot
>> 2.0, he told me there's no version compatible with 2.0 yet... So I
>> looked at the code and started to adapt the code for dovecot 2.0. I have
>> 0 experience with dovecot plugin development, but with a quick
>> adaptation, I managed a apparently stable plugin version, based on
>> deleted-to-trash 0.3. I'm using since last friday with Dovecot 2.0.9
>> with ~30 imap users. Tested deletion and restore with individual
>> messages, 1000, and 2000 messages.
>>
>> Emerson Pinter
>>
>>
>> On 22-12-2010 14:26, Antonio Perez-Aranda wrote:
>>> There are some body using delete-to-trash on any version of Dovecot 2.0?
>>>
> 


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2011-02-01 Thread Timo Sirainen
I didn't really look at the logic itself, but attached patch
fixes/cleans up a couple of things.

On Tue, 2011-02-01 at 17:48 -0200, Emerson Pinter wrote:
> I contacted Lex Brugman about the delete-to-trash plugin for dovecot
> 2.0, he told me there's no version compatible with 2.0 yet... So I
> looked at the code and started to adapt the code for dovecot 2.0. I have
> 0 experience with dovecot plugin development, but with a quick
> adaptation, I managed a apparently stable plugin version, based on
> deleted-to-trash 0.3. I'm using since last friday with Dovecot 2.0.9
> with ~30 imap users. Tested deletion and restore with individual
> messages, 1000, and 2000 messages.
> 
> Emerson Pinter
> 
> 
> On 22-12-2010 14:26, Antonio Perez-Aranda wrote:
> > There are some body using delete-to-trash on any version of Dovecot 2.0?
> > 

--- deleted-to-trash-plugin.c.old	2011-02-01 22:23:35.971442875 +0200
+++ deleted-to-trash-plugin.c	2011-02-01 22:25:13.825341445 +0200
@@ -23,7 +23,6 @@
 			ns = curns;
 			break;
 		}
-		i_free(curns);
 	}
 
 	return ns;
@@ -59,13 +58,11 @@
 	{
 		if(array_count(&last_copy.mail_id) > 0)
 		{
-			array_free(&last_copy.mail_id);
-			i_array_init(&last_copy.mail_id, TRASH_LIST_INITSIZE);
+			array_clear(&last_copy.mail_id);
 		}
 		if(last_copy.src_mailbox_name != NULL)
 		{
-			i_free(last_copy.src_mailbox_name);
-			last_copy.src_mailbox_name = NULL;
+			i_free_and_null(last_copy.src_mailbox_name);
 		}
 	}
 
@@ -150,7 +147,6 @@
 		}
 
 		mailbox_free(&trash_box);
-		i_free(trash_box);
 	}
 	else
 	{
@@ -235,8 +231,7 @@
 			last_copy.transaction_context = save_ctx->transaction;
 			if(array_count(&last_copy.mail_id) > 0)
 			{
-array_free(&last_copy.mail_id);
-i_array_init(&last_copy.mail_id, TRASH_LIST_INITSIZE);
+array_clear(&last_copy.mail_id);
 			}
 
 			if(strcmp(mail->box->name, trashfolder_name) != 0 )


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2011-02-01 Thread Emerson Pinter
I contacted Lex Brugman about the delete-to-trash plugin for dovecot
2.0, he told me there's no version compatible with 2.0 yet... So I
looked at the code and started to adapt the code for dovecot 2.0. I have
0 experience with dovecot plugin development, but with a quick
adaptation, I managed a apparently stable plugin version, based on
deleted-to-trash 0.3. I'm using since last friday with Dovecot 2.0.9
with ~30 imap users. Tested deletion and restore with individual
messages, 1000, and 2000 messages.

Emerson Pinter


On 22-12-2010 14:26, Antonio Perez-Aranda wrote:
> There are some body using delete-to-trash on any version of Dovecot 2.0?
> 


deleted-to-trash-plugin_0.3_test_for_dovecot_20.tar
Description: Unix tar archive


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2010-12-23 Thread fakessh @
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


hello sir.
I find this project plugin to delete trash very ambitious and important.
importance of clearing the trash could be done with this for people who
do not practice "for good uses and customs" the quota system, quota
warnings. this notion of quotas is necessary to clear the trash and then
here
I find this idea plugin be welcome

thanks ...

Le 23.12.2010 19:20, Antonio Perez-Aranda a écrit :
> Maybe, a good solution can be a flag setting to allow this behavior.
> 
> 2010/12/23 Antonio Perez-Aranda :
>> Well, I am making a patch for this.
>>
>> At present, I modify the maildir recalc behavior to avoid count bytes
>> from Deleted messages marked.
>>
>> Now, I modify quota-storage to force to recalc the quota when FLAGS
>> are changed. Well, I need to specify only the flag Deleted, but with
>> this behavior I am happy.
>>
>> 2010/12/23 Antonio Perez-Aranda :
>>> Reading this URL:
>>>
>>> http://www.courier-mta.org/imap/README.maildirquota.html
>>>
>>> It tell about deleted Messages:
>>>
>>> "
>>> The default application configuration that uses this maildirquota
>>> library does not count deleted messages, and any contents of the Trash
>>> folder, against the quota. Messages that are marked as deleted (but
>>> not yet actually removed), or messages that are moved to the Trash
>>> folder (which is subject to automatic purging) do not count towards
>>> the set quota.
>>> "
>>>
>>> Then, maybe ¿Is dovecot not maildirquota Maildir++ Courier compatible?
>>>
>>>
>>>
>>> 2010/12/23 Antonio Perez-Aranda :
 Well, I'm going to describe the behavior thats we need. Maybe it could
 be done with another settings.

 On outlook, well a mail is moved to a outlook local folder, the client
 quota isn't update until the user Purge the imap folder.

 When outlook move a mail, it mark mail as Deleted (flag T) and leave
 it on original folder marked as deleted and copy message to local
 folder.

 On Courier, when user move mails from IMAP Folder to outlook  local
 folder the quota is updated, And when user try to watch quota on a
 Webmail system, the quota is updated.

 Could this behavior made with Dovecot ?

 Another behavior accepted is that all deleted mails goes to Trash
 folder and remove quota from this folder.

 2010/12/22 Antonio Perez-Aranda :
> There are some body using delete-to-trash on any version of Dovecot 2.0?
>
> --
> Antonio Pérez-Aranda Alcaide
> aperezara...@yaco.es
>
> Yaco Sistemas S.L.
> http://www.yaco.es/
> C/ Rioja 5, 41001 Sevilla
> Teléfono +34 954 50 00 57
> Fax  +34 954 50 09 29
>



 --
 Antonio Pérez-Aranda Alcaide
 aperezara...@yaco.es

 Yaco Sistemas S.L.
 http://www.yaco.es/
 C/ Rioja 5, 41001 Sevilla
 Teléfono +34 954 50 00 57
 Fax  +34 954 50 09 29

>>>
>>>
>>>
>>> --
>>> Antonio Pérez-Aranda Alcaide
>>> aperezara...@yaco.es
>>>
>>> Yaco Sistemas S.L.
>>> http://www.yaco.es/
>>> C/ Rioja 5, 41001 Sevilla
>>> Teléfono +34 954 50 00 57
>>> Fax  +34 954 50 09 29
>>>
>>
>>
>>
>> --
>> Antonio Pérez-Aranda Alcaide
>> aperezara...@yaco.es
>>
>> Yaco Sistemas S.L.
>> http://www.yaco.es/
>> C/ Rioja 5, 41001 Sevilla
>> Teléfono +34 954 50 00 57
>> Fax  +34 954 50 09 29
>>
> 
> 
> 


- -- 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x092164A7
gpg --keyserver pgp.mit.edu --recv-key 092164A7
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iD8DBQFNE7QatXI/OwkhZKcRApcdAJ48gFMRaSNor3d3k51QtQHTangWGgCggwik
shA2AONyhlSy72RL+3BYzNA=
=Q/uy
-END PGP SIGNATURE-


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2010-12-23 Thread Antonio Perez-Aranda
Maybe, a good solution can be a flag setting to allow this behavior.

2010/12/23 Antonio Perez-Aranda :
> Well, I am making a patch for this.
>
> At present, I modify the maildir recalc behavior to avoid count bytes
> from Deleted messages marked.
>
> Now, I modify quota-storage to force to recalc the quota when FLAGS
> are changed. Well, I need to specify only the flag Deleted, but with
> this behavior I am happy.
>
> 2010/12/23 Antonio Perez-Aranda :
>> Reading this URL:
>>
>> http://www.courier-mta.org/imap/README.maildirquota.html
>>
>> It tell about deleted Messages:
>>
>> "
>> The default application configuration that uses this maildirquota
>> library does not count deleted messages, and any contents of the Trash
>> folder, against the quota. Messages that are marked as deleted (but
>> not yet actually removed), or messages that are moved to the Trash
>> folder (which is subject to automatic purging) do not count towards
>> the set quota.
>> "
>>
>> Then, maybe ¿Is dovecot not maildirquota Maildir++ Courier compatible?
>>
>>
>>
>> 2010/12/23 Antonio Perez-Aranda :
>>> Well, I'm going to describe the behavior thats we need. Maybe it could
>>> be done with another settings.
>>>
>>> On outlook, well a mail is moved to a outlook local folder, the client
>>> quota isn't update until the user Purge the imap folder.
>>>
>>> When outlook move a mail, it mark mail as Deleted (flag T) and leave
>>> it on original folder marked as deleted and copy message to local
>>> folder.
>>>
>>> On Courier, when user move mails from IMAP Folder to outlook  local
>>> folder the quota is updated, And when user try to watch quota on a
>>> Webmail system, the quota is updated.
>>>
>>> Could this behavior made with Dovecot ?
>>>
>>> Another behavior accepted is that all deleted mails goes to Trash
>>> folder and remove quota from this folder.
>>>
>>> 2010/12/22 Antonio Perez-Aranda :
 There are some body using delete-to-trash on any version of Dovecot 2.0?

 --
 Antonio Pérez-Aranda Alcaide
 aperezara...@yaco.es

 Yaco Sistemas S.L.
 http://www.yaco.es/
 C/ Rioja 5, 41001 Sevilla
 Teléfono +34 954 50 00 57
 Fax      +34 954 50 09 29

>>>
>>>
>>>
>>> --
>>> Antonio Pérez-Aranda Alcaide
>>> aperezara...@yaco.es
>>>
>>> Yaco Sistemas S.L.
>>> http://www.yaco.es/
>>> C/ Rioja 5, 41001 Sevilla
>>> Teléfono +34 954 50 00 57
>>> Fax      +34 954 50 09 29
>>>
>>
>>
>>
>> --
>> Antonio Pérez-Aranda Alcaide
>> aperezara...@yaco.es
>>
>> Yaco Sistemas S.L.
>> http://www.yaco.es/
>> C/ Rioja 5, 41001 Sevilla
>> Teléfono +34 954 50 00 57
>> Fax      +34 954 50 09 29
>>
>
>
>
> --
> Antonio Pérez-Aranda Alcaide
> aperezara...@yaco.es
>
> Yaco Sistemas S.L.
> http://www.yaco.es/
> C/ Rioja 5, 41001 Sevilla
> Teléfono +34 954 50 00 57
> Fax      +34 954 50 09 29
>



-- 
Antonio Pérez-Aranda Alcaide
aperezara...@yaco.es

Yaco Sistemas S.L.
http://www.yaco.es/
C/ Rioja 5, 41001 Sevilla
Teléfono +34 954 50 00 57
Fax      +34 954 50 09 29


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2010-12-23 Thread Antonio Perez-Aranda
Well, I am making a patch for this.

At present, I modify the maildir recalc behavior to avoid count bytes
from Deleted messages marked.

Now, I modify quota-storage to force to recalc the quota when FLAGS
are changed. Well, I need to specify only the flag Deleted, but with
this behavior I am happy.

2010/12/23 Antonio Perez-Aranda :
> Reading this URL:
>
> http://www.courier-mta.org/imap/README.maildirquota.html
>
> It tell about deleted Messages:
>
> "
> The default application configuration that uses this maildirquota
> library does not count deleted messages, and any contents of the Trash
> folder, against the quota. Messages that are marked as deleted (but
> not yet actually removed), or messages that are moved to the Trash
> folder (which is subject to automatic purging) do not count towards
> the set quota.
> "
>
> Then, maybe ¿Is dovecot not maildirquota Maildir++ Courier compatible?
>
>
>
> 2010/12/23 Antonio Perez-Aranda :
>> Well, I'm going to describe the behavior thats we need. Maybe it could
>> be done with another settings.
>>
>> On outlook, well a mail is moved to a outlook local folder, the client
>> quota isn't update until the user Purge the imap folder.
>>
>> When outlook move a mail, it mark mail as Deleted (flag T) and leave
>> it on original folder marked as deleted and copy message to local
>> folder.
>>
>> On Courier, when user move mails from IMAP Folder to outlook  local
>> folder the quota is updated, And when user try to watch quota on a
>> Webmail system, the quota is updated.
>>
>> Could this behavior made with Dovecot ?
>>
>> Another behavior accepted is that all deleted mails goes to Trash
>> folder and remove quota from this folder.
>>
>> 2010/12/22 Antonio Perez-Aranda :
>>> There are some body using delete-to-trash on any version of Dovecot 2.0?
>>>
>>> --
>>> Antonio Pérez-Aranda Alcaide
>>> aperezara...@yaco.es
>>>
>>> Yaco Sistemas S.L.
>>> http://www.yaco.es/
>>> C/ Rioja 5, 41001 Sevilla
>>> Teléfono +34 954 50 00 57
>>> Fax      +34 954 50 09 29
>>>
>>
>>
>>
>> --
>> Antonio Pérez-Aranda Alcaide
>> aperezara...@yaco.es
>>
>> Yaco Sistemas S.L.
>> http://www.yaco.es/
>> C/ Rioja 5, 41001 Sevilla
>> Teléfono +34 954 50 00 57
>> Fax      +34 954 50 09 29
>>
>
>
>
> --
> Antonio Pérez-Aranda Alcaide
> aperezara...@yaco.es
>
> Yaco Sistemas S.L.
> http://www.yaco.es/
> C/ Rioja 5, 41001 Sevilla
> Teléfono +34 954 50 00 57
> Fax      +34 954 50 09 29
>



-- 
Antonio Pérez-Aranda Alcaide
aperezara...@yaco.es

Yaco Sistemas S.L.
http://www.yaco.es/
C/ Rioja 5, 41001 Sevilla
Teléfono +34 954 50 00 57
Fax      +34 954 50 09 29


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2010-12-23 Thread Antonio Perez-Aranda
Reading this URL:

http://www.courier-mta.org/imap/README.maildirquota.html

It tell about deleted Messages:

"
The default application configuration that uses this maildirquota
library does not count deleted messages, and any contents of the Trash
folder, against the quota. Messages that are marked as deleted (but
not yet actually removed), or messages that are moved to the Trash
folder (which is subject to automatic purging) do not count towards
the set quota.
"

Then, maybe ¿Is dovecot not maildirquota Maildir++ Courier compatible?



2010/12/23 Antonio Perez-Aranda :
> Well, I'm going to describe the behavior thats we need. Maybe it could
> be done with another settings.
>
> On outlook, well a mail is moved to a outlook local folder, the client
> quota isn't update until the user Purge the imap folder.
>
> When outlook move a mail, it mark mail as Deleted (flag T) and leave
> it on original folder marked as deleted and copy message to local
> folder.
>
> On Courier, when user move mails from IMAP Folder to outlook  local
> folder the quota is updated, And when user try to watch quota on a
> Webmail system, the quota is updated.
>
> Could this behavior made with Dovecot ?
>
> Another behavior accepted is that all deleted mails goes to Trash
> folder and remove quota from this folder.
>
> 2010/12/22 Antonio Perez-Aranda :
>> There are some body using delete-to-trash on any version of Dovecot 2.0?
>>
>> --
>> Antonio Pérez-Aranda Alcaide
>> aperezara...@yaco.es
>>
>> Yaco Sistemas S.L.
>> http://www.yaco.es/
>> C/ Rioja 5, 41001 Sevilla
>> Teléfono +34 954 50 00 57
>> Fax      +34 954 50 09 29
>>
>
>
>
> --
> Antonio Pérez-Aranda Alcaide
> aperezara...@yaco.es
>
> Yaco Sistemas S.L.
> http://www.yaco.es/
> C/ Rioja 5, 41001 Sevilla
> Teléfono +34 954 50 00 57
> Fax      +34 954 50 09 29
>



-- 
Antonio Pérez-Aranda Alcaide
aperezara...@yaco.es

Yaco Sistemas S.L.
http://www.yaco.es/
C/ Rioja 5, 41001 Sevilla
Teléfono +34 954 50 00 57
Fax      +34 954 50 09 29


Re: [Dovecot] Plugin delete-to-trash on Dovecot 2.0

2010-12-23 Thread Antonio Perez-Aranda
Well, I'm going to describe the behavior thats we need. Maybe it could
be done with another settings.

On outlook, well a mail is moved to a outlook local folder, the client
quota isn't update until the user Purge the imap folder.

When outlook move a mail, it mark mail as Deleted (flag T) and leave
it on original folder marked as deleted and copy message to local
folder.

On Courier, when user move mails from IMAP Folder to outlook  local
folder the quota is updated, And when user try to watch quota on a
Webmail system, the quota is updated.

Could this behavior made with Dovecot ?

Another behavior accepted is that all deleted mails goes to Trash
folder and remove quota from this folder.

2010/12/22 Antonio Perez-Aranda :
> There are some body using delete-to-trash on any version of Dovecot 2.0?
>
> --
> Antonio Pérez-Aranda Alcaide
> aperezara...@yaco.es
>
> Yaco Sistemas S.L.
> http://www.yaco.es/
> C/ Rioja 5, 41001 Sevilla
> Teléfono +34 954 50 00 57
> Fax      +34 954 50 09 29
>



-- 
Antonio Pérez-Aranda Alcaide
aperezara...@yaco.es

Yaco Sistemas S.L.
http://www.yaco.es/
C/ Rioja 5, 41001 Sevilla
Teléfono +34 954 50 00 57
Fax      +34 954 50 09 29


[Dovecot] Plugin delete-to-trash on Dovecot 2.0

2010-12-22 Thread Antonio Perez-Aranda
There are some body using delete-to-trash on any version of Dovecot 2.0?

-- 
Antonio Pérez-Aranda Alcaide
aperezara...@yaco.es

Yaco Sistemas S.L.
http://www.yaco.es/
C/ Rioja 5, 41001 Sevilla
Teléfono +34 954 50 00 57
Fax      +34 954 50 09 29