Re: [Dovecot] plugin problem

2007-10-01 Thread Tom Bombadil
Anyway, I don't recommend training from pristine because of the resource overhead and it being hard to guarantee the message is indeed pristine, but if it suits you I can't stop you from doing it :) Really? I found the downside of using signatures much worse than not using them: If the

Re: [Dovecot] plugin problem

2007-10-01 Thread Johannes Berg
On Mon, 2007-10-01 at 12:44 -0700, Tom Bombadil wrote: Really? I found the downside of using signatures much worse than not using them: If the backend is mysql, eventually, we have to clean, and optimize the signature tables... And the optimization locks the table. Needless to say, all

Re: [Dovecot] plugin problem

2007-09-30 Thread Lars Stavholm
Johannes Berg wrote: On Sat, 2007-09-29 at 17:03 +0200, Lars Stavholm wrote: Well, I don't have a signature in my hand (when executing the dspam.c code) since i don't use it, I didn't look for it, and didn't retrieve it, so I would need another way of identifying the recipient. Actually

Re: [Dovecot] plugin problem

2007-09-30 Thread Johannes Berg
On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: The problem is that with the dspam setup I'm using, i.e. 3.8.0, Hash driver, shared group, etc. I usually get signature not found, The message from my plugin? I'm guessing then there's some problem with your setup and you

Re: [Dovecot] plugin problem

2007-09-30 Thread Johannes Berg
On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: Input Options - The plugin input options was easy, it seems that dovecot simply puts the options line into an env variable that can be read with the getenv() call, e.g.: dovecot.conf: ... protocol imap { mail_plugins

Re: [Dovecot] plugin problem

2007-09-30 Thread Johannes Berg
On Sat, 2007-09-29 at 19:43 -0300, Fábio M. Catunda wrote: I'm almost there, look, from my log: FROM=Spam FILE=1191103168.P24773Q0M499718.fabio TO=INBOX Looks perfect, but it's not. The real filename is 1191105530.P22847Q0M112390.fabio:2,Sa and not 1191103168.P24773Q0M499718.fabio I'm

Re: [Dovecot] plugin problem

2007-09-30 Thread Lars Stavholm
Johannes Berg wrote: On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: The problem is that with the dspam setup I'm using, i.e. 3.8.0, Hash driver, shared group, etc. I usually get signature not found, The message from my plugin? I'm guessing then there's some problem with your

Re: [Dovecot] plugin problem

2007-09-30 Thread Lars Stavholm
Johannes Berg wrote: On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: Input Options - The plugin input options was easy, it seems that dovecot simply puts the options line into an env variable that can be read with the getenv() call, e.g.: dovecot.conf: ... protocol

Re: [Dovecot] plugin problem

2007-09-30 Thread Johannes Berg
On Sun, 2007-09-30 at 10:57 +0200, Lars Stavholm wrote: Coming from this, I think there are multiple things we should do. Let me try to remember the feature requests I've seen over the past year :) 1) signature logging instead of direct retraining (could use dovecot's dict

Re: [Dovecot] plugin problem

2007-09-30 Thread Timo Sirainen
On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: Another (mildly stupid maybe) question: why the fork() in the original dspam plugin? Seems to me that the fork() + waitpid() doesn't really allow for any advantage over a simple popen() and read the output? I have a sneaky feeling that

Re: [Dovecot] plugin problem

2007-09-30 Thread Timo Sirainen
On Sat, 2007-09-29 at 19:43 -0300, Fábio M. Catunda wrote: I'm almost there, look, from my log: FROM=Spam FILE=1191103168.P24773Q0M499718.fabio TO=INBOX Looks perfect, but it's not. The real filename is 1191105530.P22847Q0M112390.fabio:2,Sa and not 1191103168.P24773Q0M499718.fabio I'm

Re: [Dovecot] plugin problem

2007-09-30 Thread Johannes Berg
On Sun, 2007-09-30 at 13:56 +0300, Timo Sirainen wrote: You already mentioned something about using FIFOs. I'm not exactly sure how the dspam calling works, but I think FIFOs would be the best way to do this and also in mailbox format-independent way. The FIFO he wanted was pushing just the

Re: [Dovecot] plugin problem

2007-09-30 Thread Timo Sirainen
On Sun, 2007-09-30 at 14:10 +0200, Johannes Berg wrote: The copy code has this: keywords_list = mail_get_keywords(mail); keywords = strarray_length(keywords_list) == 0 ? NULL : mailbox_keywords_create(t, keywords_list);

Re: [Dovecot] plugin problem

2007-09-30 Thread Johannes Berg
On Sun, 2007-09-30 at 15:39 +0300, Timo Sirainen wrote: src_trans is used only for reading the mailbox. The only thing committing it does it to possibly update dovecot.index.cache file, which is a good thing to do always. If mailbox_search_deinit() fails it could still mean that some mails

Re: [Dovecot] plugin problem

2007-09-30 Thread Lars Stavholm
Johannes Berg wrote: On Sun, 2007-09-30 at 10:57 +0200, Lars Stavholm wrote: Coming from this, I think there are multiple things we should do. Let me try to remember the feature requests I've seen over the past year :) 1) signature logging instead of direct retraining (could use

Re: [Dovecot] plugin problem

2007-09-30 Thread Lars Stavholm
Timo Sirainen wrote: On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: Another (mildly stupid maybe) question: why the fork() in the original dspam plugin? Seems to me that the fork() + waitpid() doesn't really allow for any advantage over a simple popen() and read the output? I have a

Re: [Dovecot] plugin problem

2007-09-30 Thread Timo Sirainen
On Sun, 2007-09-30 at 18:00 +0200, Lars Stavholm wrote: Timo Sirainen wrote: On Sun, 2007-09-30 at 09:30 +0200, Lars Stavholm wrote: Another (mildly stupid maybe) question: why the fork() in the original dspam plugin? Seems to me that the fork() + waitpid() doesn't really allow for any

[Dovecot] plugin problem

2007-09-29 Thread Lars Stavholm
I'm trying to do a rewrite of the dspam_plugin for dovecot 1.1b1. There are some API changes that warranted an update of the plugin. Also, I wanted the dspam_plugin to be able to handle pristine mails for dspam retraining, as opposed to the signature based retraining. Question: How can I retrieve

Re: [Dovecot] plugin problem

2007-09-29 Thread Lars Stavholm
Johannes Berg wrote: On Sat, 2007-09-29 at 12:44 +0200, Lars Stavholm wrote: I'm trying to do a rewrite of the dspam_plugin for dovecot 1.1b1. Cool. I never imagined that the plugin would find such wide-spread use :) Well, it's only me, don't know if anyone else uses it. Still, I think it's

Re: [Dovecot] plugin problem

2007-09-29 Thread Johannes Berg
On Sat, 2007-09-29 at 13:17 +0200, Lars Stavholm wrote: Cool. I never imagined that the plugin would find such wide-spread use :) Well, it's only me, don't know if anyone else uses it. Still, I think it's a brilliant idea. Doesn't get any more user friendly. Some other people are doing

