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