[Dovecot] sieve vs deliver -m
I'm invoking deliver through postfix with a dovecot transport in master.cf, using the -m ${extension} argument. If I have no sieve script, or a sieve script with an implicit keep, the mail gets correctly filed into the -m mailbox.
However if the sieve script has an explicit discard, this gets honored if it doesn't match another sieve action.
Shouldn't -m take precedence? I would say that if an extension is present any other sieve action should be ignored, perhaps just sieve_before should be run then the message filed per the extension.
-frank
Frank Cusack wrote:
I'm invoking deliver through postfix with a dovecot transport in master.cf, using the -m ${extension} argument. If I have no sieve script, or a sieve script with an implicit keep, the mail gets correctly filed into the -m mailbox.
However if the sieve script has an explicit discard, this gets honored if it doesn't match another sieve action.
Shouldn't -m take precedence? I would say that if an extension is present any other sieve action should be ignored, perhaps just sieve_before should be run then the message filed per the extension.
Currently, deliver's -m parameter value is used by the Sieve plugin as the 'default folder', which is where a keep action should store the message (which is normally "INBOX"). If no implicit or explicit keep is executed in the Sieve script, e.g. because discard is executed, the message will not be stored in that default folder.
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.
Regards,
-- Stephan Bosch stephan@rename-it.nl
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:
Don't use a -m parameter to deliver for direct folder delivery.
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 */
- Now the user's script is only executed when there is no extension in the address.
Regards,
-- Stephan Bosch stephan@rename-it.nl
On December 28, 2009 8:30:11 PM +0100 Stephan Bosch stephan@rename-it.nl 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.
In this specific case, I'm trying to make sure a message *at least* gets filed into the folder specified by the extension, regardless of whatever else happens to it. I don't want a mistake or some other action in a sieve script to cause it to get misfiled. I would like the sieve scripts to run but also I want to guarantee that the message makes it into the folder specified by +extension.
I've solved it for now by making sure all such mail for this account is addressed with +extensions, and have eliminated the sieve script for this user. Which is probably a good solution for me in the long term as well.
-frank
Frank Cusack wrote:
On December 28, 2009 8:30:11 PM +0100 Stephan Bosch stephan@rename-it.nl 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.
In this specific case, I'm trying to make sure a message *at least* gets filed into the folder specified by the extension, regardless of whatever else happens to it. I don't want a mistake or some other action in a sieve script to cause it to get misfiled. I would like the sieve scripts to run but also I want to guarantee that the message makes it into the folder specified by +extension.
See the solution I presented elsewhere in this thread. That should do just that.
Regards,
Stephan.
On December 28, 2009 10:50:32 PM +0100 Stephan Bosch stephan@rename-it.nl wrote:
See the solution I presented elsewhere in this thread. That should do just that.
Not if the user has control over his sieve scripts though (in which case anything can happen).
-frank
Frank Cusack wrote:
On December 28, 2009 10:50:32 PM +0100 Stephan Bosch stephan@rename-it.nl wrote:
See the solution I presented elsewhere in this thread. That should do just that.
Not if the user has control over his sieve scripts though (in which case anything can happen).
That's the idea of a sieve_before script. That can only be set and administered by the system administrator. If the script finishes without error, all actions executed therein are definitive and cannot be influenced by the subsequently executed user script.
Regards,
Stephan.
On December 28, 2009 11:02:19 PM +0100 Stephan Bosch stephan@rename-it.nl wrote:
Frank Cusack wrote:
On December 28, 2009 10:50:32 PM +0100 Stephan Bosch stephan@rename-it.nl wrote:
See the solution I presented elsewhere in this thread. That should do just that.
Not if the user has control over his sieve scripts though (in which case anything can happen).
That's the idea of a sieve_before script. That can only be set and administered by the system administrator. If the script finishes without error, all actions executed therein are definitive and cannot be influenced by the subsequently executed user script.
ah, yes now i see. thanks.
participants (2)
-
Frank Cusack
-
Stephan Bosch