Re: [Dovecot] plugin problem

2007-09-29 Thread Johannes Berg
On Sat, 2007-09-29 at 17:03 +0200, Lars Stavholm wrote: Well, I don't have a signature in my hand (when executing the dspam.c code) since i don't use it, I didn't look for it, and didn't retrieve it, so I would need another way of identifying the recipient. Actually only setups that use

Re: [Dovecot] plugin problem

2007-09-29 Thread Fábio M. Catunda
Lars Stavholm escreveu: Let's try to keep this on the list, shall we. Sorry, my TB dont like the reply-to header. Have a look at Johannes Berg's reply above: the Maildir format would have a file for each mail message, other formats would not. Well, some plugins only works with Maildir,

Re: [Dovecot] plugin problem

2007-09-29 Thread Johannes Berg
On Sat, 2007-09-29 at 17:23 +0200, Lars Stavholm wrote: Q: And if the user moves a message from Spam folder to trash folder, will it be considered innocent? A: Thats a big problem. When a message is deleted by a MUA its usually copied from one folder to another and then deleted, but there

Re: [Dovecot] plugin problem

2007-09-29 Thread Johannes Berg
On Sat, 2007-09-29 at 12:52 -0300, Fábio M. Catunda wrote: Well, some plugins only works with Maildir, mine will be another one of those. That's pretty sad for a general mail plugin but hey :) Thats the question, this is not a problem if you right it to a file, but if you decide to

Re: [Dovecot] plugin problem

2007-09-29 Thread Lars Stavholm
Fábio M. Catunda wrote: Lars Stavholm escreveu: Let's try to keep this on the list, shall we. Sorry, my TB dont like the reply-to header. Have a look at Johannes Berg's reply above: the Maildir format would have a file for each mail message, other formats would not. Well, some

Re: [Dovecot] plugin problem

2007-09-29 Thread Fábio M. Catunda
Johannes Berg escreveu: Well, if the user insist on deleting his spam folder *and* has a client that insists on using a trash folder (I tell people using my setup to turn off trash folders) then there may be a problem. But my plugin has an option to ignore trash folders. Maybe I'm missing

Re: [Dovecot] plugin problem

2007-09-29 Thread Lars Stavholm
Johannes Berg wrote: On Sat, 2007-09-29 at 17:23 +0200, Lars Stavholm wrote: Q: And if the user moves a message from Spam folder to trash folder, will it be considered innocent? A: Thats a big problem. When a message is deleted by a MUA its usually copied from one folder to another and then

Re: [Dovecot] plugin problem

2007-09-29 Thread Aria Stewart
I don't see this as a problem at all (why create one when there's none to be found:): * Move message into Spam: it's a spam that should be reclassified. * Move message out of Spam: it's a ham that should be reclassified. Don't really care where the mail comes from or where it is moved.

Re: [Dovecot] plugin problem

2007-09-29 Thread Johannes Berg
On Sat, 2007-09-29 at 13:29 -0300, Fábio M. Catunda wrote: Maybe I'm missing something, but is there a way in your pluggin to ignore more than one folder? Different clients create different folders for trash, this is another problem for my setup. Not right now, but it's trivial to add. You

Re: [Dovecot] plugin problem

2007-09-29 Thread Fábio M. Catunda
I'm almost there, look, from my log: FROM=Spam FILE=1191103168.P24773Q0M499718.fabio TO=INBOX Looks perfect, but it's not. The real filename is 1191105530.P22847Q0M112390.fabio:2,Sa and not 1191103168.P24773Q0M499718.fabio I'm using this function to get filename: filename =