dovecot-2.2-pigeonhole: lib-sieve: storage: Changed configuratio...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Thu May 7 19:10:55 UTC 2015
details: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/d4aa9ddf3efd
changeset: 2045:d4aa9ddf3efd
user: Stephan Bosch <stephan at rename-it.nl>
date: Thu May 07 21:10:37 2015 +0200
description:
lib-sieve: storage: Changed configuration of default script visibility feature.
Using a location option for the default name makes no sense if its only used for the main personal script.
diffstat:
INSTALL | 31 +++++++++++++++----------------
src/lib-sieve/sieve-storage.c | 36 ++++++++++++++++--------------------
2 files changed, 31 insertions(+), 36 deletions(-)
diffs (168 lines):
diff -r 70a3e6c5bb1f -r d4aa9ddf3efd INSTALL
--- a/INSTALL Wed May 06 23:58:57 2015 +0200
+++ b/INSTALL Thu May 07 21:10:37 2015 +0200
@@ -126,11 +126,6 @@
Multiple mail users can share a single script directory if the script
location is the same and all users share the same system credentials (uid,
gid).
-
- default=<script-name>
- The name by which the default Sieve script (see `sieve_default=' setting
- below) is visible to ManageSieve clients. Normally, it is not visible at
- all. See "Visible Default Script" section below for more information.
Sieve Interpreter - Basic Configuration
---------------------------------------
@@ -171,9 +166,12 @@
/var/lib/dovecot/default.sieve. This is usually a global script, so be sure
to pre-compile this script manually using the sievec command line tool, as
explained in the README file. This setting used to be called
- `sieve_global_path', but that name is now deprecated. See the "Visible
- Default Script" section below for information on how to make the default
- script visible from ManageSieve.
+ `sieve_global_path', but that name is now deprecated.
+
+ sieve_default_name =
+ The name by which the default Sieve script is visible to ManageSieve
+ clients. Normally, it is not visible at all. See "Visible Default Script"
+ section below for more information.
sieve_global =
Location for :global include scripts for the Sieve include extension. This
@@ -401,8 +399,9 @@
The `sieve_default=' setting specifies the location of a default script that
is executed when the user has no active personal script. Normally, this
default script is invisible to the user; i.e., it is not listed in ManageSieve.
-To give the user the ability to base a custom personal script on the default
-script, it is possible to make it visible under a specific configurable name.
+To give the user the ability to see and read the default script, it is possible
+to make it visible under a specific configurable name using the
+`sieve_default_name' setting.
ManageSieve will magically list the default script under that name, even though
it does not actually exist in the user's normal script storage location. This
@@ -420,19 +419,19 @@
default script. If the user ever wants to revert to the default, the user only
needs to delete the edited script and the default will reappear.
-To enable this feature, the the `;default=<script-name>' option must be
-specified for the `sieve=' setting. It configures the name by which the default
-script will be known. Of course, the `sieve_default=' setting needs to point to
-a valid script location as well for this to work. If the default script does not
-exist at the indicated location, it is not shown.
+The name by which the default script will be known is configured using the
+`sieve_default_name' setting. Of course, the `sieve_default' setting needs to
+point to a valid script location as well for this to work. If the default script
+does not exist at the indicated location, it is not shown.
For example:
plugin {
...
- sieve = file:~/sieve;active=~/.dovecot.sieve;default=roundcube
+ sieve = file:~/sieve;active=~/.dovecot.sieve
sieve_default = /var/lib/dovecot/sieve/default.sieve
+ sieve_default_name = roundcube
}
Sieve Interpreter - Extension Configuration
diff -r 70a3e6c5bb1f -r d4aa9ddf3efd src/lib-sieve/sieve-storage.c
--- a/src/lib-sieve/sieve-storage.c Wed May 06 23:58:57 2015 +0200
+++ b/src/lib-sieve/sieve-storage.c Thu May 07 21:10:37 2015 +0200
@@ -199,15 +199,6 @@
if ( storage->script_name == NULL )
storage->script_name = p_strdup(storage->pool, option+5);
- } else if ( strncasecmp(option, "default=", 8) == 0 ) {
- if ( option[8] == '\0' ) {
- /* skip if empty */
- continue;
- }
-
- if ( storage->default_name == NULL )
- storage->default_name = p_strdup(storage->pool, option+8);
-
} else if ( strncasecmp(option, "bindir=", 7) == 0 ) {
const char *bin_dir = option+7;
@@ -479,7 +470,7 @@
enum sieve_storage_flags flags, enum sieve_error *error_r)
{
struct sieve_storage *storage;
- const char *set_sieve_default;
+ const char *set_default, *set_default_name;
enum sieve_error error;
if ( error_r != NULL )
@@ -488,21 +479,26 @@
error_r = &error;
/* Determine location for default script */
- set_sieve_default =
+ set_default =
sieve_setting_get(svinst, "sieve_default");
- if ( set_sieve_default == NULL ) {
+ if ( set_default == NULL ) {
/* For backwards compatibility */
- set_sieve_default =
+ set_default =
sieve_setting_get(svinst, "sieve_global_path");
}
+ set_default_name =
+ sieve_setting_get(svinst, "sieve_default_name");
/* Attempt to locate user's main storage */
storage = sieve_storage_do_create_main(svinst, user, flags, error_r);
+ storage->default_name =
+ p_strdup_empty(storage->pool, set_default_name);
+
if ( storage != NULL ) {
/* Success; record default script location for later use */
storage->default_location =
- p_strdup_empty(storage->pool, set_sieve_default);
+ p_strdup_empty(storage->pool, set_default);
if (storage->default_location != NULL &&
storage->default_name != NULL) {
@@ -516,33 +512,33 @@
/* Failed; try using default script location
(not for temporary failures, read/write access, or dsync) */
- if ( set_sieve_default == NULL ) {
+ if ( set_default == NULL ) {
sieve_sys_debug(svinst, "storage: "
"No default script location configured");
} else {
sieve_sys_debug(svinst, "storage: "
"Trying default script location `%s'",
- set_sieve_default);
+ set_default);
storage = sieve_storage_create
- (svinst, set_sieve_default, 0, error_r);
+ (svinst, set_default, 0, error_r);
if ( storage == NULL ) {
switch ( *error_r ) {
case SIEVE_ERROR_NOT_FOUND:
sieve_sys_debug(svinst, "storage: "
"Default script location `%s' not found",
- set_sieve_default);
+ set_default);
break;
case SIEVE_ERROR_TEMP_FAILURE:
sieve_sys_error(svinst, "storage: "
"Failed to access default script location `%s' "
"(temporary failure)",
- set_sieve_default);
+ set_default);
break;
default:
sieve_sys_error(svinst, "storage: "
"Failed to access default script location `%s'",
- set_sieve_default);
+ set_default);
break;
}
}
More information about the dovecot-cvs
mailing list