> So maybe for a post to "[EMAIL PROTECTED]", > the script would be in /var/lib/sieve/system/public/interestingmessages/ ? > Or would this be tooo bizarre? > > I'd love to have the ability of running Sieve for some of our shared > folders, but must admit to being a tad concerned about running *all* > our shared folder mail through one script. I don't know about > y'all, but we've got at least a hundred or so shared folders. At > the very least this might make for a somewhat unwieldy script. Some > of these folders also see a lot of traffic, so for these I'd be > inclined to not have them go through a script at all. >
Mmmmm... That seems to be a reasonable thing to want to do.... The concept of "scope" in sieve is a bit lacking.. It could be argued that there is a similar limitation in the processing of an individuals folders... Again, you could concievably want different, complex scripts for different subfolders... At the moment, sieve just applies to "INBOX". Of course, it would be nice to invoke sieve at arbitrary times - not just at delivery either... Oh dear. I can see a whole new imap function coming on - ". SIEVE folder script"... Anyway, deliver is doing: sieve( username, "user.username", default ), and you want to be able to do sieve( "anyone", some.arbitrary.folder, default ) ie. sieve( security_context, folder_to_sieve, script_to_sieve_with ). So... the function sieve_find_script (returns handle to script file) needs some extra parameters - in addition to the user, it wants the name of a folder ("INBOX" being the default for a user), then it wants to look in subdirectories until it finds the best match. FUNC sieve_find_script( string user, string folder_spec ) { /* folder_spec might be some.interesting.folder */ directory is firstpart of folderspec if directory exists then directory is concat( directory + next element of folderspec ) repeat that bit until it no longer exists endif then open the file "default" in the last directory found... } Does that make sense? Given that sievesystemscripts == /var/lib/sieve/system So.. call sieve_find_script( anyone, "some.interesting.folder" ) if the directory /var/lib/sieve/some exists then look for the directory /var/lib/sieve/some/interesting, if that exists look for the directory /var/lib/some/interesting/folder. so it would try /var/lib/sieve/some/interesting/folder/default, then /var/lib/sieve/some/interesting/default, then /var/lib/sieve/some/default and finally /var/lib/sieve/default. A handy side effect of simply checking the directory, rather than for the presence of the file "default" would be that if default did not exist then no script would be run... so you could have a script applying only to some folders in the middle of the hierarchy... not above, and not below. I'll code that up if you like an you can try it ;-).