[Dovecot] How about a "pipe" plugin?
Hi,
I have written a plugin so that each time a message is added to a
specific box, a program is run and the message is piped into it. Note
that the message is also really added to the box.
I've been using it for nearly 3 month, for spam/ham learning, and have
not had any problem with it. I guess it could also be used to
implement an out box (I remember seeing someone asking for such a
feature on this list). Currently, I use it with a config like this:
(...) namespace private { separator = . location = maildir:/var/mail/%u inbox = yes hidden = no }
namespace public { separator = . prefix = learn. location = maildir:/var/learn/%u inbox = no hidden = no } (...) plugin { (...) pipe = /var/learn/%u/.spam:spamc -d some.host -L spam pipe2 = /var/learn/%u/.ham:spamc -d some.host -L ham (...) }
Would people be interested by such a feature? If enough people show
some interest, I can try to convince my boss to let me release this
plugin GPL-licensed.
Cheers,
Nicolas Boullis
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Nicolas Boullis schrieb:
Hi,
I have written a plugin so that each time a message is added to a specific box, a program is run and the message is piped into it. Note that the message is also really added to the box.
I've been using it for nearly 3 month, for spam/ham learning, and have not had any problem with it. I guess it could also be used to implement an out box (I remember seeing someone asking for such a feature on this list). Currently, I use it with a config like this:
(...) namespace private { separator = . location = maildir:/var/mail/%u inbox = yes hidden = no }
namespace public { separator = . prefix = learn. location = maildir:/var/learn/%u inbox = no hidden = no } (...) plugin { (...) pipe = /var/learn/%u/.spam:spamc -d some.host -L spam pipe2 = /var/learn/%u/.ham:spamc -d some.host -L ham (...) }
Would people be interested by such a feature? If enough people show some interest, I can try to convince my boss to let me release this plugin GPL-licensed.
Cheers,
Nicolas Boullis
Hi Nicola, that sounds interesting, even spam learning can be done in other ways too ( filters etc ) ,but in general its a nice to have feature
Mit freundlichen Gruessen Best Regards
Robert Schetterer
https://www.schetterer.org Munich/Bavaria/Germany -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFGVTYBfGH2AvR16oERAlxrAJwI8kKPvUHb2/dLqO0VihYAfPJDLgCfdMrN m+SnQec2K2yySN6A8HrqSOQ= =qDeV -----END PGP SIGNATURE-----
Nicolas Boullis wrote: Hi,
I have written a plugin so that each time a message is added to a specific box, a program is run and the message is piped into it. Note that the message is also really added to the box.
I've been using it for nearly 3 month, for spam/ham learning, and have not had any problem with it. I guess it could also be used to implement an out box (I remember seeing someone asking for such a feature on this list). Currently, I use it with a config like this:
[clip]
Would people be interested by such a feature? If enough people show some interest, I can try to convince my boss to let me release this plugin GPL-licensed.
I'm also definitely interested. I've been looking for a good way to integrate client- and server-side spam filtering, and this looks great.
On Wed, 2007-05-23 at 23:02 +0200, Nicolas Boullis wrote:
I have written a plugin so that each time a message is added to a
specific box, a program is run and the message is piped into it. Note
that the message is also really added to the box.
I guess I could also say that I've been going to implement something similar to Dovecot some day as well. Although I was thinking about a bit more generic event plugin which supported more than just copying. But a pipe plugin would be a great start towards that. Most people would use it only for spam/ham learning anyway.
pipe = /var/learn/%u/.spam:spamc -d some.host -L spam pipe2 = /var/learn/%u/.ham:spamc -d some.host -L ham
I think using mailbox names would be better than paths, but I know that v1.0's code base doesn't really make this possible. Perhaps with v1.1 then switch to using mailbox names.
23.05.2007 23:02 Nicolas Boullis:
I have written a plugin so that each time a message is added to a
specific box, a program is run and the message is piped into it.
Note that the message is also really added to the box.
I'm totally in. There is this dspam plugin by Johannes Berg mentioned
on the dovecot plugin page which has the nice feature of managing
spam-learning with just one folder. But I think your more generic
approach by using pipes and making the command execution configurable
is more nifty (and not limited to spam-learning). But for spam-
learning Johannes' approach is a more intuitive way: As prerequisite
mail recognized as spam by the filter is put into a spam folder by
some mechanism (maildrop, sieve). Then by removing a mail from the
spam folder, a mail is relearned as ham. By adding a mail to the spam
folder, the mail is learned as spam. From my experience users easily
understand putting spam into a spamfolder (with imap, with pop3
forwarding spam to a spam-box didn't work well) but nearly anybody
actually does ham-learning if another folder is involved where mail
has to be copied to. The spam learning would be fine with your plugin
but is there a way to trigger ham learning when a mail is added to
any other mail folder than spam?
Marc
On Thu, 2007-05-24 at 23:22 +0200, Marc Delling wrote:
The spam learning would be fine with your plugin
but is there a way to trigger ham learning when a mail is added to
any other mail folder than spam?
He said that after the message was piped away it's still copied to the destination folder. Hence, you'd only need to run the pipe plugin on all available folders. Should probably be doable. Though I don't see the point much then vs. modifying my plugin which actually gives feedback when something goes wrong (though of course I don't know if the pipe plugin also does)
johannes
25.05.2007 11:52 Johannes Berg:
He said that after the message was piped away it's still copied to the destination folder. Hence, you'd only need to run the pipe plugin
on all available folders. Should probably be doable.
Yes, but as I understand it there is not easy way to manage that. The
plugin cannot be configured like:
pipe 1: all mail added to folders named spam pipe 2: all mail added to folders not named spam
so you have to create a pipe for each folder where all except one do
the same thing. And you would have restrict users capability to
create new folders, otherwise you would have to edit the plugins
config everytime a user decides to have a new one. Regex-matching on
foldernames would do the trick. Or a pipe triggered on copy-and-delete.
Marc
participants (6)
-
Aredridel
-
Johannes Berg
-
Marc Delling
-
Nicolas Boullis
-
Robert Schetterer
-
Timo Sirainen