[Dovecot] Optional Sieve includes
I (think that I) want a global Sieve setup like this: require ["include"]; include :global "spam.sieve"; include :personal "folders.sieve"; include :personal "vacation.sieve"; ... that does not fail if a user has not created the personal filters. Any ideas how to do something like that? I read the source, but it seems that a failed include will exit the Sieve, so the above will not work. Incidentally, I think I found a typo, so a patch is below. Anders. --- dovecot-sieve-1.1.4/src/sieve-cmu.c~ 2008-02-16 19:24:51.000000000 +0100 +++ dovecot-sieve-1.1.4/src/sieve-cmu.c 2008-02-25 20:36:25.000000000 +0100 @@ -369,7 +369,7 @@ if (isglobal) { script_dir = getenv("SIEVE_GLOBAL_DIR"); if (script_dir == NULL) { - i_info("include: global_script_dir not set " + i_info("include: sieve_global_dir not set " "(wanted script %s)", str_sanitize(script, 80)); return SIEVE_FAIL; }
Anders wrote:
I (think that I) want a global Sieve setup like this:
require ["include"]; include :global "spam.sieve"; include :personal "folders.sieve"; include :personal "vacation.sieve";
Okay, no help for having an optional include. My fallback solution is to create the personal sieves as empty files, but how would I best do that? These are virtual users, so there is no /etc/skel to copy.
I was thinking about a post-login script, but sieves can run before anybody logs in. Is there a way to wrap the deliver LDA, to have it create these files just as the first mail arrives?
Anders.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 27 Feb 2008, Anders wrote:
Okay, no help for having an optional include. My fallback solution is to
Well, it's all open source, did you look at it? It shouldn't be too hard to just ignore the result of include, no?
create the personal sieves as empty files, but how would I best do that?
I was thinking about a post-login script, but sieves can run before anybody logs in. Is there a way to wrap the deliver LDA, to have it create these files just as the first mail arrives?
You can do either of them, you can wrap the LDA easily with a bash script or a C programm, then exec() the LDA, but this will be done _each_ time a mail comes in. I don't like it.
How do you create your users? Would it be possible to add on some script, in order to prepare the users on the mail storage server? Or run a cron script once an hour to look for new users and create the files.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHxRSwVJMDrex4hCIRAt+1AJ9wKkofOsqwpr41svbR2cx2OPcXZACdEoTZ fL7GBtB2ya/GDDiIY70fNMw= =veGC -----END PGP SIGNATURE-----
Steffen Kaiser wrote:
Well, it's all open source, did you look at it? It shouldn't be too hard to just ignore the result of include, no?
Yeah, I did look.
I sure could patch something together. Before doing that, though, I hoped to be enlightened with an official way, so I would not have to drag around obscure modifications.
Probably the cron script is how it will end up.
Anders.
On Wed, 2008-02-27 at 20:32 +0100, Anders wrote:
Steffen Kaiser wrote:
Well, it's all open source, did you look at it? It shouldn't be too hard to just ignore the result of include, no?
Yeah, I did look.
I sure could patch something together. Before doing that, though, I hoped to be enlightened with an official way, so I would not have to drag around obscure modifications.
I don't think there will be any upstream modifications at least:
SIEVE implementations MUST handle missing scripts being referenced via an includes in an existing script. An error MUST be generated when a missing included script is descovered during execution.
Then again the include draft expired over a year ago.
participants (3)
-
Anders
-
Steffen Kaiser
-
Timo Sirainen