Mercurial > dovecot > core-2.2
changeset 22391:e8bf64a8bb8f
lib-storage: MAIL_STORAGE_SERVICE_FLAG_NO_PLUGINS wasn't working correctly
Especially with "doveadm user" it still triggered running the plugins,
because doveadm loads all the plugins early.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sun, 30 Jul 2017 09:39:18 +0300 |
parents | 110cf7691bba |
children | abbd57ae531d |
files | src/lib-storage/mail-storage-service.c |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/mail-storage-service.c Tue Jul 11 14:34:06 2017 +0200 +++ b/src/lib-storage/mail-storage-service.c Sun Jul 30 09:39:18 2017 +0300 @@ -1296,6 +1296,19 @@ ret = -2; } } + if ((ctx->flags & MAIL_STORAGE_SERVICE_FLAG_NO_PLUGINS) != 0 && + user_set->mail_plugins[0] != '\0') { + /* mail_storage_service_load_modules() already avoids loading + plugins when the _NO_PLUGINS flag is set. However, it's + possible that the plugins are already loaded, because the + plugin loading is a global state. This is especially true + with doveadm, which loads the mail_plugins immediately at + startup so it can find commands registered by plugins. It's + fine that extra plugins are loaded - we'll just need to + prevent any of their hooks from being called. One easy way + to do this is just to clear out the mail_plugins setting: */ + (void)settings_parse_line(user->set_parser, "mail_plugins="); + } *user_r = user; return ret;