[Dovecot] VERY cool add-on request.

Johannes Berg johannes at sipsolutions.net
Sat Mar 18 16:38:19 EET 2006


On Sat, 2006-03-18 at 09:25 -0500, David A. Lee wrote:
> You refered to a specific one for dspam.
> Would it be easy to generalize ?

Yes, shouldn't be too hard.
But the plugin also looks at headers etc. which would be very hard to
capture in a config file. Well, not impossible, but cumbersome.

I'm not sure what you're after but say you want to be able to define
folder actions in a config file. Let me draw up a hypothetical config
file example with the logic of the dspam plugin. The syntax is sort of
borrowed from Exim :)

----begin folder action config----
copy into "SPAM"
	fail condition !${defined:header:X-DSpam-Signature}
	fail message "Message doesn't have dspam signature!"
	run "dspam --signature ${header:X-DSpam-Signature} --is-spam"

copy outof "SPAM"
	ignore to "Trash"
	fail condition !${defined:header:X-DSpam-Signature}
	fail message "Message doesn't have dspam signature!"
	run "dspam --signature ${header:X-DSpam-Signature} --not-spam"
----end folder action config----

I'm sure others can come up with examples where the config file has to
be even more elaborate... I can imagine having a 'pipe' action instead
of 'run' that would give the command the message on stdin for example.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 793 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060318/beac36f2/attachment.pgp


More information about the dovecot mailing list