[Dovecot] sieve vs deliver -m

Stephan Bosch stephan at rename-it.nl
Mon Dec 28 21:43:06 EET 2009


Stephan Bosch wrote:

> What exactly are you trying to achieve here? Do you want to execute the 
> Sieve script only when no -m parameter is specified for deliver? Why? 
> You can also use the subaddress extension in Sieve and get rid of the -m 
> parameter altogether.
>
One issue you may have is that you require that the user should not be 
able to influence delivery based on an address extension. This, however, 
can also be solved entirely using Sieve.

For example:

1) Don't use a -m parameter to deliver for direct folder delivery.

2) Use something like this as a sieve_before script:

require ["fileinto", "variables", "envelope", "subaddress"];

/* Check for an extension and match full value */
if envelope :detail :matches "to" "*" {

   /* Match is available as ${1} by means of the variables extension */
   fileinto "${1}";

   /* Stop further processing in this script;
    *   implicit keep is canceled
    */
   stop;
}

/* Normal messages */

3) Now the user's script is only executed when there is no extension in
    the address.



Regards,

-- 
Stephan Bosch
stephan at rename-it.nl


More information about the dovecot mailing list